]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/PciBus: Should reserve enough bus number for HPC
authorRuiyu Ni <ruiyu.ni@intel.com>
Wed, 23 Mar 2016 05:54:51 +0000 (13:54 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Thu, 24 Mar 2016 03:24:30 +0000 (11:24 +0800)
When there is no bridge before the HPC (hot plug controller),
the issue cannot be seen.
But when there are bridges before the HPC, the PciBus will only
use the value (= <CurrentBusNumber> + <ReservedBusNumber>) as the
sub-ordinary bus number for HPC.
The correct sub-ordinary bus number should be:
<CurrentBusNumber> + <OccupiedBusNumber>(by earlier bridges) +
<ReservedBusNumber>.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c

index 12647be85fb3807f33e8441a47ff626118b6c0bc..f3407bcb63a1743fc54e44c58da458aaa6a57126 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Internal library implementation for PCI Bus module.\r
 \r
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
 (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -1232,7 +1232,7 @@ PciScanBus (
             //\r
             // Reserve the larger one between the actual occupied bus number and padded bus number\r
             //\r
-            Status = PciAllocateBusNumber (PciDevice, StartBusNumber, (UINT8) (BusRange), &PaddedSubBus);\r
+            Status = PciAllocateBusNumber (PciDevice, SecondBus, (UINT8) (BusRange), &PaddedSubBus);\r
             if (EFI_ERROR (Status)) {\r
               return Status;\r
             }\r