Re: [PATCH] powerpc/powernv/pci: Work around races in PCI bridge enabling

2018-08-17 Thread kbuild test robot
Hi Benjamin, I love your patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on v4.18 next-20180817] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits

[PATCH v2] powerpc/powernv/pci: Work around races in PCI bridge enabling

2018-08-17 Thread Benjamin Herrenschmidt
The generic code is race when multiple children of a PCI bridge try to enable it simultaneously. This leads to drivers trying to access a device through a not-yet-enabled bridge, and this EEH errors under various circumstances when using parallel driver probing. There is work going on to fix that

[PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread David Hildenbrand
From: Vitaly Kuznetsov Well require to call add_memory()/add_memory_resource() with device_hotplug_lock held, to avoid a lock inversion. Allow external modules (e.g. hv_balloon) that make use of add_memory()/add_memory_resource() to lock device hotplug. Signed-off-by: Vitaly Kuznetsov [modify p

[PATCH RFC 0/2] mm: online/offline_pages called w.o. mem_hotplug_lock

2018-08-17 Thread David Hildenbrand
Reading through the code and studying how mem_hotplug_lock is to be used, I noticed that there are two places where we can end up calling device_online()/device_offline() - online_pages()/offline_pages() without the mem_hotplug_lock. And there are other places where we call device_online()/device_o

[PATCH RFC 2/2] mm/memory_hotplug: fix online/offline_pages called w.o. mem_hotplug_lock

2018-08-17 Thread David Hildenbrand
There seem to be some problems as result of 30467e0b3be ("mm, hotplug: fix concurrent memory hot-add deadlock"), which tried to fix a possible lock inversion reported and discussed in [1] due to the two locks a) device_lock() b) mem_hotplug_lock While add_memory() first takes b), f

Re: [PATCH RFC 2/2] mm/memory_hotplug: fix online/offline_pages called w.o. mem_hotplug_lock

2018-08-17 Thread Rafael J. Wysocki
On Fri, Aug 17, 2018 at 9:59 AM David Hildenbrand wrote: > > There seem to be some problems as result of 30467e0b3be ("mm, hotplug: > fix concurrent memory hot-add deadlock"), which tried to fix a possible > lock inversion reported and discussed in [1] due to the two locks > a) device_lock

Re: [PATCH RFC 2/2] mm/memory_hotplug: fix online/offline_pages called w.o. mem_hotplug_lock

2018-08-17 Thread David Hildenbrand
On 17.08.2018 10:20, Rafael J. Wysocki wrote: > On Fri, Aug 17, 2018 at 9:59 AM David Hildenbrand wrote: >> >> There seem to be some problems as result of 30467e0b3be ("mm, hotplug: >> fix concurrent memory hot-add deadlock"), which tried to fix a possible >> lock inversion reported and discussed

