Re: [PATCH 05.1/16] of:overlay: missing name, phandle, linux, phandle in new nodes

2018-10-09 Thread Frank Rowand
On 10/09/18 23:04, frowand.l...@gmail.com wrote: > From: Frank Rowand > > > "of: overlay: use prop add changeset entry for property in new nodes" > fixed a problem where an 'update property' changeset entry was > created for properties contained in nodes added by a changeset. > The fix was to us

Re: [PATCH v2] powerpc/perf: Quiet IMC PMU registration message

2018-10-09 Thread Stewart Smith
Joel Stanley writes: > On a Power9 box we get a few screens full of these on boot. Drop > them to pr_debug. > > [5.993645] nest_centaur6_imc performance monitor hardware support > registered > [5.993728] nest_centaur7_imc performance monitor hardware support > registered > [5.996510]

[PATCH 2/2] powerpc/pseries: Add driver for PAPR SCM regions

2018-10-09 Thread Oliver O'Halloran
Adds a driver that implements support for enabling and accessing PAPR SCM regions. Unfortunately due to how the PAPR interface works we can't use the existing of_pmem driver (yet) because: a) The guest is required to use the H_SCM_BIND_MEM h-call to add add the SCM region to it's physical add

[PATCH 1/2] powerpc/pseries: PAPR persistent memory support

2018-10-09 Thread Oliver O'Halloran
This patch implements support for discovering storage class memory devices at boot and for handling hotplug of new regions via RTAS hotplug events. Signed-off-by: Oliver O'Halloran --- arch/powerpc/include/asm/firmware.h | 3 ++- arch/powerpc/include/asm/hvcall.h | 10 +-

PAPR SCM support

2018-10-09 Thread Oliver O'Halloran
This series adds support for the para-virtualised storage class memory interface defined by the Power Architecture Platform Reference. Patch 1 implements the pseries device discovery (via DT) and hotplug support (via RTAS hotplug interrupt). Patch 2 implements a driver that binds to the platform

[PATCH 05.1/16] of:overlay: missing name, phandle, linux, phandle in new nodes

2018-10-09 Thread frowand . list
From: Frank Rowand "of: overlay: use prop add changeset entry for property in new nodes" fixed a problem where an 'update property' changeset entry was created for properties contained in nodes added by a changeset. The fix was to use an 'add property' changeset entry. This exposed more bugs in

Re: [PATCH] powerpc/rtasd: Improve unknown error logging

2018-10-09 Thread Vasant Hegde
On 10/10/2018 10:53 AM, Oliver O'Halloran wrote: Currently when we get an unknown RTAS event it prints the type as "Unknown" and no other useful information. Add the raw type code to the log message so that we have something to work off. Yeah. Useful one. Reviewed-by: Vasant Hegde -Vasant

Re: [PATCH] powerpc/topology: Update numa mask when cpu node mapping changes

2018-10-09 Thread Srikar Dronamraju
* Srikar Dronamraju [2018-10-10 09:54:46]: > Commit 2ea626306810 ("powerpc/topology: Get topology for shared > processors at boot") will update the cpu node topology for shared lpars > on PowerVM. > > However shared lpars on PowerVM also support VPHN and PRRN events. > On receiving a VPHN, PRRN

[PATCH] powerpc/rtasd: Improve unknown error logging

2018-10-09 Thread Oliver O'Halloran
Currently when we get an unknown RTAS event it prints the type as "Unknown" and no other useful information. Add the raw type code to the log message so that we have something to work off. Signed-off-by: Oliver O'Halloran --- arch/powerpc/kernel/rtasd.c | 6 -- 1 file changed, 4 insertions(+

[PATCH 4/4] powerpc: Add -Wimplicit-fallthrough to arch CFLAGS

2018-10-09 Thread Michael Ellerman
Warn whenever a switch statement has a fallthrough without a comment annotating it. Signed-off-by: Michael Ellerman --- arch/powerpc/Kbuild | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/Kbuild b/arch/powerpc/Kbuild index 86b261d6bde5..ef625f1db576 100644 --- a/arch/powerpc/Kbu

[PATCH 3/4] powerpc: Add -Wvla to arch CFLAGS

2018-10-09 Thread Michael Ellerman
Upstream has declared that Variable Length Array's (VLAs) are a bad idea, and eventually -Wvla will be added to the top-level Makefile. We can go one better and make sure we don't introduce any more by adding it to the arch Makefile. Signed-off-by: Michael Ellerman --- arch/powerpc/Kbuild | 3 ++

[PATCH 2/4] powerpc: Add -Werror at arch/powerpc level

2018-10-09 Thread Michael Ellerman
Back when I added -Werror in commit ba55bd74360e ("powerpc: Add configurable -Werror for arch/powerpc") I did it by adding it to most of the arch Makefiles. At the time we excluded math-emu, because apparently it didn't build cleanly. But that seems to have been fixed somewhere in the interim. So

[PATCH 1/4] powerpc: Move core kernel logic into arch/powerpc/Kbuild

