From e8c24d8b77458ab41179ba7c5dc27c0490419409 Mon Sep 17 00:00:00 2001 From: Chris Fernald Date: Thu, 21 Sep 2023 14:11:38 -0700 Subject: [PATCH] Change assert to not fire when intentionally disabling PCI enumeration (#572) ## Description When setting PcdPciDisableBusEnumeration to TRUE, an assert is hit in StartPciDevices due to the RootBridge not existing. This is expected when skipping enumeration so change the assert to only fail if enumeration was not disabled. - [ ] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? ## How This Was Tested Tested on QEMU Q35 platform ## Integration Instructions N/A --- MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c index dfa31b5a54..88589487af 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c @@ -888,7 +888,8 @@ StartPciDevices ( RootBridge = GetRootBridgeByHandle (Controller); if (RootBridge == NULL) { - ASSERT (RootBridge != NULL); + // ASSERT (RootBridge != NULL); // MU_CHANGE + ASSERT (PcdGetBool (PcdPciDisableBusEnumeration)); // MU_CHANGE return EFI_NOT_READY; }