[PATCH RFC v4 09/21] PCI: Mark immovable BARs with PCI_FIXED

2019-03-11 Thread Sergey Miroshnichenko
If a PCIe device driver doesn't yet have support for movable BARs, mark device's BARs with IORESOURCE_PCI_FIXED. Signed-off-by: Sergey Miroshnichenko --- drivers/pci/probe.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index

[PATCH RFC v4 08/21] nvme-pci: Handle movable BARs

2019-03-11 Thread Sergey Miroshnichenko
Hotplugged devices can affect the existing ones by moving their BARs. PCI subsystem will inform the NVME driver about this by invoking reset_prepare()+reset_done(), then iounmap()+ioremap() must be called. Signed-off-by: Sergey Miroshnichenko --- drivers/nvme/host/pci.c | 29

[PATCH RFC v4 07/21] PCI: Wake up bridges during rescan when movable BARs enabled

2019-03-11 Thread Sergey Miroshnichenko
Use the PM runtime methods to wake up the bridges before accessing their config space. Signed-off-by: Sergey Miroshnichenko --- drivers/pci/probe.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 88350dd56344..dc935f82a595 100644

[PATCH RFC v4 04/21] PCI: Define PCI-specific version of the release_child_resources()

2019-03-11 Thread Sergey Miroshnichenko
Make the released resources of a bridge valid for later re-assignment: clear the STARTALIGN flag. Resources marked with PCI_FIXED must preserve their offset and size. Signed-off-by: Sergey Miroshnichenko --- drivers/pci/setup-bus.c | 47 - 1 file changed

[PATCH RFC v4 05/21] PCI: hotplug: Add a flag for the movable BARs feature

2019-03-11 Thread Sergey Miroshnichenko
for the PCIe hotplug. The PCI_MOVABLE_BARS flag is set by the platform is this feature is supported and tested, but can be overridden by the following command line option: pcie_movable_bars={ off | force } Signed-off-by: Sergey Miroshnichenko --- .../admin-guide/kernel-parameters.txt

[PATCH RFC v4 03/21] PCI: Enable bridge's I/O and MEM access for hotplugged devices

2019-03-11 Thread Sergey Miroshnichenko
After updating the bridge window resources, the PCI_COMMAND_IO and PCI_COMMAND_MEMORY bits of the bridge must be addressed as well. Signed-off-by: Sergey Miroshnichenko --- drivers/pci/pci.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index

[PATCH RFC v4 06/21] PCI: Pause the devices with movable BARs during rescan

2019-03-11 Thread Sergey Miroshnichenko
Drivers indicate their support of movable BARs by implementing the new rescan_prepare() and rescan_done() hooks in the struct pci_driver. All device's activity must be stopped during a rescan, and iounmap() +ioremap() must be applied to every used BAR. Signed-off-by: Sergey Miroshnichenko

[PATCH RFC v4 02/21] PCI: Fix race condition in pci_enable/disable_device()

2019-03-11 Thread Sergey Miroshnichenko
otects the pci_enable/disable_device() and pci_enable_bridge() with mutexes. Signed-off-by: Sergey Miroshnichenko --- drivers/pci/pci.c | 26 ++ drivers/pci/probe.c | 1 + include/linux/pci.h | 1 + 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/drivers/pci/p

[PATCH RFC v4 01/21] PCI: Fix writing invalid BARs during pci_restore_state()

2019-03-11 Thread Sergey Miroshnichenko
If BAR movement has happened (due to PCIe hotplug) after pci_save_state(), the saved addresses will become outdated. Restore them the most recently calculated values, not the ones stored in an arbitrary moment. Signed-off-by: Sergey Miroshnichenko --- drivers/pci/pci.c | 2 +- 1 file changed, 1

[PATCH v5 5/8] powerpc/pci/IOV: Add support for runtime enabling the VFs

2019-03-11 Thread Sergey Miroshnichenko
When called within pcibios_sriov_enable(), the pci_sriov_get_totalvfs(pdev) returns zero, because the device is yet preparing to enable the VFs. With this patch it becomes possible to enable VFs via sysfs "sriov_numvfs" on PowerNV. Signed-off-by: Sergey Miroshnichenko --- arch/power

