From 7c82ff0b6b12437bfc25d01d52308fc6fe2e1311 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 15 Aug 2024 08:46:41 +0100 Subject: [pci] Separate permission to probe buses from bus:dev.fn range discovery The UEFI device model requires us to not probe the PCI bus directly, but instead to wait to be offered the opportunity to drive devices via our driver service binding handle. We currently inhibit PCI bus probing by having pci_discover() return an empty range when using the EFI PCI I/O API. This has the unwanted side effect that scanning the bus manually using the "pciscan" command will also fail to discover any devices. Separate out the concept of being allowed to probe PCI buses from the mechanism for discovering PCI bus:dev.fn address ranges, so that this limitation may be removed. Signed-off-by: Michael Brown --- src/drivers/bus/pci.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/drivers/bus/pci.c') diff --git a/src/drivers/bus/pci.c b/src/drivers/bus/pci.c index 92b389641..05c9a5c26 100644 --- a/src/drivers/bus/pci.c +++ b/src/drivers/bus/pci.c @@ -361,6 +361,10 @@ static int pcibus_probe ( struct root_device *rootdev ) { uint32_t busdevfn = 0; int rc; + /* Skip automatic probing if prohibited */ + if ( ! pci_can_probe() ) + return 0; + do { /* Allocate struct pci_device */ if ( ! pci ) -- cgit