Re: [PATCH v5 1/6] MdeModulePkg/PciHostBridge: io range is not mandatory

Ni, Ray

can you explain more?

Your code changes the PciHostBridge driver to ignore the failure of IO allocation.
If IO requirement of certain PCI(E) devices can be ignored, can you change the IncompatiblePciDevice protocol implementation to override the IO request from the devices?


-----Original Message-----
From: <> On Behalf Of Ard Biesheuvel
Sent: Tuesday, April 26, 2022 4:49 AM
To: edk2-devel-groups-io <>; Gerd Hoffmann <kraxel@...>
Cc: Pawel Polawski <ppolawsk@...>; Ard Biesheuvel <ardb+tianocore@...>; Gao, Liming
<gaoliming@...>; Wu, Hao A <hao.a.wu@...>; Ni, Ray <>; Oliver Steffen
<osteffen@...>; Leif Lindholm <quic_llindhol@...>; Justen, Jordan L <jordan.l.justen@...>; Yao,
Jiewen <jiewen.yao@...>; Chang, Abner <abner.chang@...>; Wang, Jian J <>
Subject: Re: [edk2-devel] [PATCH v5 1/6] MdeModulePkg/PciHostBridge: io range is not mandatory

On Fri, 22 Apr 2022 at 09:37, Gerd Hoffmann <kraxel@...> wrote:

io range is not mandatory according to pcie spec,
so allow bridge configurations without io address
space assigned.

Signed-off-by: Gerd Hoffmann <kraxel@...>
Reviewed-by: Ard Biesheuvel <ardb@...>
Could one of the MdeModulePkg maintainers please get this reviewed? Thanks.

MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c
index b20bcd310ad5..712662707931 100644
--- a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c
+++ b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c
@@ -1085,6 +1085,9 @@ NotifyPhase (
RootBridge->ResAllocNode[Index].Base = BaseAddress;
RootBridge->ResAllocNode[Index].Status = ResAllocated;
DEBUG ((DEBUG_INFO, "Success\n"));
+ } else if ((Index == TypeIo) && (RootBridge->Io.Base == MAX_UINT64)) {
+ /* optional on PCIe */
+ DEBUG ((DEBUG_INFO, "PCI Root Bridge does not provide IO Resources.\n"));
} else {
DEBUG ((DEBUG_ERROR, "Out Of Resource!\n"));

Join to automatically receive all group messages.