[PATCH v5 7/8] powerpc/powernv/pci: Hook up the writes to PCI_SECONDARY_BUS register

2019-03-11 Thread Sergey Miroshnichenko
such change of its address. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/platforms/powernv/pci.c | 118 ++- 1 file changed, 116 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index 8cc6661781e2

[PATCH v5 6/8] powerpc/pci: Don't rely on DT is the PCI_REASSIGN_ALL_BUS is set

2019-03-11 Thread Sergey Miroshnichenko
If supported by the platform, endpoint's pci_dn can be created dynamically, without need to wait for DT updates from the firmware. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 6 -- arch/powerpc/platforms/powernv/eeh-powernv.c | 2 +- 2 files

[PATCH v5 8/8] powerpc/powernv/pci: Enable reassigning the bus numbers

2019-03-11 Thread Sergey Miroshnichenko
DT anymore. This makes possible to re-enumerate the fabric, assign the new bus numbers and switch from the pnv_php module to the standard pciehp driver for PCIe hotplug functionality. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 12 1 file changed, 12 insertions(+)

[PATCH v5 2/8] powerpc/powernv/pci: Suppress an EEH error when reading an empty slot

2019-03-11 Thread Sergey Miroshnichenko
Reading an empty slot returns all ones, which triggers a false EEH error event on PowerNV. This patch unfreezes the bus where it has happened. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/include/asm/ppc-pci.h | 1 + arch/powerpc/kernel/pci_dn.c | 2 +- arch/powerpc

[PATCH v5 4/8] powerpc/pci: Reduce code duplication in pci_add_device_node_info

2019-03-11 Thread Sergey Miroshnichenko
It is possible now to allocate and fill a new pdn with add_one_dev_pci_data Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 38 +++- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/kernel/pci_dn.c b/arch

[PATCH v5 3/8] powerpc/pci: Create pci_dn on demand

2019-03-11 Thread Sergey Miroshnichenko
If a struct pci_dn hasn't yet been created for the PCIe device (there was no DT node for it), allocate this structure and fill with info read from the device directly. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 88 ++-- 1 file changed

[PATCH v5 0/8] powerpc/powernv/pci: Make hotplug self-sufficient, independent of FW and DT

2019-03-11 Thread Sergey Miroshnichenko
abled; - Fixed build for ppc64e when CONFIG_EEH is disabled; - Fixed code style warnings. [1] https://lists.ozlabs.org/pipermail/skiboot/2019-March/013571.html [2] https://www.spinics.net/lists/linux-pci/msg79995.html [3] https://lists.ozlabs.org/pipermail/linuxppc-dev/2018-September/178053.html Ser

[PATCH v5 1/8] powerpc/pci: Access PCI config space directly w/o pci_dn

2019-03-11 Thread Sergey Miroshnichenko
To fetch an updated DT for the newly hotplugged device, OS must explicitly request it from the firmware via the pnv_php driver. If pnv_php wasn't triggered/loaded, it is still possible to discover new devices if PCIe I/O will not stop in absence of the pci_dn structure. Signed-off-by: Sergey

Re: [PATCH RFC v4 3/9] powerpc/pci: Create pci_dn on demand

2019-03-05 Thread Sergey Miroshnichenko
On 3/5/19 11:04 AM, Oliver wrote: > On Sat, Mar 2, 2019 at 3:04 AM Sergey Miroshnichenko > wrote: >> >> If a struct pci_dn hasn't yet been created for the PCIe device (there was >> no DT node for it), allocate this structure and fill with info read from >> the dev

Re: [PATCH RFC v4 2/9] powerpc/powernv/pci: Suppress an EEH error when reading an empty slot

2019-03-05 Thread Sergey Miroshnichenko
On 3/5/19 9:14 AM, Oliver wrote: > On Sat, Mar 2, 2019 at 3:04 AM Sergey Miroshnichenko > wrote: >> >> Reading an empty slot returns all ones, which triggers a false >> EEH error event on PowerNV. This patch unfreezes the bus where >> it has happened. >> >