2018-10-09 Thread Michael Ellerman
This is a nice cleanup, arch/powerpc/Makefile is long and messy so moving this out helps a little. It also allows us to do: $ make arch/powerpc Which can be helpful if you just want to compile test some changes to arch code and not link everything. Finally it also gives us a single place to d

Re: [PATCH 21/36] dt-bindings: arm: Convert TI davinci board/soc bindings to json-schema

2018-10-09 Thread Sekhar Nori
On Friday 05 October 2018 10:28 PM, Rob Herring wrote: > Convert TI Davinci SoC bindings to DT schema format using json-schema. > > Cc: Sekhar Nori > Cc: Kevin Hilman > Cc: Mark Rutland > Cc: devicet...@vger.kernel.org > Signed-off-by: Rob Herring > --- > .../devicetree/bindings/arm/davinci.t

[PATCH] powerpc/topology: Update numa mask when cpu node mapping changes

2018-10-09 Thread Srikar Dronamraju
Commit 2ea626306810 ("powerpc/topology: Get topology for shared processors at boot") will update the cpu node topology for shared lpars on PowerVM. However shared lpars on PowerVM also support VPHN and PRRN events. On receiving a VPHN, PRRN events, cpu to node mapping might change. Scheduler main

[PATCH 2/2] powerpc/boot: Build boot wrapper with optimisations

2018-10-09 Thread Joel Stanley
The boot wrapper is currently built with -Os. By building with O2 we can meaningfully reduce the time decompressing the kernel. I tested by comparing 10 runs of each option in Qemu and on hardware. The kernel is compressed with KERNEL_XZ built with GCC 8.2.0-7ubuntu1. The values are counts of the

[PATCH 1/2] powerpc/boot: Disable vector instructions

2018-10-09 Thread Joel Stanley
This will avoid auto-vectorisation when building with higher optimisation levels. We don't know if the machine can support VSX and even if it's present it's probably not going to be enabled at this point in boot. Signed-off-by: Joel Stanley --- arch/powerpc/boot/Makefile | 4 ++-- 1 file change

[PATCH 0/2] powerpc/boot: Build wrapper with optimisations

2018-10-09 Thread Joel Stanley
We currently build the wrapper with Os. This builds it with O2 instead, reducing boot time when decompressing a compressed kernel. See patch 2 for details. I've given this a spin with CONFIG_KERNEL_XZ on P9 and P8 as the petitboot kernel. Joel Stanley (2): powerpc/boot: Disable vector instructi

Re: [PATCH 15/36] dt-bindings: arm: Convert Actions Semi bindings to jsonschema

2018-10-09 Thread Joe Perches
On Sat, 2018-10-06 at 12:40 +0200, Andreas Färber wrote: > > +++ b/Documentation/devicetree/bindings/arm/actions.yaml [] > > + > > +title: Actions Semi platforms device tree bindings > > + > > +maintainers: > > + - Andreas Färber > > Mani is now officially reviewer and the closest I have to a >

Re: [PATCH 05/16] of: overlay: use prop add changeset entry for property in new nodes

2018-10-09 Thread Frank Rowand
On 10/09/18 13:28, Alan Tull wrote: > On Thu, Oct 4, 2018 at 11:14 PM wrote: >> >> From: Frank Rowand >> > > Hi Frank, > >> The changeset entry 'update property' was used for new properties in >> an overlay instead of 'add property'. >> >> The decision of whether to use 'update property' was ba

[PATCH 2/2] powerpc/boot: Fix opal console in boot wrapper

