was unplugged, the gap in bus numbers must be compacted.
Let's densify the bus numbering at the beginning of a next PCI rescan.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/probe.c | 27 +++
1 file changed, 27 insertions(+)
diff --git a/drivers/pci/probe.c b
entries and symlinks before renaming the
bus, then created them back.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/probe.c | 105 +++-
1 file changed, 104 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index
Following patches will resolve the introduced issues:
- fix desynchronization in /sys/devices/pci*, /sys/bus/pci/devices/* and
/proc/bus/pci/* after changes in PCI topology;
- compact gaps in numbering, which may appear after removing a bridge, to
maintain the number continuity.
Signed-off-by: Sergey
php module to the standard pciehp driver for PCI
hotplug functionality.
Signed-off-by: Sergey Miroshnichenko
---
arch/powerpc/kernel/pci_dn.c | 5 +
arch/powerpc/platforms/powernv/eeh-powernv.c | 3 ++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kerne
will be
contracted to the actual value.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/probe.c | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 539f5d39bb6d..3494b5d265d5 100644
--- a/drivers/pci/probe.c
+++ b
.
Signed-off-by: Sergey Miroshnichenko
---
drivers/base/bus.c | 36
include/linux/device.h | 1 +
2 files changed, 37 insertions(+)
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 8f3445cc533e..52d77fb90218 100644
--- a/drivers/base/bus.c
Currently the last possible bus number of the PHB is set to the last
used bus number during the boot. So when hotplugging a bridge later,
no new buses can be allocated because they are limited by this value.
Let the host bridge contain any number of buses up to 255.
Signed-off-by: Sergey
the working affected devices.
Signed-off-by: Sergey Miroshnichenko
---
drivers/base/core.c| 6 --
include/linux/device.h | 2 ++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 7bd9cd366d41..23e689fc8478 100644
--- a/drivers
be
reattached and their sysfs and proc files recreated.
Signed-off-by: Sergey Miroshnichenko
---
drivers/base/base.h| 1 -
drivers/base/bus.c | 1 +
include/linux/device.h | 2 ++
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/base/base.h b/drivers/base/base.h
index
-by: Sergey Miroshnichenko
---
drivers/pci/proc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
index 5495537c60c2..c85654dd315b 100644
--- a/drivers/pci/proc.c
+++ b/drivers/pci/proc.c
@@ -443,6 +443,7 @@ int pci_proc_detach_device(struct pci_dev *dev)
int
time to recreate the sysfs entries.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/pci-sysfs.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 793412954529..a238935c1193 100644
--- a/drivers/pci/pci-sysfs.c
this:
pci=realloc,movable_buses
?
This code is follow-up of the "PCI: Allow BAR movement during hotplug"
series (v6).
Sergey Miroshnichenko (11):
PCI: sysfs: Nullify freed pointers
PCI: proc: Nullify a freed pointer
drivers: base: Make bus_add_device() public
d
(pci_bus_add_devices()).
CC: Lukas Wunner
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/hotplug/pciehp_pci.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c
index d17f3bf36f70..6d4c1ef38210 100644
--- a/drivers/pci
x86 is also affected by this bug if a PCIe bridge has been hotplugged
without pre-enabling by the BIOS.
CC: Benjamin Herrenschmidt
Signed-off-by: Sergey Miroshnichenko
---
arch/powerpc/platforms/powernv/pci-ioda.c | 37 ---
1 file changed, 37 deletions(-)
diff --git a/arch/powerpc/p
Christoph Hellwig
Signed-off-by: Sergey Miroshnichenko
---
drivers/nvme/host/pci.c | 21 -
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 869f462e6b6e..5f162ea5a5f1 100644
--- a/drivers/nvme/host/pci.c
+++
Switch's BARs are not used by the portdrv driver, but they are still
considered as immovable until the .rescan_prepare() and .rescan_done()
hooks are added. Add these hooks to increase chances to allocate new BARs.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/pcie/portdrv_pci.c | 11
peer".
In case of problems it is still can be overridden by the following command
line option:
pcie_movable_bars=off
CC: Oliver O'Halloran
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/pci.c b/dri
When the Movable BARs feature is supported, the PCI subsystem is able to
distribute existing BARs and allocate the new ones itself, without need to
reserve gaps by BIOS.
CC: Rafael J. Wysocki
Signed-off-by: Sergey Miroshnichenko
---
drivers/pnp/system.c | 4
1 file changed, 4 insertions
O'Halloran
CC: Sam Bobroff
Signed-off-by: Sergey Miroshnichenko
---
arch/powerpc/kernel/pci-hotplug.c | 43 +++
drivers/pci/probe.c | 10 +++
include/linux/pci.h | 3 +++
3 files changed, 56 insertions(+)
diff --git a/arch/powerpc
Reading an empty slot returns all ones, which triggers a false EEH
error event on PowerNV. A rescan is performed after all the PEs have
been unmapped, so the reserved PE index is used for unfreezing.
CC: Oliver O'Halloran
CC: Sam Bobroff
Signed-off-by: Sergey Miroshnichenko
---
arch/powerpc
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.
CC: Oliver O'Halloran
CC: Sam Bobroff
Signed-off-by: Sergey Miroshnichenko
---
arch/powerpc/kernel/pci_dn.c | 88
O'Halloran
Signed-off-by: Sergey Miroshnichenko
---
arch/powerpc/kernel/rtas_pci.c | 97 +++-
arch/powerpc/platforms/powernv/pci.c | 64 --
2 files changed, 109 insertions(+), 52 deletions(-)
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc
Add a check for the UNSET resource flag to skip the released BARs
CC: Alexey Kardashevskiy
CC: Oliver O'Halloran
CC: Sam Bobroff
Signed-off-by: Sergey Miroshnichenko
---
arch/powerpc/platforms/powernv/pci-ioda.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch
of
struct pci_bus, which is calculated during the preparation to the rescan.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/bus.c | 2 +-
drivers/pci/setup-res.c | 31 +--
2 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/bus.c b
able to assign all types of
BARs, so the pdev_assign_fixed_resources() became unused and thus removed.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/pci.h | 2 ++
drivers/pci/setup-bus.c | 78 -
drivers/pci/setup-res.c | 7 ++--
3 files changed
on x86.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/probe.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 94bbdf9b9dc1..73452aa81417 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -305,6 +305,16 @@ int
Assure that MPS settings are set up for bridges which are discovered during
manually triggered rescan via sysfs. This sequence of bridge init (using
pci_rescan_bus()) will be used for pciehp hot-add events when BARs are
movable.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/probe.c | 5
erved gaps, but via rearranging the
existing BARs. Requesting a precise amount of space for bridge windows
increases the chances of adding the new bridge successfully.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
Allow matching IORESOURCE_PCI_FIXED prefetchable BARs to non-prefetchable
windows, so they follow the same rules as immovable BARs.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 13 +
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/pci
n.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 67 +
include/linux/pci.h | 6
2 files changed, 73 insertions(+)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index a7546e02ea7c..653ba4d5f191 100644
--- a/d
l result OR
the size of an immovable range of according type, depending on which one is
larger.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/pci.h | 14 +++
drivers/pci/probe.c | 88 +
drivers/pci/setup-bus.c | 17
include/linu
of failures the pci_reassign_root_bus_resources() disables BARs for
one of the hotplugged devices and tries the assignment again.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 2 ++
drivers/pci/setup-res.c | 12
2 files changed, 14 insertions(+)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index ff33b47b1bb7..cf325daae1b1 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers
assigning them to non-direct parents.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 10 +-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 4b538d132958..ff33b47b1bb7 100644
--- a/drivers/pci/setup
devices, especially if no/not enough gaps were reserved by the
BIOS/bootloader/firmware.
The last step of writing the recalculated windows to the bridges is done
by the new pci_setup_bridges() function.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/pci.h | 1 +
drivers/pci/probe.c
failure) -
B. As a result, A will not get BARs while it could. This issue is only
relevant when hotplugging two and more devices simultaneously.
Add a new res_mask bitmask to the struct pci_dev for storing the indices of
assigned BARs.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/pci.h
-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 2c02eb1acf5d..f2f02e6c9000 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -295,7 +295,8 @@ static
operating after releasing, as they will be
updated to the new values in the end of a hotplug event.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 075e8185b936
with the
PCI_FIXED and the immovable ones - which are bound by drivers without
support of the movable BARs feature.
Add the pci_release_child_resources() to replace release_child_resources()
in handling the described PCI-specific cases.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 54
ct pci_error_handlers;
- Add a bugfix of a race condition;
- Fixed hotplug in a non-pre-enabled (by BIOS/firmware) bridge;
- Fix the compatibility of the feature with pm_runtime and D3-state;
- Hotplug events from pciehp also can move BARs;
- Add support of the feature to the NVME driver.
Sergey
ault until the final patch of the series.
It can be overridden per-arch using the pci_can_move_bars=false flag or by
the following command line option:
pci=no_movable_bars
CC: Sam Bobroff
CC: Rajat Jain
CC: Lukas Wunner
CC: Oliver O'Halloran
CC: David Laight
Signed-off-by: Sergey Miro
if the bridge is already pci_is_enabled(). So if the bridge was
empty initially (an edge case), then hotplugged devices fail to IO/MEM.
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
n from commit 40f11adc7cd9 ("PCI: Avoid race
while enabling upstream bridges"), but adding a per-device mutexes and
preventing the dev->enable_cnt from from incrementing early.
CC: Srinath Mannam
CC: Marta Rybczynska
Signed-off-by: Sergey Miroshnichenko
[1]
https://lore.kernel.org/l
On 10/16/19 1:14 AM, Bjorn Helgaas wrote:
On Mon, Sep 30, 2019 at 03:59:25PM +0300, Sergey Miroshnichenko wrote:
Hello Bjorn,
On 9/28/19 1:02 AM, Bjorn Helgaas wrote:
On Fri, Aug 16, 2019 at 07:50:41PM +0300, Sergey Miroshnichenko wrote:
When hot-adding a device, the bridge may have windows
Hello David,
On 9/30/19 11:44 AM, David Laight wrote:
From: Bjorn Helgaas
Sent: 27 September 2019 23:02
On Fri, Aug 16, 2019 at 07:50:41PM +0300, Sergey Miroshnichenko wrote:
When hot-adding a device, the bridge may have windows not big enough (or
fragmented too much) for newly requested BARs
Hello Bjorn,
On 9/28/19 1:02 AM, Bjorn Helgaas wrote:
On Fri, Aug 16, 2019 at 07:50:41PM +0300, Sergey Miroshnichenko wrote:
When hot-adding a device, the bridge may have windows not big enough (or
fragmented too much) for newly requested BARs to fit in. And expanding
these bridge windows may
Hello Bjorn,
On 9/28/19 12:59 AM, Bjorn Helgaas wrote:
On Fri, Aug 16, 2019 at 07:50:39PM +0300, Sergey Miroshnichenko wrote:
This is a yet another approach to fix an old [1-2] concurrency issue, when:
- two or more devices are being hot-added into a bridge which was
initially empty
Hi Oliver,
On 9/4/19 8:37 AM, Oliver O'Halloran wrote:
> On Fri, 2019-08-16 at 19:50 +0300, Sergey Miroshnichenko wrote:
>> Add pcibios_rescan_prepare()/_done() hooks for the powerpc platform. Now if
>> the device's driver supports movable BARs, pcibios_rescan_prepare() will be
On 9/4/19 8:42 AM, Oliver O'Halloran wrote:
> On Fri, 2019-08-16 at 19:50 +0300, Sergey Miroshnichenko wrote:
>> A hotplugged bridge with many hotplug-capable ports may request
>> reserving more IO space than the machine has. This could be overridden
>> with the "hpiosiz
(pci_bus_add_devices()).
CC: Lukas Wunner
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/hotplug/pciehp_pci.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c
index d17f3bf36f70..66c4e6d88fe3 100644
--- a/drivers/pci
Switch's BARs are not used by the portdrv driver, but they are still
considered as immovable until the .rescan_prepare() and .rescan_done()
hooks are added. Add these hooks to increase chances to allocate new BARs.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/pcie/portdrv_pci.c | 11
e80080-3fe8008f : nvme
3fe80090-3fe80097 : 0020:18:00.0
...
During the rescanning, both READ and WRITE speeds drop to zero for a while
due to driver's pause, then restore.
Cc: linux-n...@lists.infradead.org
Cc: Christoph Hellwig
Signed-off-by: Sergey Miro
uot;pci=realloc,pcie_bus_peer2peer".
In case of problems it is still can be overridden by the following command
line option:
pcie_movable_bars=off
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/pci-driver.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/pci/pci-driver.c b/driv
Assure that MPS settings are set up for bridges which are discovered
during manually triggered rescan via sysfs. This sequence of bridge
init (using pci_rescan_bus()) will be used for pciehp hot-add events
when BARs are movable.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/probe.c | 5
, so
it it safe to rebuild the EEH address cache during that.
CC: Oliver O'Halloran
Signed-off-by: Sergey Miroshnichenko
---
arch/powerpc/kernel/pci-hotplug.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/arch/powerpc/kernel/pci-hotplug.c
b/arch/powerpc/kernel/pci-hotplug.c
able to assign all types of
BARs, so the pdev_assign_fixed_resources() became unused and thus removed.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/pci.h | 2 ++
drivers/pci/setup-bus.c | 79 -
drivers/pci/setup-res.c | 8 +++--
3 files
Add a check for the UNSET resource flag to skip the released BARs
CC: Alexey Kardashevskiy
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
erved gaps, but via rearranging the
existing BARs. Requesting a precise amount of space for bridge windows
increases the chances of adding the new bridge successfully.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
of
struct pci_bus, which is calculated during the preparation to the rescan.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/bus.c | 2 +-
drivers/pci/setup-res.c | 28 ++--
2 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/bus.c b/drivers
Allow matching IORESOURCE_PCI_FIXED prefetchable BARs to non-prefetchable
windows, so they follow the same rules as immovable BARs.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 13 +
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/pci
n.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 67 +
include/linux/pci.h | 6
2 files changed, 73 insertions(+)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 420510a1a257..586aaa9578b2 100644
--- a/d
l result OR
the size of an immovable range of according type, depending on which one is
larger.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/pci.h | 14 +++
drivers/pci/probe.c | 88 +
drivers/pci/setup-bus.c | 17
include/linu
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 2 ++
drivers/pci/setup-res.c | 12
2 files changed, 14 insertions(+)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 2c250efca512..aee330047121 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers
of failures the pci_reassign_root_bus_resources() disables BARs for
one of the hotplugged devices and tries the assignment again.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup
failure) -
B. As a result, A will not get BARs while it could. This issue is only
relevant when hotplugging two and more devices simultaneously.
Add a new res_mask bitmask to the struct pci_dev for storing the indices of
assigned BARs.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/pci.h
assigning them to non-direct parents.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 1a731002ce18..2c250efca512 100644
--- a/drivers/pci/setup
devices, especially if no/not enough gaps were reserved by the
BIOS/bootloader/firmware.
The last step of writing the recalculated windows to the bridges is done
by the new pci_setup_bridges() function.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/pci.h | 1 +
drivers/pci/probe.c
-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 6cb8b293c576..7c2c57f77c6f 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -295,7 +295,8 @@ static
with the
PCI_FIXED and the immovable ones - which are bound by drivers without
support of the movable BARs feature.
Add the pci_release_child_resources() to replace release_child_resources()
in handling the described PCI-specific cases.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 54
lloran
CC: David Laight
Signed-off-by: Sergey Miroshnichenko
---
.../admin-guide/kernel-parameters.txt | 7 ++
drivers/pci/pci-driver.c | 2 +
drivers/pci/pci.c | 24 ++
drivers/pci/pci.h | 2 +
drivers/p
n from commit 40f11adc7cd9 ("PCI: Avoid race
while enabling upstream bridges"), but adding a per-device mutexes and
preventing the dev->enable_cnt from from incrementing early.
CC: Srinath Mannam
CC: Marta Rybczynska
Signed-off-by: Sergey Miroshnichenko
[1]
https://lore.kernel.org/l
if the bridge is already pci_is_enabled(). So if the bridge was
empty initially (an edge case), then hotplugged devices fail to IO/MEM.
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
d hotplug in a non-pre-enabled (by BIOS/firmware) bridge;
- Fix the compatibility of the feature with pm_runtime and D3-state;
- Hotplug events from pciehp also can move BARs;
- Add support of the feature to the NVME driver.
Sergey Miroshnichenko (23):
PCI: Fix race condition in pci_enable/di
php module to the standard pciehp driver for PCI
hotplug functionality.
Signed-off-by: Sergey Miroshnichenko
---
arch/powerpc/kernel/pci_dn.c | 5 +
arch/powerpc/platforms/powernv/eeh-powernv.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kerne
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 a5b04410c8b4
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
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.
Reviewed-by: Oliver O'Halloran
Signed-off-by: Sergey Miroshnichenko
---
arch/powerpc/include/asm/ppc-pci.h | 1 +
arch/powerpc/kernel/pci_dn.c
O'Halloran
Signed-off-by: Sergey Miroshnichenko
---
arch/powerpc/kernel/rtas_pci.c | 97 +++-
arch/powerpc/platforms/powernv/pci.c | 64 --
2 files changed, 109 insertions(+), 52 deletions(-)
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc
_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 warnings.
Sergey Miroshnichenko (5):
powerpc/pci: Access PCI config space directly w/o p
On 4/30/19 9:00 AM, Oliver O'Halloran wrote:
> On Mon, 2019-03-11 at 14:52 +0300, Sergey Miroshnichenko wrote:
>
>> When called within pcibios_sriov_enable(), the pci_sriov_get_totalvfs(pdev)
>> returns zero, because the device is yet preparing to enable the VFs.
On 3/26/19 11:55 PM, Bjorn Helgaas wrote:
> On Mon, Mar 11, 2019 at 04:31:13PM +0300, Sergey Miroshnichenko wrote:
>> When movable BARs are enabled, the PCI subsystem at first releases
>> all the bridge windows and then performs an attempt to assign new
>> requested re
On 3/26/19 11:41 PM, Bjorn Helgaas wrote:
> On Mon, Mar 11, 2019 at 04:31:12PM +0300, Sergey Miroshnichenko wrote:
>> When the movable BARs feature is enabled, don't rely on the memory gaps
>> reserved by the BIOS/bootloader/firmware, but instead rearrange the BARs
>> and br
On 3/27/19 8:03 PM, David Laight wrote:
> From: Bjorn Helgaas
>> Sent: 26 March 2019 20:29
>>
>> On Mon, Mar 11, 2019 at 04:31:10PM +0300, Sergey Miroshnichenko wrote:
>>> If a PCIe device driver doesn't yet have support for movable BARs,
>>> mark device's BA
On 3/26/19 11:20 PM, Bjorn Helgaas wrote:
> [+cc Keith, Jens, Christoph, Sagi, linux-nvme, LKML]
>
> On Mon, Mar 11, 2019 at 04:31:09PM +0300, Sergey Miroshnichenko wrote:
>> Hotplugged devices can affect the existing ones by moving their BARs.
>> PCI subsystem will inform
On 3/26/19 10:24 PM, Bjorn Helgaas wrote:
> On Mon, Mar 11, 2019 at 04:31:06PM +0300, Sergey Miroshnichenko wrote:
>> If a new PCIe device has been hot-plugged between the two active ones
>> without big enough gap between their BARs,
>
> Just to speak precisely her
On 3/26/19 10:13 PM, Bjorn Helgaas wrote:
> On Mon, Mar 11, 2019 at 04:31:04PM +0300, Sergey Miroshnichenko wrote:
>> After updating the bridge window resources, the PCI_COMMAND_IO and
>> PCI_COMMAND_MEMORY bits of the bridge must be addressed as well.
>>
>> Signed-of
On 3/26/19 10:00 PM, Bjorn Helgaas wrote:
> [+cc Srinath, Marta, LKML]
>
> On Mon, Mar 11, 2019 at 04:31:03PM +0300, Sergey Miroshnichenko wrote:
>> CPU0 CPU1
>>
>> pci_enable_device_mem() pci_enable_device_me
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
and bridge windows.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 69 -
1 file changed, 55 insertions(+), 14 deletions(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index f4737339d5ec..932a6c020d10 100644
Consider previously calculated boundaries when allocating a bridge
window, setting the lowest allowed address and checking the result.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/bus.c | 2 +-
drivers/pci/setup-res.c | 31 +--
2 files changed, 30
With movable BARs, adding a hotplugged device may affect all the PCIe
domain starting from the root, so use a pci_rescan_bus() function which
handles the rearrangement of existing BARs and bridge windows.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/hotplug/pciehp_pci.c | 14
-by: Sergey Miroshnichenko
---
drivers/pci/bus.c | 5 ++
drivers/pci/pci.h | 11 +
drivers/pci/probe.c | 100 +++-
drivers/pci/setup-bus.c | 15 ++
include/linux/pci.h | 1 +
5 files changed, 130 insertions(+), 2 deletions
us's fixed_range_hard-> |
| <- bus's bridge window -> |
These ranges will be later used to arrange bridge windows in a way which
covers every immovable BAR as well as the movable ones during hotplug.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/pci.h | 1
ard --> |
| <-- fixed_range_hard.end - window size --> |
| <-- fixed_range_hard.start + window size --> |
| <--bus's fixed_range_soft--> |
Signed-off-by: Sergey Miroshnichenko
---
driv
non-pre-enabled (by BIOS/firmware) bridge;
- Fix the compatibility of the feature with pm_runtime and D3-state;
- Hotplug events from pciehp also can move BARs;
- Add support of the feature to the NVME driver.
Sergey Miroshnichenko (21):
PCI: Fix writing invalid BARs during pci_restore_state()
PCI: Fix r
Don't lose the size of the requested EP's BAR if it can't be fit
in a current trial, so this can be retried.
But a failed bridge window must be dropped and recalculated in the
next trial.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 3 ++-
drivers/pci/setup-res.c | 12
pbus_size_mem() returns a precise amount of memory required to fit
all the requested BARs and windows of children bridges.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci
by the pci_assign_unassigned_root_bus_resources().
The last step of writing the recalculated windows to the bridges is done
by the new pci_setup_bridges() function.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/pci.h | 1 +
drivers/pci/probe.c | 22 ++
drivers/pci/setup-bus.c | 11
The only difference between the fixed and movable BARs is an offset
preservation during the release+reassign procedure on PCIe rescan.
When fixed BARs are included into the result of pbus_size_mem(), these
BARs can be restricted: assign them to direct parents only.
Signed-off-by: Sergey
Allow matching them to non-prefetchable windows, as it is done for movable
resources.
Signed-off-by: Sergey Miroshnichenko
---
drivers/pci/setup-bus.c | 13 +
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index
1 - 100 of 161 matches
Mail list logo