diff options
author | Ray Ni <ray.ni@intel.com> | 2021-12-29 21:21:09 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-29 13:45:29 +0000 |
commit | c095122d4b5f3152417cd97dabecfe31cc3b6508 (patch) | |
tree | 1aa741a4cb0fbb488338a5a30bbf86276226fbbc /MdeModulePkg | |
parent | 7935be0fbd8f47266e5972f4cba1a1e58505061a (diff) | |
download | edk2-c095122d4b5f3152417cd97dabecfe31cc3b6508.tar.gz |
MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP
Before trying to access parent root port to check ARI capabilities,
enumerator should see if Endpoint device is not Root Complex integrated
to avoid undefined parent register accesses.
Signed-off-by: Damian Bassa <damian.bassa@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c index ed7f2d4ac6..9251388bc2 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c @@ -2116,6 +2116,27 @@ AuthenticatePciDevice ( }
/**
+ Checks if PCI device is Root Bridge.
+
+ @param PciIoDevice Instance of PCI device
+
+ @retval TRUE Device is Root Bridge
+ @retval FALSE Device is not Root Bridge
+
+**/
+BOOLEAN
+IsRootBridge (
+ IN PCI_IO_DEVICE *PciIoDevice
+ )
+{
+ if (PciIoDevice->Parent == NULL) {
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+
+/**
Create and initialize general PCI I/O device instance for
PCI device/bridge device/hotplug bridge device.
@@ -2217,7 +2238,10 @@ CreatePciIoDevice ( return NULL;
}
- if (PcdGetBool (PcdAriSupport)) {
+ //
+ // Check if device's parent is not Root Bridge
+ //
+ if (PcdGetBool (PcdAriSupport) && !IsRootBridge (Bridge)) {
//
// Check if the device is an ARI device.
//
|