2018-10-09 Thread Joel Stanley
As of commit 10c77dba40ff ("powerpc/boot: Fix build failure in 32-bit boot wrapper") the opal code is hidden behind CONFIG_PPC64_BOOT_WRAPPER, but the boot wrapper avoids include/linux, so it does not get the normal Kconfig flags. We can drop the guard entirely as in commit f8e8e69cea49 ("powerpc/

[PATCH 1/2] powerpc/boot: Expose Kconfig symbols to wrapper

2018-10-09 Thread Joel Stanley
Currently the wrapper is built without including anything in $(src)/include/, which means there are no CONFIG_ symbols defined. This means the platform specific serial drivers were never enabled. We now copy the definitions into the boot directory, so any C file can now include autoconf.h to depen

[PATCH 0/2] powerpc/boot: Fix serial output in boot wrapper

2018-10-09 Thread Joel Stanley
While doing some work on the wrapper I noticed we no longer get serial output on a powernv system. This is because we compile out the opal code. As it turns out, none of the system-specific serial outputs will be compiled in. This series fixes that. Tested on Qemu powernv, Romulus and Palmetto. J

Re: [PATCH] memblock: stop using implicit alignement to SMP_CACHE_BYTES

2018-10-09 Thread Paul Burton
Hi Mike, On Fri, Oct 05, 2018 at 12:07:04AM +0300, Mike Rapoport wrote: > When a memblock allocation APIs are called with align = 0, the alignment is > implicitly set to SMP_CACHE_BYTES. > > Replace all such uses of memblock APIs with the 'align' parameter explicitly > set to SMP_CACHE_BYTES and

[PATCH v04 4/4] migration/memory: Support 'ibm,dynamic-memory-v2'

2018-10-09 Thread Michael Bringmann
migration/memory: This patch adds recognition for changes to the associativity of memory blocks described by 'ibm,dynamic-memory-v2'. If the associativity of an LMB has changed, it should be readded to the system in order to update local and general kernel data structures. This patch builds upon pr

[PATCH v04 3/4] migration/memory: Evaluate LMB assoc changes

2018-10-09 Thread Michael Bringmann
migration/memory: This patch adds code that recognizes changes to the associativity of memory blocks described by the device-tree properties in order to drive equivalent 'hotplug' operations to update local and general kernel data structures to reflect those changes. These differences may include:

[PATCH v04 3/5] migration/memory: Add hotplug READD_MULTIPLE

2018-10-09 Thread Michael Bringmann
migration/memory: This patch adds a new pseries hotplug action for CPU and memory operations, PSERIES_HP_ELOG_ACTION_READD_MULTIPLE. This is a variant of the READD operation which performs the action upon multiple instances of the resource at one time. The operation is to be triggered by device-tr

[PATCH v04 2/5] powerpc/drmem: Add internal_flags feature

2018-10-09 Thread Michael Bringmann
powerpc/drmem: Add internal_flags field to each LMB to allow marking of kernel software-specific operations that need not be exported to other users. For instance, if information about selected LMBs needs to be maintained for subsequent passes through the system, it can be encoded into the LMB arr

[PATCH v04 1/5] powerpc/drmem: Export 'dynamic-memory' loader

2018-10-09 Thread Michael Bringmann
powerpc/drmem: Export many of the functions of DRMEM to parse "ibm,dynamic-memory" and "ibm,dynamic-memory-v2" during hotplug operations and for Post Migration events. Also modify the DRMEM initialization code to allow it to, * Be called after system initialization * Provide a separate user copy

[PATCH v04 0/5] powerpc/migration: Affinity fix for memory

2018-10-09 Thread Michael Bringmann
The migration of LPARs across Power systems affects many attributes including that of the associativity of memory blocks. The patches in this set execute when a system is coming up fresh upon a migration target. They are intended to, * Recognize changes to the associativity of memory recorded in

Re: [PATCH 05/16] of: overlay: use prop add changeset entry for property in new nodes

2018-10-09 Thread Alan Tull
On Thu, Oct 4, 2018 at 11:14 PM wrote: > > From: Frank Rowand > Hi Frank, > The changeset entry 'update property' was used for new properties in > an overlay instead of 'add property'. > > The decision of whether to use 'update property' was based on whether > the property already exists in the

[PATCH v02] powerpc/mobility: Extend start/stop topology update scope

2018-10-09 Thread Michael Bringmann
The PPC mobility code may receive RTAS requests to perform PRRN topology changes at any time, including during LPAR migration operations. In some configurations where the affinity of CPUs or memory is being changed on that platform, the PRRN requests may apply or refer to outdated information prio

Re: [PATCH 09/16] of: overlay: validate overlay properties #address-cells and #size-cells

2018-10-09 Thread Alan Tull
On Mon, Oct 8, 2018 at 7:02 PM Frank Rowand wrote: > > On 10/08/18 11:46, Alan Tull wrote: > > On Mon, Oct 8, 2018 at 10:57 AM Alan Tull wrote: > >> > >> On Thu, Oct 4, 2018 at 11:14 PM wrote: > >>> > >>> From: Frank Rowand > >>> > >>> If overlay properties #address-cells or #size-cells are alr

Re: [PATCH 13/36] dt-bindings: arm: Convert PMU binding to json-schema

2018-10-09 Thread Rob Herring
On Tue, Oct 9, 2018 at 6:57 AM Will Deacon wrote: > > Hi Rob, > > On Fri, Oct 05, 2018 at 11:58:25AM -0500, Rob Herring wrote: > > Convert ARM PMU binding to DT schema format using json-schema. > > > > Cc: Will Deacon > > Cc: Mark Rutland > > Cc: linux-arm-ker...@lists.infradead.org > > Cc: devi

[PATCH] powerpc: remove redundant 'default n' from Kconfig-s

2018-10-09 Thread Bartlomiej Zolnierkiewicz
'default n' is the default value for any bool or tristate Kconfig setting so there is no need to write it explicitly. Also since commit f467c5640c29 ("kconfig: only write '# CONFIG_FOO is not set' for visible symbols") the Kconfig behavior is the same regardless of 'default n' being present or not

Re: [PATCH v3 03/24] drivers/block/z2ram: use ioremap_wt() instead of __ioremap(_PAGE_WRITETHRU)

2018-10-09 Thread Geert Uytterhoeven
Hi Bart, CC debian-68k, linux-m68k On Tue, Oct 9, 2018 at 5:00 PM Bart Van Assche wrote: > On Tue, 2018-10-09 at 13:51 +, Christophe Leroy wrote: > > _PAGE_WRITETHRU is a target specific flag. Prefer generic functions. > > > > Acked-by: Geert Uytterhoeven > > Signed-off-by: Christophe Leroy

Re: [PATCH v3 03/24] drivers/block/z2ram: use ioremap_wt() instead of __ioremap(_PAGE_WRITETHRU)

2018-10-09 Thread Bart Van Assche
On Tue, 2018-10-09 at 13:51 +, Christophe Leroy wrote: > _PAGE_WRITETHRU is a target specific flag. Prefer generic functions. > > Acked-by: Geert Uytterhoeven > Signed-off-by: Christophe Leroy Hi Geert, All patches that have been applied to this driver since 2005 are API refactoring patche

Re: [PATCH v2 -next] powerpc/pseries/memory-hotplug: Fix return value type of find_aa_index

2018-10-09 Thread YueHaibing
On 2018/10/9 15:00, Michael Ellerman wrote: > YueHaibing writes: >> 'aa_index' is defined as an unsigned value, but find_aa_index >> may return -1 when dlpar_clone_property fails. So we use an rc >> value to track the validation of finding the aa_index instead >> of the 'aa_index' value itself >>

[PATCH v3 -next] powerpc/pseries/memory-hotplug: Fix return value type of find_aa_index

2018-10-09 Thread YueHaibing
'aa_index' is defined as an unsigned value, but find_aa_index may return -1 when dlpar_clone_property fails. So change find_aa_index return value type to bool, which indicate 'aa_index' whether found or not. Fixes: c05a5a40969e ("powerpc/pseries: Dynamic add entires to associativity lookup array

[PATCH v3 24/24] powerpc/book3s64: Avoid multiple endian conversion in pte helpers

2018-10-09 Thread Christophe Leroy
In the same spirit as already done in pte query helpers, this patch changes pte setting helpers to perform endian conversions on the constants rather than on the pte value. In the meantime, it changes pte_access_permitted() to use pte helpers for the same reason. Signed-off-by: Christophe Leroy

[PATCH v3 23/24] powerpc/8xx: change name of a few page flags to avoid confusion

2018-10-09 Thread Christophe Leroy
_PAGE_PRIVILEGED corresponds to the SH bit which doesn't protect against user access but only disables ASID verification on kernel accesses. User access is controlled with _PMD_USER flag. Name it _PAGE_SH instead of _PAGE_PRIVILEGED _PAGE_HUGE corresponds to the SPS bit which doesn't really tells

[PATCH v3 22/24] powerpc/mm: Get rid of pte-common.h

2018-10-09 Thread Christophe Leroy
Do not include pte-common.h in nohash/32/pgtable.h As that was the last includer, get rid of pte-common.h Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h | 23 +-- arch/powerpc/include/asm/pte-common.h|

[PATCH v3 21/24] powerpc/mm: Define platform default caches related flags

2018-10-09 Thread Christophe Leroy
Cache related flags like _PAGE_COHERENT and _PAGE_WRITETHRU are defined on most platforms. The platforms not defining them don't define any alternative. So we can give them a NUL value directly for those platforms directly. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/

[PATCH v3 20/24] powerpc/mm: Allow platforms to redefine some helpers

2018-10-09 Thread Christophe Leroy
The 40xx defines _PAGE_HWWRITE while others don't. The 8xx defines _PAGE_RO instead of _PAGE_RW. The 8xx defines _PAGE_PRIVILEGED instead of _PAGE_USER. The 8xx defines _PAGE_HUGE and _PAGE_NA while others don't. Lets those platforms redefine pte_write(), pte_wrprotect() and pte_mkwrite() and get

[PATCH v3 19/24] powerpc/nohash/64: do not include pte-common.h

2018-10-09 Thread Christophe Leroy
nohash/64 only uses book3e PTE flags, so it doesn't need pte-common.h This also allows to drop PAGE_SAO and H_PAGE_4K_PFN from pte_common.h as they are only used by PPC64 Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/64/pgtable.h | 16 +++

[PATCH v3 18/24] powerpc/mm: Distribute platform specific PAGE and PMD flags and definitions

2018-10-09 Thread Christophe Leroy
The base kernel PAGE_ definition sets are more or less platform specific. Lets distribute them close to platform _PAGE_XXX flags definition, and customise them to their exact platform flags. Also defines _PAGE_PSIZE and _PTE_NONE_MASK for each platform allthough they are defined as 0. Do the

[PATCH v3 17/24] powerpc/mm: Move pte_user() into nohash/pgtable.h

2018-10-09 Thread Christophe Leroy
Now the pte-common.h is only for nohash platforms, lets move pte_user() helper out of pte-common.h to put it together with other helpers. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/pgtable.h | 10 ++ arch/powerpc/include/asm/pte-com

[PATCH v3 16/24] powerpc/book3s/32: do not include pte-common.h

2018-10-09 Thread Christophe Leroy
As done for book3s/64, add necessary flags/defines in book3s/32/pgtable.h and do not include pte-common.h It allows in the meantime to remove all related hash definitions from pte-common.h and to also remove _PAGE_EXEC default as _PAGE_EXEC is defined on all platforms except book3s/32. Reviewed-b

[PATCH v3 15/24] powerpc/mm: move __P and __S tables in the common pgtable.h

2018-10-09 Thread Christophe Leroy
__P and __S flags are the same for all platform and should remain as is in the future, so avoid duplication. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/pgtable.h | 20 arch/powerpc/include/asm/pgtable.h | 1

[PATCH v3 14/24] powerpc/mm: drop unused page flags

2018-10-09 Thread Christophe Leroy
The following page flags in pte-common.h can be dropped: _PAGE_ENDIAN is only used in mm/fsl_booke_mmu.c and is defined in asm/nohash/32/pte-fsl-booke.h _PAGE_4K_PFN is nowhere defined nor used _PAGE_READ, _PAGE_WRITE and _PAGE_PTE are only defined and used in book3s/64 The following page flags

[PATCH v3 13/24] powerpc/mm: Split dump_pagelinuxtables flag_array table

2018-10-09 Thread Christophe Leroy
To reduce the complexity of flag_array, and allow the removal of default 0 value of non existing flags, lets have one flag_array table for each platform family with only the really existing flags. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/mm/Makefile

[PATCH v3 12/24] powerpc/mm: use pte helpers in generic code

2018-10-09 Thread Christophe Leroy
Get rid of platform specific _PAGE_ in powerpc common code and use helpers instead. mm/dump_linuxpagetables.c will be handled separately Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgtable.h | 9 +++-- arch/powerpc/include/asm/n

[PATCH v3 11/24] powerpc/mm: don't use _PAGE_EXEC for calling hash_preload()

2018-10-09 Thread Christophe Leroy
The 'access' parameter of hash_preload() is either 0 or _PAGE_EXEC. Among the two versions of hash_preload(), only the PPC64 one is doing something with this 'access' parameter. In order to remove the use of _PAGE_EXEC outside platform code, 'access' parameter is replaced by 'is_exec' which will b

[PATCH v3 09/24] powerpc/mm: move some nohash pte helpers in nohash/[32:64]/pgtable.h

2018-10-09 Thread Christophe Leroy
In order to allow their use in nohash/32/pgtable.h, we have to move the following helpers in nohash/[32:64]/pgtable.h: - pte_mkwrite() - pte_mkdirty() - pte_mkyoung() - pte_wrprotect() Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h

[PATCH v3 10/24] powerpc/mm: add pte helpers to query and change pte flags

2018-10-09 Thread Christophe Leroy
In order to avoid using generic _PAGE_XXX flags in powerpc core functions, define helpers for all needed flags: - pte_mkuser() and pte_mkprivileged() to set/unset and/or unset/set _PAGE_USER and/or _PAGE_PRIVILEGED - pte_hashpte() to check if _PAGE_HASHPTE is set. - pte_ci() check if cache is inhib

[PATCH v3 08/24] powerpc/mm: don't use _PAGE_EXEC in book3s/32

2018-10-09 Thread Christophe Leroy
book3s/32 doesn't define _PAGE_EXEC, so no need to use it. All other platforms define _PAGE_EXEC so no need to check it is not NUL when not book3s/32. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgtable.h | 2 +- arch/powerpc/mm/pgtable.

[PATCH v3 07/24] powerpc: handover page flags with a pgprot_t parameter

2018-10-09 Thread Christophe Leroy
In order to avoid multiple conversions, handover directly a pgprot_t to map_kernel_page() as already done for radix. Do the same for __ioremap_caller() and __ioremap_at(). Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgtable.h | 2 +- arch/powerpc/include/asm/book3s/6

[PATCH v3 06/24] powerpc/mm: properly set PAGE_KERNEL flags in ioremap()

2018-10-09 Thread Christophe Leroy
Set PAGE_KERNEL directly in the caller and do not rely on a hack adding PAGE_KERNEL flags when _PAGE_PRESENT is not set. As already done for PPC64, use pgprot_cache() helpers instead of _PAGE_XXX flags in PPC32 ioremap() derived functions. Signed-off-by: Christophe Leroy --- arch/powerpc/includ

[PATCH v3 05/24] powerpc: don't use ioremap_prot() nor __ioremap() unless really needed.

2018-10-09 Thread Christophe Leroy
In many places, ioremap_prot() and __ioremap() can be replaced with higher level functions like ioremap(), ioremap_coherent(), ioremap_cache(), ioremap_wc() ... Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/btext.c | 2 +- arch/powerpc/kernel/crash_dump.c | 2 +-

[PATCH v3 04/24] soc/fsl/qbman: use ioremap_cache() instead of ioremap_prot(0)

2018-10-09 Thread Christophe Leroy
ioremap_prot() with flag set to 0 relies on a hack in __ioremap_caller() which adds PAGE_KERNEL flags when the handed flags don't look like a valid set of flags (ie don't include _PAGE_PRESENT) The intention being to map cached memory, use ioremap_cache() instead. Signed-off-by: Christophe Leroy

[PATCH v3 03/24] drivers/block/z2ram: use ioremap_wt() instead of __ioremap(_PAGE_WRITETHRU)

2018-10-09 Thread Christophe Leroy
_PAGE_WRITETHRU is a target specific flag. Prefer generic functions. Acked-by: Geert Uytterhoeven Signed-off-by: Christophe Leroy --- drivers/block/z2ram.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c index d0c5bc4e0703..cfb

[PATCH v3 02/24] drivers/video/fbdev: use ioremap_wc/wt() instead of __ioremap()

2018-10-09 Thread Christophe Leroy
_PAGE_NO_CACHE is a platform specific flag. In addition, this flag is misleading because one would think it requests a noncached page whereas a noncached page is _PAGE_NO_CACHE | _PAGE_GUARDED _PAGE_NO_CACHE alone means write combined noncached page, so lets use ioremap_wc() instead. _PAGE_WRITET

[PATCH v3 01/24] powerpc/32: Add ioremap_wt() and ioremap_coherent()

2018-10-09 Thread Christophe Leroy
Other arches have ioremap_wt() to map IO areas write-through. Implement it on PPC as well in order to avoid drivers using __ioremap(_PAGE_WRITETHRU) Also implement ioremap_coherent() to avoid drivers using __ioremap(_PAGE_COHERENT) Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/io

[PATCH v3 00/24] ban the use of _PAGE_XXX flags outside platform specific code

2018-10-09 Thread Christophe Leroy
Today flags like for instance _PAGE_RW or _PAGE_USER are used through common parts of code. Using those directly in common parts of code have proven to lead to mistakes or misbehaviour, because their use is not always as trivial as one could think. For instance, (flags & _PAGE_USER) == 0 isn't eno

[PATCH 07/33] powerpc/dma: untangle vio_dma_mapping_ops from dma_iommu_ops

2018-10-09 Thread Christoph Hellwig
vio_dma_mapping_ops currently does a lot of indirect calls through dma_iommu_ops, which not only make the code harder to follow but are also expensive in the post-spectre world. Unwind the indirect calls by calling the ppc_iommu_* or iommu_* APIs directly applicable, or just use the dma_iommu_* me

[PATCH 05/33] powerpc/dma: split the two __dma_alloc_coherent implementations

2018-10-09 Thread Christoph Hellwig
The implemementation for the CONFIG_NOT_COHERENT_CACHE case doesn't share any code with the one for systems with coherent caches. Split it off and merge it with the helpers in dma-noncoherent.c that have no other callers. Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt --- ar

[PATCH 02/33] powerpc/dma: remove the unused ARCH_HAS_DMA_MMAP_COHERENT define

2018-10-09 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index 8fa394520af6..f2a4a7142b1e 100644 --- a/arch/po

use generic DMA mapping code in powerpc V3

2018-10-09 Thread Christoph Hellwig
Hi all, this series switches the powerpc port to use the generic swiotlb and noncoherent dma ops, and to use more generic code for the coherent direct mapping, as well as removing a lot of dead code. The changes since v1 are to big to list and v2 was not posted in public. As this series is very

[PATCH 01/33] powerpc: use mm zones more sensibly

2018-10-09 Thread Christoph Hellwig
Powerpc has somewhat odd usage where ZONE_DMA is used for all memory on common 64-bit configfs, and ZONE_DMA32 is used for 31-bit schemes. Move to a scheme closer to what other architectures use (and I dare to say the intent of the system): - ZONE_DMA: optionally for memory < 31-bit - ZONE_NORM

[PATCH 03/33] powerpc/dma: remove the unused ISA_DMA_THRESHOLD export

2018-10-09 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/setup_32.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c index 8c507be12c3c..3cc2e449594c 100644 --- a/arch/powerpc/kernel/setup_32.c +++

[PATCH 06/33] powerpc/dma: remove the no-op dma_nommu_unmap_{page, sg} routines

2018-10-09 Thread Christoph Hellwig
These methods are optional, no need to implement no-op versions. Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/dma.c | 16 1 file changed, 16 deletions(-) diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c index d6deb

[PATCH 32/33] powerpc/dma: use generic direct and swiotlb ops

2018-10-09 Thread Christoph Hellwig
- The ppc32 case of dma_nommu_dma_supported already was a no-op, and the 64-bit case came to the same conclusion as dma_direct_supported, so replace it with the generic version. - supports CMA - Note that the cache maintainance in the existing code is a bit odd as it implements both t

[PATCH 30/33] powerpc/dma: remove set_dma_offset

2018-10-09 Thread Christoph Hellwig
There is no good reason for this helper, just opencode it. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-mapping.h| 6 -- arch/powerpc/kernel/pci-common.c | 2 +- arch/powerpc/platforms/cell/iommu.c | 4 ++-- arch/powerpc/platforms/powernv/pci-ioda.c |

[PATCH 33/33] powerpc/dma: trim the fat from

2018-10-09 Thread Christoph Hellwig
There is no need to provide anything but get_arch_dma_ops to . More the remaining declarations to and drop all the includes. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-mapping.h | 29 -- arch/powerpc/include/asm/iommu.h | 10 + arch/

[PATCH 26/33] powerpc/fsl_pci: simplify fsl_pci_dma_set_mask

2018-10-09 Thread Christoph Hellwig
swiotlb will only bounce buffer the effectice dma address for the device is smaller than the actual DMA range. Instead of flipping between the swiotlb and nommu ops for FSL SOCs that have the second outbound window just don't set the bus dma_mask in this case. Signed-off-by: Christoph Hellwig --

[PATCH 31/33] powerpc/dma: remove dma_nommu_mmap_coherent

2018-10-09 Thread Christoph Hellwig
The coherent cache version of this function already is functionally identicall to the default version, and by defining the arch_dma_coherent_to_pfn hook the same is ture for the noncoherent version as well. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-mapping.h | 4 ar

[PATCH 29/33] powerpc/dma: remove get_dma_offset

2018-10-09 Thread Christoph Hellwig
Just fold the calculation into __phys_to_dma/__dma_to_phys as those are the only places that should know about it. Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/dma-direct.h | 8 ++-- arch/powerpc/include/asm/dma-mapping.h | 16

[PATCH 27/33] dma-mapping, powerpc: simplify the arch dma_set_mask override

2018-10-09 Thread Christoph Hellwig
Instead of letting the architecture supply all of dma_set_mask just give it an additional hook selected by Kconfig. Signed-off-by: Christoph Hellwig --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/dma-mapping.h | 3 --- arch/powerpc/kernel/dma-swiotlb.c | 8 +++

[PATCH 28/33] powerpc/dma: use phys_to_dma instead of get_dma_offset

2018-10-09 Thread Christoph Hellwig
Use the standard portable helper instead of the powerpc specific one, which is about to go away. Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/dma-swiotlb.c | 2 +- arch/powerpc/kernel/dma.c | 10 +- 2 files changed, 6 insertions(+),

[PATCH 21/33] powerpc/dma: remove get_pci_dma_ops

2018-10-09 Thread Christoph Hellwig
This function is only used by the Cell iommu code, which can keep track if it is using the iommu internally just as good. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/pci.h | 2 -- arch/powerpc/kernel/pci-common.c| 6 -- arch/powerpc/platforms/cell/iommu.c | 17 ++

[PATCH 25/33] cxl: drop the dma_set_mask callback from vphb

2018-10-09 Thread Christoph Hellwig
The CXL code never even looks at the dma mask, so there is no good reason for this sanity check. Remove it because it gets in the way of the dma ops refactoring. Signed-off-by: Christoph Hellwig --- drivers/misc/cxl/vphb.c | 12 1 file changed, 12 deletions(-) diff --git a/drivers

[PATCH 24/33] powerpc/dma: fix an off-by-one in dma_capable

2018-10-09 Thread Christoph Hellwig
We need to compare the last byte in the dma range and not the one after it for the bus_dma_mask, just like we do for the regular dma_mask. Fix this cleanly by merging the two comparisms into one. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-direct.h | 8 ++-- 1 file cha

[PATCH 23/33] powerpc/dma: remove max_direct_dma_addr

2018-10-09 Thread Christoph Hellwig
The max_direct_dma_addr duplicates the bus_dma_mask field in struct device. Use the generic field instead. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/device.h | 3 --- arch/powerpc/include/asm/dma-direct.h | 4 +--- arch/powerpc/kernel/dma-swiotlb.c | 20 ---

[PATCH 22/33] powerpc/dma: move pci_dma_dev_setup_swiotlb to fsl_pci.c

2018-10-09 Thread Christoph Hellwig
pci_dma_dev_setup_swiotlb is only used by the fsl_pci code, and closely related to it, so fsl_pci.c seems like a better place for it. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/swiotlb.h | 2 -- arch/powerpc/kernel/dma-swiotlb.c | 11 --- arch/powerpc/sysdev/fsl_pci.

[PATCH 15/33] powerpc/powernv: remove pnv_pci_ioda_pe_single_vendor

2018-10-09 Thread Christoph Hellwig
This function is completely bogus - the fact that two PCIe devices come from the same vendor has absolutely nothing to say about the DMA capabilities and characteristics. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/powernv/pci-ioda.c | 28 ++- 1 file changed,

[PATCH 19/33] powerpc/pci: remove the dma_set_mask pci_controller ops methods

2018-10-09 Thread Christoph Hellwig
Unused now. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/pci-bridge.h | 2 -- arch/powerpc/kernel/dma.c | 7 --- 2 files changed, 9 deletions(-) diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index aace7033fa02..a5070

[PATCH 20/33] powerpc/dma: remove the iommu fallback for coherent allocations

2018-10-09 Thread Christoph Hellwig
All iommu capable platforms now always use the iommu code with the internal bypass, so there is not need for this magic anymore. Signed-off-by: Christoph Hellwig --- arch/powerpc/Kconfig | 4 --- arch/powerpc/kernel/dma.c | 68 ++- 2 files changed, 2 ins

[PATCH 13/33] powerpc/dart: remove dead cleanup code in iommu_init_early_dart

2018-10-09 Thread Christoph Hellwig
If dart_init failed we didn't have a chance to setup dma or controller ops yet, so there is no point in resetting them. Signed-off-by: Christoph Hellwig --- arch/powerpc/sysdev/dart_iommu.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/arch/powerpc/sysdev/dart_i

[PATCH 16/33] powerpc/powernv: remove dead npu-dma code

2018-10-09 Thread Christoph Hellwig
This code has been unused since it was merged and is in the way of cleaning up the DMA code, thus remove it. This effectively reverts commit 5d2aa710 ("powerpc/powernv: Add support for Nvlink NPUs"). Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/pci.h| 3 - arch/po

[PATCH 18/33] powerpc/dma: stop overriding dma_get_required_mask

2018-10-09 Thread Christoph Hellwig
The ppc_md and pci_controller_ops methods are unused now and can be removed. The dma_nommu implementation is generic to the generic one except for using max_pfn instead of calling into the memblock API, and all other dma_map_ops instances implement a method of their own. Signed-off-by: Christoph

[PATCH 14/33] powerpc/dart: use the generic iommu bypass code

2018-10-09 Thread Christoph Hellwig
Use the generic iommu bypass code instead of overriding set_dma_mask. Signed-off-by: Christoph Hellwig --- arch/powerpc/sysdev/dart_iommu.c | 45 +++- 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysde

[PATCH 17/33] powerpc/powernv: use the generic iommu bypass code

2018-10-09 Thread Christoph Hellwig
Use the generic iommu bypass code instead of overriding set_dma_mask. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/powernv/pci-ioda.c | 92 ++- 1 file changed, 25 insertions(+), 67 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/pow

[PATCH 10/33] powerpc/pseries: use the generic iommu bypass code

2018-10-09 Thread Christoph Hellwig
Use the generic iommu bypass code instead of overriding set_dma_mask. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/pseries/iommu.c | 100 +++-- 1 file changed, 27 insertions(+), 73 deletions(-) diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerp

[PATCH 04/33] powerpc/dma: remove the unused dma_iommu_ops export

2018-10-09 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- arch/powerpc/kernel/dma-iommu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c index f9fe2080ceb9..2ca6cfaebf65 100644 --- a/arch/powerpc/kernel/dma-iommu.c +++ b/arch/powerpc/kernel/dma-i

[PATCH 11/33] powerpc/cell: move dma direct window setup out of dma_configure

2018-10-09 Thread Christoph Hellwig
Configure the dma settings at device setup time, and stop playing games with get_pci_dma_ops. This prepares for using the common dma_configure code later on. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/cell/iommu.c | 20 +++- 1 file changed, 11 insertions(+), 9 d

[PATCH 09/33] powerpc/pseries: unwind dma_get_required_mask_pSeriesLP a bit

2018-10-09 Thread Christoph Hellwig
Call dma_get_required_mask_pSeriesLP directly instead of dma_iommu_ops to simply the code a bit. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/pseries/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/

[PATCH 08/33] powerpc/dma: handle iommu bypass in dma_iommu_ops

2018-10-09 Thread Christoph Hellwig
Add a new iommu_bypass flag to struct dev_archdata so that the dma_iommu implementation can handle the direct mapping transparently instead of switiching ops around. Setting of this flag is controlled by new pci_controller_ops method. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/as

[PATCH 12/33] powerpc/cell: use the generic iommu bypass code

2018-10-09 Thread Christoph Hellwig
This gets rid of a lot of clumsy code and finally allows us to mark dma_iommu_ops const. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-mapping.h | 2 +- arch/powerpc/include/asm/iommu.h | 6 ++ arch/powerpc/kernel/dma-iommu.c| 7 +- arch/powerpc/platforms/

Re: [PATCH] powerpc: Fix HMIs on big-endian with CONFIG_RELOCATABLE=y

2018-10-09 Thread Benjamin Herrenschmidt
On Tue, 2018-10-09 at 21:37 +1100, Michael Ellerman wrote: > Technically yes. But I thought because we build with mcmodel=medium > we'll never actually get multiple TOCs in the kernel itself, so it > doesn't actually matter. > > So this seems to work for now: Ok, fine. I forgot about DOTSYM. Will

Re: [linux-next][bisected e3fbcc7c] build error at drivers/pci/pcie/aer_inject.c:444:6: error: ‘struct pt_regs’ has no member named ‘ip

2018-10-09 Thread Bjorn Helgaas
.8.5 20150623 > > > config attached > > > > > > Recent code changes from these commits: > > > > > > c79ad38b36dd4967d67f83fc48bade37ee041a47 PCI/AER: Abstract AER interrupt > > > handling > > > 7b23285f930a8dedcbf749661cd0f2cc27f79be6 PCI/AER: Reu

  1   2   >