From e3e5ac01a76bbf13283900887f21b1ff422de038 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 dfa31b5a54a..88589487aff 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; }