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
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:
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
>&
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.
>
>
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
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,
>>>
>>
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 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: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 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/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
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/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
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(+)
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
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
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
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
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
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
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
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
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
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.
>>
>
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
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(+)
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
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
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
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
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
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
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
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
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
-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
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
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
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
ard --> |
| <-- fixed_range_hard.end - window size --> |
| <-- fixed_range_hard.start + window size --> |
| <--bus's fixed_range_soft--> |
Signed-off-by: Sergey Miroshnichenko
---
driv
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
(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
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
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
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
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
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
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
-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
, 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
_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
1 - 100 of 161 matches
Mail list logo