[PATCH RFC v4 8/9] powerpc/powernv/pci: Hook up the writes to PCI_SECONDARY_BUS register

2019-03-01 Thread Sergey Miroshnichenko
such change of its address. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/platforms/powernv/pci.c | 118 ++- 1 file changed, 116 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index 73c2d0aed996

[PATCH RFC v4 9/9] powerpc/powernv/pci: Enable reassigning the bus numbers

2019-03-01 Thread Sergey Miroshnichenko
DT anymore. This makes possible to re-enumerate the fabric, assign the new bus numbers and switch from the pnv_php module to the standard pciehp driver for PCIe hotplug functionality. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 12 1 file changed, 12 insertions(+)

[PATCH RFC v4 6/9] powerpc/pci/IOV: Add support for runtime enabling the VFs

2019-03-01 Thread Sergey Miroshnichenko
When called within pcibios_sriov_enable(), the pci_sriov_get_totalvfs(pdev) returns zero, because the device is yet preparing to enable the VFs. With this patch it becomes possible to enable VFs via sysfs "sriov_numvfs" on PowerNV. Signed-off-by: Sergey Miroshnichenko --- arch/power

[PATCH RFC v4 7/9] powerpc/pci: Don't rely on DT is the PCI_REASSIGN_ALL_BUS is set

2019-03-01 Thread Sergey Miroshnichenko
If supported by the platform, endpoint's pci_dn can be created dynamically, without need to wait for DT updates from the firmware. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 6 -- arch/powerpc/platforms/powernv/eeh-powernv.c | 2 +- 2 files

[PATCH RFC v4 4/9] powerpc/pci: Reduce code duplication in pci_add_device_node_info

2019-03-01 Thread Sergey Miroshnichenko
It is possible now to allocate and fill a new pdn with add_one_dev_pci_data Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 38 +++- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/kernel/pci_dn.c b/arch

[PATCH RFC v4 5/9] powerpc/powernv/ioda: Fix using uninitialized IOMMU group

2019-03-01 Thread Sergey Miroshnichenko
Otherwise there will be a NULL pointer dereferencing in iommu_add_device() later during activating a newly created VF. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/platforms/powernv/pci-ioda.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/platforms/powernv/pci

[PATCH RFC v4 0/9] powerpc/powernv/pci: Make hotplug self-sufficient, independent of FW and DT

2019-03-01 Thread Sergey Miroshnichenko
disabled; - Fixed code style warnings. [1] https://www.spinics.net/lists/linux-pci/msg79995.html [2] https://lists.ozlabs.org/pipermail/linuxppc-dev/2018-September/178053.html Sergey Miroshnichenko (9): powerpc/pci: Access PCI config space directly w/o pci_dn powerpc/powernv/pci: Suppress an

[PATCH RFC v4 2/9] powerpc/powernv/pci: Suppress an EEH error when reading an empty slot

2019-03-01 Thread Sergey Miroshnichenko
Reading an empty slot returns all ones, which triggers a false EEH error event on PowerNV. This patch unfreezes the bus where it has happened. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/include/asm/ppc-pci.h | 1 + arch/powerpc/kernel/pci_dn.c | 2 +- arch/powerpc

[PATCH RFC v4 1/9] powerpc/pci: Access PCI config space directly w/o pci_dn

2019-03-01 Thread Sergey Miroshnichenko
To fetch an updated DT for the newly hotplugged device, OS must explicitly request it from the firmware via the pnv_php driver. If pnv_php wasn't triggered/loaded, it is still possible to discover new devices if PCIe I/O will not stop in absence of the pci_dn structure. Signed-off-by: Sergey

[PATCH RFC v4 3/9] powerpc/pci: Create pci_dn on demand

2019-03-01 Thread Sergey Miroshnichenko
If a struct pci_dn hasn't yet been created for the PCIe device (there was no DT node for it), allocate this structure and fill with info read from the device directly. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 79 1 file changed

[PATCH RFC v3 06/21] PCI: Pause the devices with movable BARs during rescan

