Skip to content

PCI: Rework pci_scan_slot() and isolated PCI functions

Niklas Schnelle linux-pci linux-s390 lkml 7 versions – Applied

Status from this message: Applied to pci/enumeration for v5.20, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest5 patches 11 repliesApplied
  2. v5 posting 3/34 patches 1 replySuperseded
  3. v5 posting 2/34 patches 4 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v5 posting 1/34 patches0 repliesSuperseded
v44 patches1 replySuperseded
v34 patches5 repliesSuperseded
v24 patches2 repliesSuperseded

Changes in v6 from the cover letter

- Added a patch (2) which separates the ARI case into its own function
- Some whitespace changes to remove unnecesssary empty lines Changes v4 -> v5:
- Remove unintended whitespace change in patch 1

Patches in v6 Applied

#Subject and filesSizeRepliesApplied
1/5PCI: Clean up pci_scan_slot()drivers/pci/probe.c+19 -194 replies
2/5PCI: Split out next_ari_fn() from next_fn()drivers/pci/probe.c+17 -131 reply
3/5PCI: Move jailhouse's isolated function handling to pci_scan_slot()drivers/pci/probe.c+10 -201 reply
4/5PCI: Extend isolated function probing to s390drivers/pci/probe.c include/linux/hypervisor.h+9 -13 replies
5/5s390/pci: allow zPCI zbus without a function zeroarch/s390/pci/pci_bus.c+20 -621 reply

Reviews trailers per patch

4 of 5 patches have a Reviewed-by or Acked-by.

PatchPierre Morel
1/5
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 0/5] PCI: Rework pci_scan_slot() and isolated PCI functions

Hi Bjorn,

In an earlier version[0], I sought to apply the existing jailhouse special case for isolated PCI functions to s390. As Bjorn noted in[1] there appears to be some potential for cleaning things up and removing duplication.

This series attempts to do this cleanup (Patches 1 through 3) followed by enabling isolated PCI functions for s390 (Patches 4 and 5).

Testing:
- On s390 with SR-IOV and a ConnectX NIC with PF 1 but not PF 0 passed throug i.e. the isolated function case. Also of course with just VFs and an NVMe.
- On x86_64 on a desktop system where ARI is disabled and with an SR-IOV NIC with non-contiguous VFs as well as the usual other PCI devices.

Thanks,
Niklas

[0] https://lore.kernel.org/linux-pci/[email protected]/
[1] https://lore.kernel.org/linux-pci/20220408224514.GA353445@bhelgaas/

Changes v5 -> v6:
- Added a patch (2) which separates the ARI case into its own function
- Some whitespace changes to remove unnecesssary empty lines Changes v4 -> v5:
- Remove unintended whitespace change in patch 1
Changes v3 -> v4:
- Use a do {} while loop in pci_scan_slot() as it is simpler (Bjorn)
- Explicitly check "fn == 0" as it is not a pointer or bool (Bjorn)
- Keep the "!dev" check in the ARI branch of next_fn() (Bjorn)
- Moved the "fn == 0 && !dev" condition out of next_fn() into pci_scan_slot(). This allows us to keep the "!dev" case in the ARI branch and means there are no new conditions in next_fn() making it easier to verify that its behavior is equivalent to the existing code.
- Guard the assignment of dev->multifunction with "fn > 0" instead of "nr > 0". This matches the existing logic more closely and works for the jailhouse case which unconditionally sets dev->multifunction for "fn > 0". This also means fn == 0 is the single "first iteration" test.
- Remove some unneeded whitespace in patch 2

Changes v2 -> v3:
- Removed now unused nr_devs variable (kernel test robot)

Niklas Schnelle (5):
PCI: Clean up pci_scan_slot()
PCI: Split out next_ari_fn() from next_fn()
PCI: Move jailhouse's isolated function handling to pci_scan_slot()
PCI: Extend isolated function probing to s390
s390/pci: allow zPCI zbus without a function zero

 arch/s390/pci/pci_bus.c    | 82 +++++++++---------------------------
 drivers/pci/probe.c        | 86 ++++++++++++++++++--------------------
 include/linux/hypervisor.h |  8 ++++
 3 files changed, 68 insertions(+), 108 deletions(-)
Signature · 1 line
2.32.0