Re: [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread Greg Kroah-Hartman
On Fri, Aug 17, 2018 at 09:59:00AM +0200, David Hildenbrand wrote: > From: Vitaly Kuznetsov > > Well require to call add_memory()/add_memory_resource() with > device_hotplug_lock held, to avoid a lock inversion. Allow external modules > (e.g. hv_balloon) that make use of add_memory()/add_memory_r

Re: [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread David Hildenbrand
On 17.08.2018 10:41, Greg Kroah-Hartman wrote: > On Fri, Aug 17, 2018 at 09:59:00AM +0200, David Hildenbrand wrote: >> From: Vitaly Kuznetsov >> >> Well require to call add_memory()/add_memory_resource() with >> device_hotplug_lock held, to avoid a lock inversion. Allow external modules >> (e.g. h

Re: [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread Rafael J. Wysocki
On Fri, Aug 17, 2018 at 10:41 AM Greg Kroah-Hartman wrote: > > On Fri, Aug 17, 2018 at 09:59:00AM +0200, David Hildenbrand wrote: > > From: Vitaly Kuznetsov > > > > Well require to call add_memory()/add_memory_resource() with > > device_hotplug_lock held, to avoid a lock inversion. Allow external

Re: [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread Rafael J. Wysocki
On Fri, Aug 17, 2018 at 10:56 AM David Hildenbrand wrote: > > On 17.08.2018 10:41, Greg Kroah-Hartman wrote: > > On Fri, Aug 17, 2018 at 09:59:00AM +0200, David Hildenbrand wrote: > >> From: Vitaly Kuznetsov > >> > >> Well require to call add_memory()/add_memory_resource() with > >> device_hotplu

[PATCH] poewrpc/mce: Fix SLB rebolting during MCE recovery path.

2018-08-17 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar With the powrpc next commit e7e81847478 (poewrpc/mce: Fix SLB rebolting during MCE recovery path.), the SLB error recovery is broken. The commit missed a crucial change of OR-ing index value to RB[52-63] which selects the SLB entry while rebolting. This patch fixes that.

Re: [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread David Hildenbrand
On 17.08.2018 11:03, Rafael J. Wysocki wrote: > On Fri, Aug 17, 2018 at 10:56 AM David Hildenbrand wrote: >> >> On 17.08.2018 10:41, Greg Kroah-Hartman wrote: >>> On Fri, Aug 17, 2018 at 09:59:00AM +0200, David Hildenbrand wrote: From: Vitaly Kuznetsov Well require to call add_memo

Re: [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread Greg Kroah-Hartman
On Fri, Aug 17, 2018 at 11:41:24AM +0200, David Hildenbrand wrote: > On 17.08.2018 11:03, Rafael J. Wysocki wrote: > > On Fri, Aug 17, 2018 at 10:56 AM David Hildenbrand wrote: > >> > >> On 17.08.2018 10:41, Greg Kroah-Hartman wrote: > >>> On Fri, Aug 17, 2018 at 09:59:00AM +0200, David Hildenbran

Re: [PATCH] powerpc64/ftrace: Include ftrace.h needed for enable/disable calls

2018-08-17 Thread Naveen N. Rao
Luke Dashjr wrote: this_cpu_disable_ftrace and this_cpu_enable_ftrace are inlines in ftrace.h Without it included, the build fails. I'm unable to reproduce this. Can you share your .config and the build environment? Fixes: a4bc64d305af ("powerpc64/ftrace: Disable ftrace during kvm entry/ex

[RFC 02/15] PCI: move pci_scan_bus into callers

2018-08-17 Thread Arnd Bergmann
There are only two remaining callers of the old pci_scan_bus() interface. Since we want to expose the pci_host_bridge structure everywhere and discourage users from calling the old interfaces, let's move the implementation into the respective callsites. While this duplicates the source code, it ma

[RFC 08/15] x86: PCI: clean up pcibios_scan_root()

2018-08-17 Thread Arnd Bergmann
pcibios_scan_root() is now just a wrapper around pci_scan_root_bus(), and merging the two into one makes it shorter and more readable. We can also take advantage of pci_alloc_host_bridge() doing the allocation of the sysdata for us, which helps if we ever want to allow hot-unplugging the host brid

[RFC 07/15] PCI/ACPI: clean up acpi_pci_root_create()

2018-08-17 Thread Arnd Bergmann
The acpi_pci_create_root_bus() can be fully integrated into acpi_pci_root_create(), improving a few things: * We can call pci_scan_root_bus_bridge(), which registers and scans the bridge in one step. * After a failure in pci_register_host_bridge(), we correctly clean up the resources. * The br

[RFC 11/15] PCI: hyperv: convert to pci_scan_root_bus_bridge

2018-08-17 Thread Arnd Bergmann
create_root_hv_pci_bus() uses a rather generic method of probing the host bridge, which can be simplified by just calling pci_scan_root_bus_bridge() after setting up the pci_host_bridge structure. Since we can no longer assign hbus->pci_bus in the middle, I just remove that member completely and u

[RFC 14/15] PCI: make pcibios_root_bridge_prepare a callback

2018-08-17 Thread Arnd Bergmann
pcibios_root_bridge_prepare() is always used as a per host bridge function, not per architecture. Making it a callback in the pci_host_bridge instead lets the host bridge implementation easily override it, and avoids the checks in the architecture for which host bridge implementation is being used

[RFC 03/15] PCI: move pci_scan_root_bus into callers

2018-08-17 Thread Arnd Bergmann
There are only six remaining callers of the old pci_scan_root_bus() interface. Since we want to expose the pci_host_bridge structure everywhere and discourage users from calling the old interfaces, let's move the implementation into the respective callsites. While this duplicates the source code,

[RFC 10/15] sparc/PCI: simplify pci_scan_one_pbm

2018-08-17 Thread Arnd Bergmann
We no longer need a separate pci_create_root_bus() function, and merging it into pci_scan_one_pbm() makes the implementation easier to understand. A possible future cleanup would move the allocation of the pci_host_bridge structure into the callers of pci_scan_one_pbm, and avoid duplication betwee

[RFC 00/15] PCI: turn some __weak functions into callbacks

2018-08-17 Thread Arnd Bergmann
Hi Bjorn and others, Triggered by Christoph's patches, I had another go at converting all of the remaining pci host bridge implementations to be based on pci_alloc_host_bridge and a separate registration function. This is made possible through work from Lorenzo and others to convert many of the e

[RFC 04/15] PCI: export pci_register_host_bridge

2018-08-17 Thread Arnd Bergmann
There are a couple of users of the old pci_create_root_bus() interface, which calls pci_register_host_bridge() without actually scanning the bus. In order to get those callers a little closer to the current method of separating the allocation and probing of the host bridge, this exports the intern

[RFC 01/15] PCI: clean up legacy host bridge scan functions

2018-08-17 Thread Arnd Bergmann
Aside from the modern pci_host_bridge based interfaces, we have a couple of interfaces from old times that are still used in a couple of platforms: pci_create_root_bus(), pci_scan_bus() and pci_scan_root_bus(). As a first step towards getting everybody to use the new interfaces, this simplifies th

[RFC 05/15] PCI: move pci_create_root_bus into callers

2018-08-17 Thread Arnd Bergmann
There are only seven remaining callers of the old pci_scan_root_bus() interface. Since we want to expose the pci_host_bridge structure everywhere and discourage users from calling the old interfaces, let's move the implementation into the respective callsites. While this duplicates the source code

[RFC 09/15] PCI: xenfront: clean up pcifront_scan_root()

2018-08-17 Thread Arnd Bergmann
Merging pci_scan_root_bus() into pcifront_scan_root() simplifies the implementation and makes it more readable. We can allocate the pcifront_sd structure along with the bridge structure, which helps manage its lifetime rules so we don't free it before the device has been released. There are two sm

[RFC 15/15] PCI: make pcibios_add_bus/remove_bus callbacks

2018-08-17 Thread Arnd Bergmann
These are mostly not architecture specific but are meant for particular PCI host bridge implementations, in particular for the ACPI version. Turn them both into callback functions that are implemented by the APCI PCI implementation as well as the one architecture that overrides pcibios_remove_bus.

[RFC 12/15] PCI: make pcibios_bus_add_device() a callback function

2018-08-17 Thread Arnd Bergmann
Weak functions are confusion, and we can now add callback pointers to pci host bridges for any controller, so let's make this one a callback rather than a __weak global function. Signed-off-by: Arnd Bergmann --- arch/powerpc/kernel/pci-common.c | 7 +-- arch/sh/drivers/pci/pci.c | 1

[RFC 06/15] powerpc/pci: fold pci_create_root_bus into pcibios_scan_phb

2018-08-17 Thread Arnd Bergmann
This slightly simplifies the pcibios_scan_phb() implementation, and gives us an easier point to add further fields in the pci_host_bridge structure. I tried removing fields that are duplicated between pci_host_bridge and pci_controller (which really serve the same purpose), but ran into the proble

[RFC 13/15] PCI: turn pcibios_alloc_irq into a callback

2018-08-17 Thread Arnd Bergmann
Weak functions are a bit confusing, and we can better deal with this using a callback function. pcibios_free_irq() is actually completely unused, but it seems better to treat it the same way as the allocation, unless we want to remove it completely. Signed-off-by: Arnd Bergmann --- arch/arm64/ke

Re: [PATCH v2 3/4] powerpc/mm: fix a warning when a cache is common to PGD and hugepages

2018-08-17 Thread Christophe LEROY
Le 17/08/2018 à 05:32, Aneesh Kumar K.V a écrit : On 08/14/2018 08:24 PM, Christophe Leroy wrote: While implementing TLB miss HW assistance on the 8xx, the following warning was encountered: [  423.732965] WARNING: CPU: 0 PID: 345 at mm/slub.c:2412 ___slab_alloc.constprop.30+0x26c/0x46c [ 

Re: [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread David Hildenbrand
On 17.08.2018 12:06, Greg Kroah-Hartman wrote: > On Fri, Aug 17, 2018 at 11:41:24AM +0200, David Hildenbrand wrote: >> On 17.08.2018 11:03, Rafael J. Wysocki wrote: >>> On Fri, Aug 17, 2018 at 10:56 AM David Hildenbrand wrote: On 17.08.2018 10:41, Greg Kroah-Hartman wrote: > On Fri,

Re: [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread Heiko Carstens
On Fri, Aug 17, 2018 at 01:04:58PM +0200, David Hildenbrand wrote: > >> If there are no objections, I'll go into that direction. But I'll wait > >> for more comments regarding the general concept first. > > > > It is the middle of the merge window, and maintainers are really busy > > right now. I

Re: [PATCH v7 4/9] powerpc/pseries: Define MCE error event section.

2018-08-17 Thread Mahesh Jagannath Salgaonkar
On 08/16/2018 09:44 AM, Michael Ellerman wrote: > Mahesh Jagannath Salgaonkar writes: >> On 08/08/2018 08:12 PM, Michael Ellerman wrote: > ... >>> + union { + struct { + uint8_t ue_err_type; + /* + * X

Re: [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread David Hildenbrand
On 17.08.2018 13:28, Heiko Carstens wrote: > On Fri, Aug 17, 2018 at 01:04:58PM +0200, David Hildenbrand wrote: If there are no objections, I'll go into that direction. But I'll wait for more comments regarding the general concept first. >>> >>> It is the middle of the merge window, and m

Re: [PATCH v2 1/4] powerpc/tm: Remove msr_tm_active()

2018-08-17 Thread Breno Leitao
Hi Michael, On 08/16/2018 09:49 PM, Michael Ellerman wrote: > Michael Neuling writes: > >> On Mon, 2018-06-18 at 19:59 -0300, Breno Leitao wrote: >>> Currently msr_tm_active() is a wrapper around MSR_TM_ACTIVE() if >>> CONFIG_PPC_TRANSACTIONAL_MEM is set, or it is just a function that >>> return

Re: [PATCH 1/2] powerpc/process: fix nested output in show_user_instructions()

2018-08-17 Thread Murilo Opsfelder Araujo
Hi, Christophe. On Tue, Aug 14, 2018 at 08:59:18AM +, Christophe Leroy wrote: > When two processes crash at the same time, we sometimes encounter > nesting in the middle of a line: > > [4.365317] init[1]: segfault (11) at 0 nip 0 lr 0 code 1 > [4.370452] init[1]: code: XX

Re: [PATCH 2/2] powerpc/process: Constify the number of insns printed by show instructions functions.

2018-08-17 Thread Murilo Opsfelder Araujo
Hi, Christophe. On Tue, Aug 14, 2018 at 08:59:20AM +, Christophe Leroy wrote: > instructions_to_print var is assigned value 16 and there is no > way to change it. > > This patch replaces it by a constant. > > Signed-off-by: Christophe Leroy Reviewed-by: Murilo Opsfelder Araujo > --- > a

Re: [PATCH] powerpc/traps: Avoid rate limit messages from show unhandled signals

2018-08-17 Thread Murilo Opsfelder Araujo
Hi, Michael. On Fri, Aug 17, 2018 at 04:55:00PM +1000, Michael Ellerman wrote: > In the recent commit to add an explicit ratelimit state when showing > unhandled signals, commit 35a52a10c3ac ("powerpc/traps: Use an > explicit ratelimit state for show_signal_msg()"), I put the check of > show_unhan

[PATCH 1/3] dmaengine: fsldma: move spin_lock_bh to spin_lock in tasklet

2018-08-17 Thread Barry Song
as you are already in a tasklet, it is unnecessary to call spin_lock_bh. Signed-off-by: Barry Song <21cn...@gmail.com> --- drivers/dma/fsldma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index 1117b51..9d360a3 100644 --- a/d

[PATCH v5] powerpc/topology: Get topology for shared processors at boot

2018-08-17 Thread Srikar Dronamraju
On a shared lpar, Phyp will not update the cpu associativity at boot time. Just after the boot system does recognize itself as a shared lpar and trigger a request for correct cpu associativity. But by then the scheduler would have already created/destroyed its sched domains. This causes - Broken l

[PATCH v5] powerpc/topology: Get topology for shared processors at boot

2018-08-17 Thread Srikar Dronamraju
On a shared lpar, Phyp will not update the cpu associativity at boot time. Just after the boot system does recognize itself as a shared lpar and trigger a request for correct cpu associativity. But by then the scheduler would have already created/destroyed its sched domains. This causes - Broken l

Re: [PATCH 3/3] powerpc/mm/ Add proper pte access check helper

2018-08-17 Thread Christophe LEROY
Le 04/12/2017 à 03:19, Aneesh Kumar K.V a écrit : pte_access_premitted get called in get_user_pages_fast path. If we have marked the pte PROT_NONE, we should not allow a read access on the address. With the current implementation we are not checking the READ and only check for WRITE. This is n

Re: [PATCH] powerpc64/ftrace: Include ftrace.h needed for enable/disable calls

2018-08-17 Thread Naveen N. Rao
Luke Dashjr wrote: On Friday 17 August 2018 10:25:40 Naveen N. Rao wrote: Luke Dashjr wrote: > this_cpu_disable_ftrace and this_cpu_enable_ftrace are inlines in > ftrace.h Without it included, the build fails. I'm unable to reproduce this. Can you share your .config and the build environment?

Re: [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread Greg Kroah-Hartman
On Fri, Aug 17, 2018 at 01:56:35PM +0200, David Hildenbrand wrote: > E.g. When adding the memory block devices, we know that there won't be a > driver to attach to (as there are no drivers for the "memory" subsystem) > - the bus_probe_device() function that takes the device_lock() could > pretty mu

Re: [PATCH] powerpc64/ftrace: Include ftrace.h needed for enable/disable calls

2018-08-17 Thread Luke Dashjr
On Friday 17 August 2018 10:25:40 Naveen N. Rao wrote: > Luke Dashjr wrote: > > this_cpu_disable_ftrace and this_cpu_enable_ftrace are inlines in > > ftrace.h Without it included, the build fails. > > I'm unable to reproduce this. Can you share your .config and the build > environment? https://luk

[PATCH] powerpc/fadump: cleanup crash memory ranges support

2018-08-17 Thread Hari Bathini
Commit 1bd6a1c4b80a ("powerpc/fadump: handle crash memory ranges array index overflow") changed crash memory ranges to a dynamic array that is reallocated on-demand with krealloc(). The relevant header for this call was not included. The kernel compiles though. But be cautious and add the header an