2019-02-04 Thread Sergey Miroshnichenko
Drivers indicate their support of movable BARs by implementing the new rescan_prepare() and rescan_done() hooks in the struct pci_driver. All device's activity must be stopped during a rescan, and iounmap() +ioremap() must be applied to every used BAR. Signed-off-by: Sergey Miroshnichenko

[PATCH RFC v3 02/21] PCI: Fix race condition in pci_enable/disable_device()

2019-02-04 Thread Sergey Miroshnichenko
otects the pci_enable/disable_device() and pci_enable_bridge() with mutexes. Signed-off-by: Sergey Miroshnichenko --- drivers/pci/pci.c | 26 ++ drivers/pci/probe.c | 1 + include/linux/pci.h | 1 + 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/drivers/pci/p

[PATCH RFC v3 05/21] PCI: hotplug: Add a flag for the movable BARs feature

2019-02-04 Thread Sergey Miroshnichenko
for the PCIe hotplug. The PCI_MOVABLE_BARS flag is set by the platform is this feature is supported and tested, but can be overridden by the following command line option: pcie_movable_bars={ off | force } Signed-off-by: Sergey Miroshnichenko --- .../admin-guide/kernel-parameters.txt

[PATCH RFC v3 00/21] PCI: Allow BAR movement during hotplug

2019-02-04 Thread Sergey Miroshnichenko
s patchset is a part of our work on adding support for hotplugging bridges full of NVME and GPU devices (without special requirement such as Hot-Plug Controller, reservation of bus numbers and memory regions by firmware, etc.). Next patchset will implement the movable bus numbers. Sergey Miroshnic

[PATCH RFC v3 21/21] powerpc/pci: Fix crash with enabled movable BARs

2019-02-04 Thread Sergey Miroshnichenko
Check a resource for the UNSET flags. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/platforms/powernv/pci-ioda.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index

Re: [PATCH RFC 1/4] PCI: hotplug: Add parameter to put devices to reset during rescan

2018-09-18 Thread Sergey Miroshnichenko
On 9/18/18 1:59 AM, Bjorn Helgaas wrote: > [+cc Russell, Ben, Oliver, linuxppc-dev] > > On Mon, Sep 17, 2018 at 11:55:43PM +0300, Sergey Miroshnichenko wrote: >> Hello Sam, >> >> On 9/17/18 8:28 AM, Sam Bobroff wrote: >>> Hi Sergey, >>> >>

Re: [PATCH v2 5/5] PCI/powerpc/eeh: Add pcibios hooks for preparing to rescan

2018-09-14 Thread Sergey Miroshnichenko
On 9/12/18 1:39 PM, wrote: > On Mon, 2018-09-10 at 19:00 +0300, Sergey Miroshnichenko wrote: >> >> Yes, missing a real EEH event is possible, unfortunately, and it is >> indeed worth mentioning. >> >> To reduce this probability the next patchset I'll post in

Re: [PATCH 4/5] powerpc/powernv/pci: Enable reassigning the bus numbers

2018-09-14 Thread Sergey Miroshnichenko
Hello Ben, On 9/12/18 1:35 PM, Benjamin Herrenschmidt wrote: > On Wed, 2018-09-05 at 18:40 +0300, Sergey Miroshnichenko wrote: >> PowerNV doesn't depend on PCIe topology info from DT anymore, and now >> it is able to enumerate the fabric and assign the bus numbers. > >

Re: [PATCH v3 0/6] powerpc/powernv/pci: Discover surprise-hotplugged PCIe devices during rescan

2018-09-14 Thread Sergey Miroshnichenko
Hello Oliver, On 9/12/18 12:49 PM, Oliver wrote: > On Tue, Sep 11, 2018 at 9:56 PM, Sergey Miroshnichenko > wrote: >> This patchset allows hotplugged PCIe devices to be enumerated during a bus >> rescan being issued via sysfs on PowerNV platforms, when the "Presence >&

[PATCH v3 6/6] powerpc/pci: Reduce code duplication in pci_add_device_node_info

