]> www.infradead.org Git - users/jedix/linux-maple.git/commit
s390/pci: Sort PCI functions prior to creating virtual busses
authorNiklas Schnelle <schnelle@linux.ibm.com>
Thu, 26 Sep 2024 14:08:29 +0000 (16:08 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Thu, 10 Oct 2024 13:32:42 +0000 (15:32 +0200)
commit0467cdde8c4320bbfdb31a8cff1277b202f677fc
treec6a53b39f8a0b09da3a26d94f12f157ef9f67ccb
parent8cf0b93919e13d1e8d4466eb4080a4c4d9d66d7b
s390/pci: Sort PCI functions prior to creating virtual busses

Instead of relying on the observed but not architected firmware behavior
that PCI functions from the same card are listed in ascending RID order
in clp_list_pci() ensure this by sorting. To allow for sorting separate
the initial clp_list_pci() and creation of the virtual PCI busses.

Note that fundamentally in our per-PCI function hotplug design non RID
order of discovery is still possible. For example when the two PFs of
a two port NIC are hotplugged after initial boot and in descending RID
order. In this case the virtual PCI bus would be created by the second
PF using that PF's UID as domain number instead of that of the first PF.
Thus the domain number would then change from the UID of the second PF
to that of the first PF on reboot but there is really nothing we can do
about that since changing domain numbers at runtime seems even worse.
This only impacts the domain number as the RIDs are consistent and thus
even with just the second PF visible it will show up in the correct
position on the virtual bus.

Reviewed-by: Gerd Bayer <gbayer@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/pci.h
arch/s390/pci/pci.c
arch/s390/pci/pci_clp.c
arch/s390/pci/pci_event.c