audk/MdeModulePkg/Bus/Pci/PciBusDxe
Foster Nong 8fc06b6e19 Fix bug on SRIOV ReservedBusNum when ARI enable.
If a device which support both features SR-IOV/ARI  has multi
functions, which maybe support 8-255. After enable ARI forwarding in
the root port and ARI Capable Hierarchy in the SR-IOV PF0.
The device will support and expose multi functions(0-255) with ARI ID routing.
In next device loop in below for() code, actually it still be in the
same SR-IOV device, and just some PF which is over 8 or higher
one(n*8), PciAllocateBusNumber() will allocate bus
number(ReservedBusNum - TempReservedBusNum)) for this PF. if reset
TempReservedBusNum as 0 in this case,it will allocate wrong bus number
for this PF because TempReservedBusNum should be total previous PF's
reserved bus numbers.

code:
  for (Device = 0; Device <= PCI_MAX_DEVICE; Device++) {
    TempReservedBusNum = 0;
    for (Func = 0; Func <= PCI_MAX_FUNC; Func++) {
    //
    // Check to see whether a pci device is present
    //
    Status = PciDevicePresent (
                 PciRootBridgeIo,
                 &Pci,
                 StartBusNumber,
                 Device,
                 Func
                 );
    ...
    Status = PciAllocateBusNumber (PciDevice, *SubBusNumber,
    (UINT8)(PciDevice->ReservedBusNum - TempReservedBusNum), SubBusNumber);

The solution is add a new flag IsAriEnabled to help handle this case.
if ARI is enabled, then TempReservedBusNum will not be reset again
during all functions(1-255) scan with checking flag IsAriEnabled.

Signed-off-by: Foster Nong <foster.nong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2022-10-14 07:07:01 +00:00
..
ComponentName.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ComponentName.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciBus.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciBus.h Fix bug on SRIOV ReservedBusNum when ARI enable. 2022-10-14 07:07:01 +00:00
PciBusDxe.inf MdeModulePkg/Bus/Pci/PciBusDxe: Support PCIe Resizable BAR Capability 2021-01-04 08:25:28 +00:00
PciBusDxe.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
PciBusDxeExtra.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
PciCommand.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciCommand.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciDeviceSupport.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciDeviceSupport.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciDriverOverride.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciDriverOverride.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciEnumerator.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciEnumerator.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciEnumeratorSupport.c Fix bug on SRIOV ReservedBusNum when ARI enable. 2022-10-14 07:07:01 +00:00
PciEnumeratorSupport.h MdeModulePkg: Update PciEnumeratorSupport to ignore OptionRom if needed 2022-04-02 10:09:47 +00:00
PciHotPlugSupport.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciHotPlugSupport.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciIo.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciIo.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciLib.c Fix bug on SRIOV ReservedBusNum when ARI enable. 2022-10-14 07:07:01 +00:00
PciLib.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciOptionRomSupport.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciOptionRomSupport.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciPowerManagement.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciPowerManagement.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciResourceSupport.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciResourceSupport.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciRomTable.c MdeModulePkg/Bus/Pci/PciBusDxe: Support platform PCI ROM override 2022-02-04 18:10:25 +00:00
PciRomTable.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00