2018-09-11 Thread Sergey Miroshnichenko
It is possible now to allocate and fill a new pdn with add_one_dev_pci_data Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 38 +++- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/kernel/pci_dn.c b/arch

[PATCH v3 5/6] PCI/powerpc/eeh: Add pcibios hooks for preparing to rescan

2018-09-11 Thread Sergey Miroshnichenko
Reading an empty slot returns all ones, which triggers a false EEH error event on PowerNV. New callbacks pcibios_rescan_prepare/done are introduced to pause/resume the EEH during rescan. In the same time it makes possible to miss a real EEH event during rescan. Signed-off-by: Sergey

[PATCH v3 4/6] powerpc/powernv/pci: Enable reassigning the bus numbers

2018-09-11 Thread Sergey Miroshnichenko
PowerNV doesn't depend on PCIe topology info from DT anymore, and now it is able to enumerate the fabric and assign the bus numbers. This is enabled by the pci=realloc command line switch. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 12 1 file changed

[PATCH v3 2/6] powerpc/pci: Create pci_dn on demand

2018-09-11 Thread Sergey Miroshnichenko
The pci_dn structures can be created not only from DT, but also directly from newly discovered PCIe devices, so allocate them dynamically. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 63 ++-- 1 file changed, 60 insertions(+), 3

[PATCH v3 3/6] powerpc/pci: Use DT to create pci_dn for root bridges only

2018-09-11 Thread Sergey Miroshnichenko
Endpoint's pci_dn can be created dynamically. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c index e2b39b562b53..8bcf10fb13ad 100644

[PATCH v3 1/6] powerpc/pci: Access PCI config space directly w/o pci_dn

2018-09-11 Thread Sergey Miroshnichenko
The pci_dn structures are retrieved from a DT, but hot-plugged PCIe devices don't have them. Don't stop PCIe I/O in absence of pci_dn, so it is now possible to discover new devices. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/rtas_pci.c | 97

[PATCH v3 0/6] powerpc/powernv/pci: Discover surprise-hotplugged PCIe devices during rescan

2018-09-11 Thread Sergey Miroshnichenko
d; - Less code affected; - pci_add_device_node_info is refactored with add_one_dev_pci_data; - Minor code cleanup. Changes since v1: - Fixed build for ppc64le and ppc64be when CONFIG_PCI_IOV is disabled; - Fixed build for ppc64e when CONFIG_EEH is disabled; - Fixed code style warning

Re: [PATCH v2 5/5] PCI/powerpc/eeh: Add pcibios hooks for preparing to rescan

2018-09-10 Thread Sergey Miroshnichenko
Hello Sam, On 9/10/18 8:03 AM, Sam Bobroff wrote: > Hi Sergey, > > On Thu, Sep 06, 2018 at 02:57:52PM +0300, Sergey Miroshnichenko wrote: >> Reading an empty slot returns all ones, which triggers a false >> EEH error event on PowerNV. >> >> New call

Re: [PATCH v2 2/5] powerpc/pci: Create pci_dn on demand

2018-09-10 Thread Sergey Miroshnichenko
Hello Sam, On 9/10/18 7:47 AM, Sam Bobroff wrote: > Hi Sergey, > > On Thu, Sep 06, 2018 at 02:57:49PM +0300, Sergey Miroshnichenko wrote: >> The pci_dn structures can be created not only from DT, but also >> directly from newly discovered PCIe devices, so allocat

Re: [PATCH v2 1/5] powerpc/pci: Access PCI config space directly w/o pci_dn

2018-09-10 Thread Sergey Miroshnichenko
Hello Sam, On 9/10/18 7:23 AM, Sam Bobroff wrote: > Hi Sergey, > > On Thu, Sep 06, 2018 at 02:57:48PM +0300, Sergey Miroshnichenko wrote: >> The pci_dn structures are retrieved from a DT, but hot-plugged PCIe >> devices don't have them. Don't stop PCIe I/O in absence of pc

[PATCH v2 5/5] PCI/powerpc/eeh: Add pcibios hooks for preparing to rescan

