]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: Move jailhouse's isolated function handling to pci_scan_slot()
authorNiklas Schnelle <schnelle@linux.ibm.com>
Tue, 28 Jun 2022 14:30:58 +0000 (16:30 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 22 Jul 2022 21:05:21 +0000 (16:05 -0500)
commitc255dc15a3de94c94bf63bdefeaf92cb3bcb1723
tree9934629420b3e0f36355239baa8dbeb99fd2aaf3
parenteaf2ec5b35948afe3d70ef0d0dad11c037882308
PCI: Move jailhouse's isolated function handling to pci_scan_slot()

The special case of the jailhouse hypervisor passing through individual PCI
functions handles scanning for PCI functions even if function 0 does not
exist. Previously this was done with an extra loop duplicating the one in
pci_scan_slot(). By incorporating the check for jailhouse_paravirt() into
pci_scan_slot() we can instead do this as part of the normal slot scan.
Note that with the assignment of dev->multifunction gated by fn > 0 we set
dev->multifunction unconditionally for all functions if function 0 is
missing just as in the existing jailhouse loop.

The only functional change is that we now call pcie_aspm_init_link_state()
for these functions, but this already happened if function 0 was passed
through and should not be a problem.

Link: https://lore.kernel.org/linux-pci/20220408224514.GA353445@bhelgaas/
Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20220628143100.3228092-4-schnelle@linux.ibm.com
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
drivers/pci/probe.c