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>
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ Checks if PCI device is Root Bridge.\r
+\r
+ @param PciIoDevice Instance of PCI device\r
+\r
+ @retval TRUE Device is Root Bridge\r
+ @retval FALSE Device is not Root Bridge\r
+\r
+**/\r
+BOOLEAN\r
+IsRootBridge (\r
+ IN PCI_IO_DEVICE *PciIoDevice\r
+ )\r
+{\r
+ if (PciIoDevice->Parent == NULL) {\r
+ return TRUE;\r
+ } else {\r
+ return FALSE;\r
+ }\r
+}\r
+\r
/**\r
Create and initialize general PCI I/O device instance for\r
PCI device/bridge device/hotplug bridge device.\r
return NULL;\r
}\r
\r
- if (PcdGetBool (PcdAriSupport)) {\r
+ //\r
+ // Check if device's parent is not Root Bridge\r
+ //\r
+ if (PcdGetBool (PcdAriSupport) && !IsRootBridge (Bridge)) {\r
//\r
// Check if the device is an ARI device.\r
//\r