Re: [PATCH v4 0/3] Append new variables to vmcoreinfo (TCR_EL1.T1SZ for arm64 and MAX_PHYSMEM_BITS for all archs)

2019-11-18 Thread Prabhakar Kushwaha
Hi Akashi, On Fri, Nov 15, 2019 at 7:29 AM AKASHI Takahiro wrote: > > Bhupesh, > > On Fri, Nov 15, 2019 at 01:24:17AM +0530, Bhupesh Sharma wrote: > > Hi Akashi, > > > > On Wed, Nov 13, 2019 at 12:11 PM AKASHI Takahiro > > wrote: > > > > > > Hi Bhupesh, > > > > > > Do you have a corresponding

[PATCH 4/5] powerpc/powernv: Remove set but not used variable 'pdn'

2019-11-18 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: arch/powerpc/platforms/powernv/pci-ioda.c: In function pnv_ioda_release_vf_PE: arch/powerpc/platforms/powernv/pci-ioda.c:1468:25: warning: variable pdn set but not used [-Wunused-but-set-variable] It is introduced by commit 781a868f3136

[PATCH 2/5] powerpc/perf: Remove set but not used variable 'target'

2019-11-18 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: arch/powerpc/perf/imc-pmu.c: In function trace_imc_event_init: arch/powerpc/perf/imc-pmu.c:1292:22: warning: variable target set but not used [-Wunused-but-set-variable] It is introduced by commit 012ae244845f ("powerpc/perf: Trace imc PMU

[PATCH 5/5] powerpc/powernv: Remove set but not used variable 'parent'

2019-11-18 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: arch/powerpc/platforms/powernv/pci-ioda.c: In function pnv_ioda_configure_pe: arch/powerpc/platforms/powernv/pci-ioda.c:867:18: warning: variable parent set but not used [-Wunused-but-set-variable] It is not used since commit b131a8425c34

[PATCH 1/5] powerpc/fadump: Remove set but not used variable 'elf'

2019-11-18 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: arch/powerpc/kernel/fadump.c: In function fadump_update_elfcore_header: arch/powerpc/kernel/fadump.c:790:17: warning: variable elf set but not used [-Wunused-but-set-variable] It is introduced by commit ebaeb5ae2437 ("fadump: Convert

[PATCH 0/5] powerpc: Remove five unused variables

2019-11-18 Thread zhengbin
zhengbin (5): powerpc/fadump: Remove set but not used variable 'elf' powerpc/perf: Remove set but not used variable 'target' powerpc/powernv: Remove set but not used variable 'total_vfs' powerpc/powernv: Remove set but not used variable 'pdn' powerpc/powernv: Remove set but not used

[PATCH 3/5] powerpc/powernv: Remove set but not used variable 'total_vfs'

2019-11-18 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: arch/powerpc/platforms/powernv/pci-ioda.c: In function pnv_pci_vf_assign_m64: arch/powerpc/platforms/powernv/pci-ioda.c:1346:25: warning: variable total_vfs set but not used [-Wunused-but-set-variable] It is introduced by commit 02639b0e1326

[PATCH] KVM: PPC: Remove set but not used variable 'ra','rs','rt'

2019-11-18 Thread zhengbin
Fixes gcc '-Wunused-but-set-variable' warning: arch/powerpc/kvm/emulate_loadstore.c: In function kvmppc_emulate_loadstore: arch/powerpc/kvm/emulate_loadstore.c:87:6: warning: variable ra set but not used [-Wunused-but-set-variable] arch/powerpc/kvm/emulate_loadstore.c: In function

Re: [PATCH v4 0/3] Append new variables to vmcoreinfo (TCR_EL1.T1SZ for arm64 and MAX_PHYSMEM_BITS for all archs)

2019-11-18 Thread AKASHI Takahiro
Hi Prabhakar, On Tue, Nov 19, 2019 at 12:02:46PM +0530, Prabhakar Kushwaha wrote: > Hi Akashi, > > On Fri, Nov 15, 2019 at 7:29 AM AKASHI Takahiro > wrote: > > > > Bhupesh, > > > > On Fri, Nov 15, 2019 at 01:24:17AM +0530, Bhupesh Sharma wrote: > > > Hi Akashi, > > > > > > On Wed, Nov 13, 2019

Re: [PATCH 04/11] powerpc/powernv/ioda: Release opencapi device

2019-11-18 Thread Andrew Donnellan
On 10/9/19 1:45 am, Frederic Barrat wrote: With hotplug, an opencapi device can now go away. It needs to be released, mostly to clean up its PE state. We were previously not defining any device callback. We can reuse the standard PCI release callback, it does a bit too much for an opencapi

Re: [PATCH v5 02/24] mm/gup: factor out duplicate code from four routines

2019-11-18 Thread John Hubbard
On 11/18/19 1:46 AM, Jan Kara wrote: > On Thu 14-11-19 21:53:18, John Hubbard wrote: >> There are four locations in gup.c that have a fair amount of code >> duplication. This means that changing one requires making the same >> changes in four places, not to mention reading the same code four >>

Re: [PATCH v3 15/15] powerpc/32s: Activate CONFIG_VMAP_STACK

2019-11-18 Thread Michael Ellerman
Christophe Leroy writes: > A few changes to retrieve DAR and DSISR from struct regs > instead of retrieving them directly, as they may have > changed due to a TLB miss. > > Also modifies hash_page() and friends to work with virtual > data addresses instead of physical ones. > > Signed-off-by:

Re: [PATCH v3 15/15] powerpc/32s: Activate CONFIG_VMAP_STACK

2019-11-18 Thread Michael Ellerman
Michael Ellerman writes: > Christophe Leroy writes: >> A few changes to retrieve DAR and DSISR from struct regs >> instead of retrieving them directly, as they may have >> changed due to a TLB miss. >> >> Also modifies hash_page() and friends to work with virtual >> data addresses instead of

Re: [PATCH 02/11] powerpc/powernv/ioda: Protect PE list

2019-11-18 Thread Andrew Donnellan
On 10/9/19 1:45 am, Frederic Barrat wrote: Protect the PHB's list of PE. Probably not needed as long as it was populated during PHB creation, but it feels right and will become required once we can add/remove opencapi devices on hotplug. Signed-off-by: Frederic Barrat Reviewed-by: Andrew

Re: [PATCH] powerpc/pseries: remove variable 'status' set but not used

2019-11-18 Thread Michael Ellerman
Chen Wandun writes: > Fixes gcc '-Wunused-but-set-variable' warning: > > arch/powerpc/platforms/pseries/ras.c: In function ras_epow_interrupt: > arch/powerpc/platforms/pseries/ras.c:319:6: warning: variable status set but > not used [-Wunused-but-set-variable] Thanks for the patch. But it

[PATCH 4.14 145/239] libfdt: Ensure INT_MAX is defined in libfdt_env.h

2019-11-18 Thread Greg Kroah-Hartman
From: Rob Herring [ Upstream commit 53dd9dce6979bc54d64a3a09a2fb20187a025be7 ] The next update of libfdt has a new dependency on INT_MAX. Update the instances of libfdt_env.h in the kernel to either include the necessary header with the definition or define it locally. Cc: Russell King Cc:

[PATCH 4.19 270/422] libfdt: Ensure INT_MAX is defined in libfdt_env.h

2019-11-18 Thread Greg Kroah-Hartman
From: Rob Herring [ Upstream commit 53dd9dce6979bc54d64a3a09a2fb20187a025be7 ] The next update of libfdt has a new dependency on INT_MAX. Update the instances of libfdt_env.h in the kernel to either include the necessary header with the definition or define it locally. Cc: Russell King Cc:

Re: [-merge] BUG followed by oops running ndctl tests

2019-11-18 Thread Sachin Sant
> On 16-Nov-2019, at 12:25 AM, Aneesh Kumar K.V > wrote: > > On 11/15/19 11:36 AM, Sachin Sant wrote: >> Following Oops is seen on latest (commit 3b4852888d) powerpc merge branch >> code while running ndctl (test_namespace) tests >> 85c5b0984e was good. > > > > Are the namespace size

Re: [PATCH 08/11] pci/hotplug/pnv-php: Register opencapi slots

2019-11-18 Thread Andrew Donnellan
On 10/9/19 1:45 am, Frederic Barrat wrote: Add the opencapi PHBs to the list of PHBs being scanned to look for slots. Signed-off-by: Frederic Barrat --- drivers/pci/hotplug/pnv_php.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci/hotplug/pnv_php.c

Re: [PATCH v5 10/24] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-18 Thread John Hubbard
On 11/18/19 2:16 AM, Jan Kara wrote: > On Thu 14-11-19 21:53:26, John Hubbard wrote: >> /* >> - * NOTE on FOLL_LONGTERM: >> + * FOLL_PIN and FOLL_LONGTERM may be used in various combinations with each >> + * other. Here is what they mean, and how to use them: >> * >> * FOLL_LONGTERM indicates

Re: [PATCH 06/11] pci/hotplug/pnv-php: Remove erroneous warning

2019-11-18 Thread Andrew Donnellan
On 10/9/19 1:45 am, Frederic Barrat wrote: On powernv, when removing a device through hotplug, the following warning is logged: Invalid refcount <.> on <...> It may be incorrect, the refcount may be set to a higher value than 1 and be valid. of_detach_node() can drop more than one

[PATCH v5 3/3] powerpc/prom_init: Use -ffreestanding to avoid a reference to bcmp

2019-11-18 Thread Nathan Chancellor
* Rebase on v5.4-rc3. * Add Nick's reviewed-by tag. * Update the LLVM commit reference to the latest applied version (r374662) as it was originally committed as r370454, reverted in r370788, and reapplied as r374662. v4 -> v5: * Rebase on next-20191118 to avoid a conflict with co

[PATCH v5 2/3] powerpc: Avoid clang warnings around setjmp and longjmp

2019-11-18 Thread Nathan Chancellor
nding instead of outright disabling the warning because it is legitimate. v3 -> v4: * Rebase on v5.4-rc3 * Add Nick's reviewed-by and Compiler Explorer link. v4 -> v5: * Rebase on next-20191118 arch/powerpc/kernel/Makefile | 4 ++-- arch/powerpc/xmon/Makefile | 4 ++-- 2 files changed,

[PATCH v5 1/3] powerpc: Don't add -mabi= flags when building with Clang

2019-11-18 Thread Nathan Chancellor
ed-by: Daniel Axtens Signed-off-by: Nathan Chancellor --- v1 -> v2: * Improve commit message v2 -> v3: * Rebase and merge into a single series. v3 -> v4: * Rebase on v5.4-rc3. * Update links to point to llvmorg-9.0.0 instead of llvmorg-9.0.0-rc2. v4 -> v5: * Rebase on next-2019

[PATCH v5 0/3] LLVM/Clang fixes for a few defconfigs

2019-11-18 Thread Nathan Chancellor
Hi all, This series includes a set of fixes for LLVM/Clang when building a few defconfigs (powernv, ppc44x, and pseries are the ones that our CI configuration tests [1]). The first patch fixes pseries_defconfig, which has never worked in mainline. The second and third patches fixes issues with

Re: [PATCH 08/10] nvdimm: Add driver for OpenCAPI Storage Class Memory

2019-11-18 Thread Dan Williams
On Mon, Nov 18, 2019 at 7:29 PM Andrew Donnellan wrote: > > On 19/11/19 1:48 pm, Alastair D'Silva wrote: > > On Tue, 2019-11-19 at 10:47 +1100, Andrew Donnellan wrote: > >> On 15/11/19 3:35 am, Dan Williams wrote: > Have you discussed with the directory owner if it's ok to split > the >

Re: [PATCH 08/10] nvdimm: Add driver for OpenCAPI Storage Class Memory

2019-11-18 Thread Andrew Donnellan
On 19/11/19 1:48 pm, Alastair D'Silva wrote: On Tue, 2019-11-19 at 10:47 +1100, Andrew Donnellan wrote: On 15/11/19 3:35 am, Dan Williams wrote: Have you discussed with the directory owner if it's ok to split the driver over several files? My thought is to establish drivers/opencapi/ and

Re: [PATCH 08/10] nvdimm: Add driver for OpenCAPI Storage Class Memory

2019-11-18 Thread Alastair D'Silva
On Tue, 2019-11-19 at 10:47 +1100, Andrew Donnellan wrote: > On 15/11/19 3:35 am, Dan Williams wrote: > > > Have you discussed with the directory owner if it's ok to split > > > the > > > driver over several files? > > > > My thought is to establish drivers/opencapi/ and move this and the > >

Re: [PATCH 07/11] pci/hotplug/pnv-php: Improve error msg on power state change failure

2019-11-18 Thread Andrew Donnellan
On 10/9/19 1:45 am, Frederic Barrat wrote: When changing the slot state, if opal hits an error and tells as such in the asynchronous reply, the warning "Wrong msg" is logged, which is rather confusing. Instead we can reuse the better message which is already used when we couldn't submit the

[Bug 205327] kmemleak reports various leaks in "swapper/0"

2019-11-18 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205327 --- Comment #6 from Michael Ellerman (mich...@ellerman.id.au) --- I replied with directions on what to do. -- You are receiving this mail because: You are watching the assignee of the bug.

Re: [PATCH 05/11] powerpc/powernv/ioda: Find opencapi slot for a device node

2019-11-18 Thread Andrew Donnellan
On 10/9/19 1:45 am, Frederic Barrat wrote: diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index 6104418c9ad5..00a79f3c989f 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c @@ -48,13 +48,14 @@ int

Re: [PATCH] of: unittest: fix memory leak in attach_node_and_children

2019-11-18 Thread Michael Ellerman
Erhard Furtner writes: > In attach_node_and_children memory is allocated for full_name via > kasprintf. If the condition of the 1st if is not met the function > returns early without freeing the memory. Add a kfree() to fix that. It would be good to mention that this was detected with kmemleak.

Re: [PATCH 03/12] powerpc: Replace cpu_up/down with device_online/offline

2019-11-18 Thread Michael Ellerman
Qais Yousef writes: > The core device API performs extra housekeeping bits that are missing > from directly calling cpu_up/down. > > See commit a6717c01ddc2 ("powerpc/rtas: use device model APIs and > serialization during LPM") for an example description of what might go > wrong. > > This also

Re: [PATCH v5 17/24] mm/gup: track FOLL_PIN pages

2019-11-18 Thread John Hubbard
On 11/18/19 3:58 AM, Jan Kara wrote: > On Thu 14-11-19 21:53:33, John Hubbard wrote: >> Add tracking of pages that were pinned via FOLL_PIN. >> >> As mentioned in the FOLL_PIN documentation, callers who effectively set >> FOLL_PIN are required to ultimately free such pages via put_user_page(). >>

Re: [PATCH 08/10] nvdimm: Add driver for OpenCAPI Storage Class Memory

2019-11-18 Thread Dan Williams
On Mon, Nov 18, 2019 at 3:48 PM Andrew Donnellan wrote: > > On 15/11/19 3:35 am, Dan Williams wrote: > >> Have you discussed with the directory owner if it's ok to split the > >> driver over several files? > > > > My thought is to establish drivers/opencapi/ and move this and the > > existing

Re: [PATCH 08/10] nvdimm: Add driver for OpenCAPI Storage Class Memory

2019-11-18 Thread Andrew Donnellan
On 15/11/19 3:35 am, Dan Williams wrote: Have you discussed with the directory owner if it's ok to split the driver over several files? My thought is to establish drivers/opencapi/ and move this and the existing drivers/misc/ocxl/ bits there. Is there any other justification for this we can

Re: [PATCH 08/10] nvdimm: Add driver for OpenCAPI Storage Class Memory

2019-11-18 Thread Alastair D'Silva
On Thu, 2019-11-14 at 14:41 +0100, Frederic Barrat wrote: > Hi Alastair, > > The patch is huge and could/should probably be split in smaller > pieces > to ease the review. However, having sinned on that same topic in the > past, I made a first pass anyway. I haven't covered everything but >

Re: [PATCH 00/12] Convert cpu_up/down to device_online/offline

2019-11-18 Thread Thomas Gleixner
On Mon, 18 Nov 2019, Qais Yousef wrote: > I had to make an educated guess that you're probably the 'maintainer' of cpu > hotplug - but there's no explicit entry that says that. Please let me know if > I need to bring the attention of others too. :) > The series do have few rough edges to

[Bug 205327] kmemleak reports various leaks in "swapper/0"

2019-11-18 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205327 --- Comment #5 from Erhard F. (erhar...@mailbox.org) --- (In reply to Michael Ellerman from comment #3) > Do you want to send a patch? I already sent the patch to linuxppc-dev@lists.ozlabs.org (https://patchwork.ozlabs.org/patch/1195212/) but

Re: [PATCH 01/11] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2019-11-18 Thread Frederic Barrat
Le 18/11/2019 à 03:36, Alistair Popple a écrit : On Monday, 18 November 2019 12:24:24 PM AEDT Oliver O'Halloran wrote: On Mon, Nov 18, 2019 at 12:06 PM Alistair Popple wrote: On Wednesday, 13 November 2019 4:38:21 AM AEDT Frederic Barrat wrote: However, one question is whether this

Re: powerpc ftrace broken due to "manual merge of the ftrace tree with the arm64 tree"

2019-11-18 Thread Qian Cai
On Mon, 2019-11-18 at 10:16 -0500, Steven Rostedt wrote: > On Mon, 18 Nov 2019 09:58:42 -0500 > Steven Rostedt wrote: > > > On Mon, 18 Nov 2019 09:51:04 -0500 > > Steven Rostedt wrote: > > > > > > > Test this commit please: b83b43ffc6e4b514ca034a0fbdee01322e2f7022 > > > > > > > > > > >

Re: [PATCH 00/12] Convert cpu_up/down to device_online/offline

2019-11-18 Thread Qais Yousef
Hi Thomas On 10/30/19 15:38, Qais Yousef wrote: > Using cpu_up/down directly to bring cpus online/offline loses synchronization > with sysfs and could suffer from a race similar to what is described in > commit a6717c01ddc2 ("powerpc/rtas: use device model APIs and serialization > during LPM"). >

Re: powerpc ftrace broken due to "manual merge of the ftrace tree with the arm64 tree"

2019-11-18 Thread Steven Rostedt
On Mon, 18 Nov 2019 09:58:42 -0500 Steven Rostedt wrote: > On Mon, 18 Nov 2019 09:51:04 -0500 > Steven Rostedt wrote: > > > > > Test this commit please: b83b43ffc6e4b514ca034a0fbdee01322e2f7022 > > > > > > # git reset --hard b83b43ffc6e4b514ca034a0fbdee01322e2f7022 > > > > > > Yes,

Re: powerpc ftrace broken due to "manual merge of the ftrace tree with the arm64 tree"

2019-11-18 Thread Steven Rostedt
On Mon, 18 Nov 2019 09:51:04 -0500 Steven Rostedt wrote: > > > Test this commit please: b83b43ffc6e4b514ca034a0fbdee01322e2f7022 > > > > # git reset --hard b83b43ffc6e4b514ca034a0fbdee01322e2f7022 > > > > Yes, that one is bad. > > Can you see if this patch fixes the issue for you?

Re: powerpc ftrace broken due to "manual merge of the ftrace tree with the arm64 tree"

2019-11-18 Thread Steven Rostedt
On Fri, 15 Nov 2019 16:06:34 -0500 Qian Cai wrote: > > Test this commit please: b83b43ffc6e4b514ca034a0fbdee01322e2f7022 > > # git reset --hard b83b43ffc6e4b514ca034a0fbdee01322e2f7022 > > Yes, that one is bad. Can you see if this patch fixes the issue for you? Thanks! -- Steve diff

Re: [PATCH v5 11/24] goldish_pipe: convert to pin_user_pages() and put_user_page()

2019-11-18 Thread Jan Kara
On Thu 14-11-19 21:53:27, John Hubbard wrote: > 1. Call the new global pin_user_pages_fast(), from pin_goldfish_pages(). > > 2. As required by pin_user_pages(), release these pages via > put_user_page(). In this case, do so via put_user_pages_dirty_lock(). > > That has the side effect of calling

Re: [PATCH v5 15/24] fs/io_uring: set FOLL_PIN via pin_user_pages()

2019-11-18 Thread Jan Kara
On Thu 14-11-19 21:53:31, John Hubbard wrote: > Convert fs/io_uring to use the new pin_user_pages() call, which sets > FOLL_PIN. Setting FOLL_PIN is now required for code that requires > tracking of pinned pages, and therefore for any code that calls > put_user_page(). > > In partial anticipation

Re: [PATCH v5 06/24] goldish_pipe: rename local pin_user_pages() routine

2019-11-18 Thread Jan Kara
On Thu 14-11-19 21:53:22, John Hubbard wrote: > 1. Avoid naming conflicts: rename local static function from > "pin_user_pages()" to "pin_goldfish_pages()". > > An upcoming patch will introduce a global pin_user_pages() > function. > > Reviewed-by: Jérôme Glisse > Reviewed-by: Ira Weiny >

Re: [PATCH v5 13/24] mm/process_vm_access: set FOLL_PIN via pin_user_pages_remote()

2019-11-18 Thread Jan Kara
On Thu 14-11-19 21:53:29, John Hubbard wrote: > Convert process_vm_access to use the new pin_user_pages_remote() > call, which sets FOLL_PIN. Setting FOLL_PIN is now required for > code that requires tracking of pinned pages. > > Also, release the pages via put_user_page*(). > > Also, rename

Re: [PATCH v5 10/24] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-18 Thread Jan Kara
On Thu 14-11-19 21:53:26, John Hubbard wrote: > /* > - * NOTE on FOLL_LONGTERM: > + * FOLL_PIN and FOLL_LONGTERM may be used in various combinations with each > + * other. Here is what they mean, and how to use them: > * > * FOLL_LONGTERM indicates that the page will be held for an indefinite

Re: [PATCH v5 07/24] IB/umem: use get_user_pages_fast() to pin DMA pages

2019-11-18 Thread Jan Kara
On Thu 14-11-19 21:53:23, John Hubbard wrote: > And get rid of the mmap_sem calls, as part of that. Note > that get_user_pages_fast() will, if necessary, fall back to > __gup_longterm_unlocked(), which takes the mmap_sem as needed. > > Reviewed-by: Jason Gunthorpe > Reviewed-by: Ira Weiny >

Re: [PATCH v5 02/24] mm/gup: factor out duplicate code from four routines

2019-11-18 Thread Jan Kara
On Thu 14-11-19 21:53:18, John Hubbard wrote: > There are four locations in gup.c that have a fair amount of code > duplication. This means that changing one requires making the same > changes in four places, not to mention reading the same code four > times, and wondering if there are subtle

Re: [PATCH v5 17/24] mm/gup: track FOLL_PIN pages

2019-11-18 Thread Jan Kara
On Thu 14-11-19 21:53:33, John Hubbard wrote: > Add tracking of pages that were pinned via FOLL_PIN. > > As mentioned in the FOLL_PIN documentation, callers who effectively set > FOLL_PIN are required to ultimately free such pages via put_user_page(). > The effect is similar to FOLL_GET, and may

Re: HPT allocation failures on POWER8 KVM hosts

2019-11-18 Thread Roman Bolshakov
On Mon, Nov 18, 2019 at 01:02:00PM +1100, Daniel Axtens wrote: > Hi Roman, > > > We're running a lot of KVM virtual machines on POWER8 hosts and > > sometimes new VMs can't be started because there are no contiguous > > regions for HPT because of CMA region fragmentation. > > > > The issue is

[PATCH v5 48/48] soc: fsl: qe: remove PPC32 dependency from CONFIG_QUICC_ENGINE

2019-11-18 Thread Rasmus Villemoes
There are also PPC64, ARM and ARM64 based SOCs with a QUICC Engine, and the core QE code as well as net/wan/fsl_ucc_hdlc and tty/serial/ucc_uart has now been modified to not rely on ppcisms. So extend the architectures that can select QUICC_ENGINE, and add the rather modest requirements of OF &&

[PATCH v5 47/48] net: ethernet: freescale: make UCC_GETH explicitly depend on PPC32

2019-11-18 Thread Rasmus Villemoes
Currently, QUICC_ENGINE depends on PPC32, so this in itself does not change anything. In order to allow removing the PPC32 dependency from QUICC_ENGINE and avoid allmodconfig build failures, add this explicit dependency. Also, the QE Ethernet has never been integrated on any non-PowerPC SoC and

[PATCH v5 46/48] net/wan/fsl_ucc_hdlc: reject muram offsets above 64K

2019-11-18 Thread Rasmus Villemoes
Qiang Zhao points out that these offsets get written to 16-bit registers, and there are some QE platforms with more than 64K muram. So it is possible that qe_muram_alloc() gives us an allocation that can't actually be used by the hardware, so detect and reject that. Reported-by: Qiang Zhao

[PATCH v5 45/48] net/wan/fsl_ucc_hdlc: fix reading of __be16 registers

2019-11-18 Thread Rasmus Villemoes
When releasing the allocated muram resource, we rely on reading back the offsets from the riptr/tiptr registers. But those registers are __be16 (and we indeed write them using iowrite16be), so we can't just read them back with a normal C dereference. This is not currently a real problem, since

[PATCH v5 44/48] net/wan/fsl_ucc_hdlc: avoid use of IS_ERR_VALUE()

2019-11-18 Thread Rasmus Villemoes
When building this on a 64-bit platform gcc rightly warns that the error checking is broken (-ENOMEM stored in an u32 does not compare greater than (unsigned long)-MAX_ERRNO). Instead, now that qe_muram_alloc() returns s32, use that type to store the return value and use standard kernel style "ret

[PATCH v5 43/48] soc: fsl: qe: avoid IS_ERR_VALUE in ucc_fast.c

2019-11-18 Thread Rasmus Villemoes
When building this on a 64-bit platform gcc rightly warns that the error checking is broken (-ENOMEM stored in an u32 does not compare greater than (unsigned long)-MAX_ERRNO). Instead, change the ucc_fast_[tr]x_virtual_fifo_base_offset members to s32 and use an ordinary check-for-negative. Also,

[PATCH v5 42/48] soc: fsl: qe: drop pointless check in qe_sdma_init()

2019-11-18 Thread Rasmus Villemoes
The sdma member of struct qe_immap is not at offset zero, so even if qe_immr wasn't initialized yet (i.e. NULL), _immr->sdma would not be NULL. Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/soc/fsl/qe/qe.c

[PATCH v5 40/48] soc: fsl: qe: avoid IS_ERR_VALUE in ucc_slow.c

2019-11-18 Thread Rasmus Villemoes
When trying to build this for a 64-bit platform, one gets warnings from using IS_ERR_VALUE on something which is not sizeof(long). Instead, change the various *_offset fields to store a signed integer, and simply check for a negative return from qe_muram_alloc(). Since qe_muram_free() now accepts

[PATCH v5 38/48] soc: fsl: qe: drop broken lazy call of cpm_muram_init()

2019-11-18 Thread Rasmus Villemoes
cpm_muram_alloc_common() tries to support a kind of lazy initialization - if the muram_pool has not been created yet, it calls cpm_muram_init(). Now, cpm_muram_alloc_common() is always called under spin_lock_irqsave(_muram_lock, flags); and cpm_muram_init() does gen_pool_create() (which

[PATCH v5 41/48] soc: fsl: qe: drop use of IS_ERR_VALUE in qe_sdma_init()

2019-11-18 Thread Rasmus Villemoes
Now that qe_muram_alloc() returns s32, adapt qe_sdma_init() and avoid another few IS_ERR_VALUE() uses. Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c index

[PATCH v5 39/48] soc: fsl: qe: refactor cpm_muram_alloc_common to prevent BUG on error path

2019-11-18 Thread Rasmus Villemoes
If the kmalloc() fails, we try to undo the gen_pool allocation we've just done. Unfortunately, start has already been modified to subtract the GENPOOL_OFFSET bias, so we're freeing something that very likely doesn't exist in the gen_pool, meaning we hit the kernel BUG at lib/genalloc.c:399!

[PATCH v5 37/48] soc: fsl: qe: make cpm_muram_free() ignore a negative offset

2019-11-18 Thread Rasmus Villemoes
This allows one to simplify callers since they can store a negative value as a sentinel to indicate "this was never allocated" (or store the -ENOMEM from an allocation failure) and then call cpm_muram_free() unconditionally. Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_common.c | 3

[PATCH v5 36/48] soc: fsl: qe: make cpm_muram_free() return void

2019-11-18 Thread Rasmus Villemoes
Nobody uses the return value from cpm_muram_free, and functions that free resources usually return void. One could imagine a use for a "how much have I allocated" a la ksize(), but knowing how much one had access to after the fact is useless. Signed-off-by: Rasmus Villemoes ---

[PATCH v5 35/48] soc: fsl: qe: change return type of cpm_muram_alloc() to s32

2019-11-18 Thread Rasmus Villemoes
There are a number of problems with cpm_muram_alloc() and its callers. Most callers assign the return value to some variable and then use IS_ERR_VALUE to check for allocation failure. However, when that variable is not sizeof(long), this leads to warnings - and it is indeed broken to do e.g.

[PATCH v5 34/48] serial: ucc_uart: access __be32 field using be32_to_cpu

2019-11-18 Thread Rasmus Villemoes
The buf member of struct qe_bd is a __be32, so to make this work on little-endian hosts, use be32_to_cpu when reading it. Signed-off-by: Rasmus Villemoes --- drivers/tty/serial/ucc_uart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/ucc_uart.c

[PATCH v5 33/48] serial: ucc_uart: limit brg-frequency workaround to PPC32

2019-11-18 Thread Rasmus Villemoes
According to Timur Tabi This bug in older U-Boots is definitely PowerPC-specific So before allowing this driver to be built for platforms other than PPC32, make sure that we don't accept malformed device trees on those other platforms. Suggested-by: Timur Tabi Signed-off-by: Rasmus

[PATCH v5 32/48] serial: ucc_uart: use of_property_read_u32() in ucc_uart_probe()

2019-11-18 Thread Rasmus Villemoes
For this to work correctly on little-endian hosts, don't access the device-tree properties directly in native endianness, but use the of_property_read_u32() helper. Signed-off-by: Rasmus Villemoes --- drivers/tty/serial/ucc_uart.c | 36 +++ 1 file changed, 15

[PATCH v5 30/48] serial: ucc_uart: factor out soft_uart initialization

2019-11-18 Thread Rasmus Villemoes
The "soft uart" mechanism is a workaround for a silicon bug which (as far as I know) only affects some PPC-based SOCs. The code that determines which microcode blob to request relies on some powerpc-specific bits (e.g. the mfspr(SPRN_SVR) and hence also the asm/reg.h header). This makes it a

[PATCH v5 31/48] serial: ucc_uart: stub out soft_uart_init for !CONFIG_PPC32

2019-11-18 Thread Rasmus Villemoes
The Soft UART hack is only needed for some PPC-based SOCs. To allow building this driver for non-PPC, guard soft_uart_init() and its helpers by CONFIG_PPC32, and use a no-op soft_uart_init() otherwise. Signed-off-by: Rasmus Villemoes --- drivers/tty/serial/ucc_uart.c | 17 - 1

[PATCH v5 29/48] serial: ucc_uart: replace ppc-specific IO accessors

2019-11-18 Thread Rasmus Villemoes
Some ARM-based SOCs (e.g. LS1021A) also have a QUICC engine. As preparation for allowing this driver to build on ARM, replace the ppc-specific in_be16() etc. by the qe_io* helpers. Done via coccinelle. Signed-off-by: Rasmus Villemoes --- drivers/tty/serial/ucc_uart.c | 210

[PATCH v5 28/48] serial: ucc_uart: explicitly include soc/fsl/cpm.h

2019-11-18 Thread Rasmus Villemoes
This driver uses #defines from soc/fsl/cpm.h, so instead of relying on some other header pulling that in, do that explicitly. This is preparation for allowing this driver to build on ARM. Signed-off-by: Rasmus Villemoes --- drivers/tty/serial/ucc_uart.c | 1 + 1 file changed, 1 insertion(+)

[PATCH v5 26/48] soc: fsl: move cpm.h from powerpc/include/asm to include/soc/fsl

2019-11-18 Thread Rasmus Villemoes
Some drivers, e.g. ucc_uart, need definitions from cpm.h. In order to allow building those drivers for non-ppc based SOCs, move the header to include/soc/fsl. For now, leave a trivial wrapper at the old location so drivers can be updated one by one. Signed-off-by: Rasmus Villemoes ---

[PATCH v5 27/48] soc/fsl/qe/qe.h: update include path for cpm.h

2019-11-18 Thread Rasmus Villemoes
asm/cpm.h under arch/powerpc is now just a wrapper for including soc/fsl/cpm.h. In order to make the qe.h header usable on other architectures, use the latter path directly. Signed-off-by: Rasmus Villemoes --- include/soc/fsl/qe/qe.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v5 25/48] soc: fsl: qe: qe_io.c: use of_property_read_u32() in par_io_init()

2019-11-18 Thread Rasmus Villemoes
This is necessary for this to work on little-endian hosts. Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_io.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_io.c b/drivers/soc/fsl/qe/qe_io.c index 61dd8eb8c0fe..11ea08e97db7 100644

[PATCH v5 22/48] soc: fsl: qe: qe.c: use of_property_read_* helpers

2019-11-18 Thread Rasmus Villemoes
Instead of manually doing of_get_property/of_find_property and reading the value by assigning to a u32* or u64* and dereferencing, use the of_property_read_* functions. This make the code more readable, and more importantly, is required for this to work correctly on little-endian platforms.

[PATCH v5 24/48] soc: fsl: qe: qe_io.c: access device tree property using be32_to_cpu

2019-11-18 Thread Rasmus Villemoes
We need to apply be32_to_cpu to make this work correctly on little-endian hosts. Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_io.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_io.c b/drivers/soc/fsl/qe/qe_io.c index

[PATCH v5 23/48] soc: fsl: qe: qe_io.c: don't open-code of_parse_phandle()

2019-11-18 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_io.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_io.c b/drivers/soc/fsl/qe/qe_io.c index f6b10f38b2f4..99aeb01586bd 100644 --- a/drivers/soc/fsl/qe/qe_io.c +++

[PATCH v5 21/48] soc: fsl: qe: merge qe_ic.h headers into qe_ic.c

2019-11-18 Thread Rasmus Villemoes
The public qe_ic.h header is no longer included by anything but qe_ic.c. Merge both headers into qe_ic.c, and drop the unused constants. Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_ic.c | 52 +++- drivers/soc/fsl/qe/qe_ic.h | 99

Re: [PATCH v4 2/2] powerpc/kexec: move kexec files into a dedicated subdir.

2019-11-18 Thread Michael Ellerman
Christophe Leroy writes: > arch/powerpc/kernel/ contains 8 files dedicated to kexec. > > Move them into a dedicated subdirectory. > > Signed-off-by: Christophe Leroy > > --- > v2: moved crash.c as well as it's part of kexec suite. > v3: renamed files to remove 'kexec' keyword from names. > v4:

[PATCH v5 20/48] soc: fsl: qe: simplify qe_ic_init()

2019-11-18 Thread Rasmus Villemoes
qe_ic_init() takes a flags parameter, but all callers (including the sole remaining one) have always passed 0. So remove that parameter and simplify the body accordingly. We still explicitly initialize the Interrupt Configuration Register (CICR) to its reset value of all-zeroes, just in case the

[PATCH v5 19/48] soc: fsl: qe: make qe_ic_get_{low,high}_irq static

2019-11-18 Thread Rasmus Villemoes
These are only called from within qe_ic.c, so make them static. Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_ic.c | 4 ++-- include/soc/fsl/qe/qe_ic.h | 10 -- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_ic.c

[PATCH v5 17/48] soc: fsl: qe: remove unused qe_ic_set_* functions

2019-11-18 Thread Rasmus Villemoes
There are no current callers of these functions, and they use the ppc-specific virq_to_hw(). So removing them gets us one step closer to building QE support for ARM. If the functionality is ever actually needed, the code can be dug out of git and then adapted to work on all architectures, but for

[PATCH v5 18/48] soc: fsl: qe: don't use NO_IRQ in qe_ic.c

2019-11-18 Thread Rasmus Villemoes
This driver is currently PPC-only, and on powerpc, NO_IRQ is 0, so this doesn't change functionality. However, not every architecture defines NO_IRQ, and some define it as -1, so the detection of a failed irq_of_parse_and_map() (which returns 0 on failure) would be wrong on those. So to prepare

[PATCH v5 16/48] soc: fsl: qe: rename qe_ic_cascade_low_mpic -> qe_ic_cascade_low

2019-11-18 Thread Rasmus Villemoes
The qe_ic_cascade_{low,high}_mpic functions are now used as handlers both when the interrupt parent is mpic as well as ipic, so remove the _mpic suffix. Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_ic.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH v5 15/48] soc: fsl: qe: move qe_ic_cascade_* functions to qe_ic.c

2019-11-18 Thread Rasmus Villemoes
These functions are only ever called through a function pointer, and therefore it makes no sense for them to be "static inline" - gcc has no choice but to emit a copy in each translation unit that takes the address of one of these. Since they are now only referenced from qe_ic.c, just make them

[PATCH v5 14/48] powerpc/85xx: remove mostly pointless mpc85xx_qe_init()

2019-11-18 Thread Rasmus Villemoes
Since commit 302c059f2e7b (QE: use subsys_initcall to init qe), mpc85xx_qe_init() has done nothing apart from possibly emitting a pr_err(). As part of reducing the amount of QE-related code in arch/powerpc/ (and eventually support QE on other architectures), remove this low-hanging fruit.

[PATCH v5 13/48] powerpc/83xx: remove mpc83xx_ipic_and_qe_init_IRQ

2019-11-18 Thread Rasmus Villemoes
This is now exactly the same as mpc83xx_ipic_init_IRQ, so just use that directly. Signed-off-by: Rasmus Villemoes --- arch/powerpc/platforms/83xx/km83xx.c | 2 +- arch/powerpc/platforms/83xx/misc.c| 7 --- arch/powerpc/platforms/83xx/mpc832x_mds.c | 2 +-

[PATCH v5 12/48] soc: fsl: qe: move calls of qe_ic_init out of arch/powerpc/

2019-11-18 Thread Rasmus Villemoes
Having to call qe_ic_init() from platform-specific code makes it awkward to allow building the QE drivers for ARM. It's also a needless duplication of code, and slightly error-prone: Instead of the caller needing to know the details of whether the QUICC Engine High and QUICC Engine Low are

[PATCH v5 11/48] soc: fsl: qe: use qe_ic_cascade_{low, high}_mpic also on 83xx

2019-11-18 Thread Rasmus Villemoes
The *_ipic and *_mpic handlers are almost identical - the only difference is that the latter end with an unconditional chip->irq_eoi() call. Since IPIC does not have ->irq_eoi, we can reduce some code duplication by calling irq_eoi conditionally. This is similar to what is already done in

[PATCH v5 10/48] soc: fsl: qe: remove pointless sysfs registration in qe_ic.c

2019-11-18 Thread Rasmus Villemoes
There's no point in registering with sysfs when that doesn't actually allow any interaction with the device or driver (no uevents, no sysfs files that provide information or allow configuration, no nothing). Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_ic.c | 31

[PATCH v5 09/48] soc: fsl: qe: drop assign-only high_active in qe_ic_init

2019-11-18 Thread Rasmus Villemoes
high_active is only assigned to but never used. Remove it. Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_ic.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_ic.c b/drivers/soc/fsl/qe/qe_ic.c index 8c874372416b..4b03060d8079 100644 ---

[PATCH v5 08/48] soc: fsl: qe: drop unneeded #includes

2019-11-18 Thread Rasmus Villemoes
These includes are not actually needed, and asm/rheap.h and sysdev/fsl_soc.h are PPC-specific, hence prevent compiling QE for other architectures. Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c| 5 - drivers/soc/fsl/qe/qe_io.c | 2 -- 2 files changed, 7 deletions(-) diff

[PATCH v5 07/48] soc: fsl: qe: qe.c: guard use of pvr_version_is() with CONFIG_PPC32

2019-11-18 Thread Rasmus Villemoes
Commit e5c5c8d23fef (soc/fsl/qe: only apply QE_General4 workaround on affected SoCs) introduced use of pvr_version_is(), saying The QE_General4 workaround is only valid for the MPC832x and MPC836x SoCs. The other SoCs that embed a QUICC engine are not affected by this hardware bug and

[PATCH v5 06/48] soc: fsl: qe: replace spin_event_timeout by readx_poll_timeout_atomic

2019-11-18 Thread Rasmus Villemoes
In preparation for allowing QE to be built for architectures other than ppc, use the generic readx_poll_timeout_atomic() helper from iopoll.h rather than the ppc-only spin_event_timeout(). Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c | 13 +++-- 1 file changed, 7

[PATCH v5 02/48] soc: fsl: qe: drop volatile qualifier of struct qe_ic::regs

2019-11-18 Thread Rasmus Villemoes
The actual io accessors (e.g. in_be32) implicitly add a volatile qualifier to their address argument. Remove volatile from the struct definition and the qe_ic_(read/write) helpers, in preparation for switching from the ppc-specific io accessors to generic ones. Signed-off-by: Rasmus Villemoes

[PATCH v5 03/48] soc: fsl: qe: rename qe_(clr/set/clrset)bit* helpers

2019-11-18 Thread Rasmus Villemoes
Make it clear that these operate on big-endian registers (i.e. use the iowrite*be primitives) before we introduce more uses of them and allow the QE drivers to be built for platforms other than ppc32. Signed-off-by: Rasmus Villemoes --- drivers/net/wan/fsl_ucc_hdlc.c | 4 ++--

  1   2   >