fix: Only register root bridges with actual devices, not empty ones. (#2142)

Registering logical root bridges with no devices can cause unexpected
behavior for platforms that use _PCI_ENUM_BUS_SCAN_TYPE = "range", since
all empty buses in the range will be compared against the resource
allocation table entries.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
This commit is contained in:
bejeanmo 2024-02-16 12:34:49 -05:00 committed by GitHub
parent 557d4228f9
commit 9c527d99c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -1742,8 +1742,11 @@ PciScanRootBridges (
Root->BusNumberRanges.BusLimit = SubBusNumber;
Root->Address |= BIT31;
InsertPciDevice (Bridge, Root);
Count++;
// Only add Root Bridges with actual devices, not empty ones.
if (Root->ChildList.ForwardLink != &Root->ChildList) {
InsertPciDevice (Bridge, Root);
Count++;
}
if (EnumPolicy->BusScanType != BusScanTypeList) {
Index = SubBusNumber;