2018-09-06 Thread Sergey Miroshnichenko
Reading an empty slot returns all ones, which triggers a false EEH error event on PowerNV. New callbacks pcibios_rescan_prepare/done are introduced to pause/resume the EEH during rescan. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/include/asm/eeh.h | 2 ++ arch/powerpc

[PATCH v2 4/5] powerpc/powernv/pci: Enable reassigning the bus numbers

2018-09-06 Thread Sergey Miroshnichenko
PowerNV doesn't depend on PCIe topology info from DT anymore, and now it is able to enumerate the fabric and assign the bus numbers. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/platforms/powernv/pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/powernv

[PATCH v2 3/5] powerpc/pci: Use DT to create pci_dn for root bridges only

2018-09-06 Thread Sergey Miroshnichenko
Endpoint's pci_dn can be created dynamically. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c index 48ec16407835..3b4368f07c82 100644

[PATCH v2 2/5] powerpc/pci: Create pci_dn on demand

2018-09-06 Thread Sergey Miroshnichenko
The pci_dn structures can be created not only from DT, but also directly from newly discovered PCIe devices, so allocate them dynamically. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 76 1 file changed, 59 insertions(+), 17

[PATCH v2 1/5] powerpc/pci: Access PCI config space directly w/o pci_dn

2018-09-06 Thread Sergey Miroshnichenko
The pci_dn structures are retrieved from a DT, but hot-plugged PCIe devices don't have them. Don't stop PCIe I/O in absence of pci_dn, so it is now possible to discover new devices. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/rtas_pci.c | 97

[PATCH v2 0/5] powerpc/powernv/pci: Discover surprise-hotplugged PCIe devices during rescan

2018-09-06 Thread Sergey Miroshnichenko
Fixed code style warnings. Sergey Miroshnichenko (5): powerpc/pci: Access PCI config space directly w/o pci_dn powerpc/pci: Create pci_dn on demand powerpc/pci: Use DT to create pci_dn for root bridges only powerpc/powernv/pci: Enable reassigning the bus numbers PCI/powerpc/eeh: Add pci

[PATCH 5/5] PCI/powerpc/eeh: Add pcibios hooks for preparing to rescan

2018-09-05 Thread Sergey Miroshnichenko
Reading an empty slot returns all ones, which triggers a false EEH error event on PowerNV. New callbacks pcibios_rescan_prepare/done are introduced to pause/resume the EEH during rescan. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/include/asm/eeh.h | 2 ++ arch/powerpc

[PATCH 0/5] powerpc/pci/hotplug: Discover surprise-hotplugged PCIe devices during rescan

2018-09-05 Thread Sergey Miroshnichenko
CIe rescan on PowerNV III The PCI subsystem is not prepared to runtime changes of BAR addresses IV Device drivers don't track changes of their BAR addresses V Move BARs of working devices to make space for new ones VI Add support for PCIe bridge hotplug Sergey Miroshnichenko (5): powerpc/pci:

[PATCH 4/5] powerpc/powernv/pci: Enable reassigning the bus numbers

2018-09-05 Thread Sergey Miroshnichenko
PowerNV doesn't depend on PCIe topology info from DT anymore, and now it is able to enumerate the fabric and assign the bus numbers. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/platforms/powernv/pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/powernv

[PATCH 3/5] powerpc/pci: Use DT to create pci_dn for root bridges only

2018-09-05 Thread Sergey Miroshnichenko
Endpoint's pci_dn can be created dynamically. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c index 5ce752874827..1b9f563d9461 100644

[PATCH 2/5] powerpc/pci: Create pci_dn on demand

2018-09-05 Thread Sergey Miroshnichenko
The pci_dn structures can be created not only from DT, but also directly from newly discovered PCIe devices, so allocate them dynamically. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 69 +++- 1 file changed, 52 insertions(+), 17

[PATCH 1/5] powerpc/pci: Access PCI config space directly w/o pci_dn

2018-09-05 Thread Sergey Miroshnichenko
The pci_dn structures are retrieved from a DT, but hot-plugged PCIe devices don't have them. Don't stop PCIe I/O in absence of pci_dn, so it is now possible to discover new devices. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/rtas_pci.c | 89

<    1   2