summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2018-01-22 14:23:00 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2018-01-24 11:40:34 +0800
commit42e8bc7d16aa2ef8d65a19b327d33c64cae54a9c (patch)
tree1c207ee1fcdf0c7ebb80ff640b579dc54e61908f /MdeModulePkg
parent2632981783683f5c37b430c3e8ac2df067810d3a (diff)
downloadedk2-42e8bc7d16aa2ef8d65a19b327d33c64cae54a9c.tar.gz
edk2-42e8bc7d16aa2ef8d65a19b327d33c64cae54a9c.tar.bz2
edk2-42e8bc7d16aa2ef8d65a19b327d33c64cae54a9c.zip
MdeModulePkg/PciBusDxe: Install PciEnumerationComplete after PciIo
Per PI spec, the PciEnumerationComplete protocol installation should be after PciIo installation. Today's implementation installs the PciEnumerationComplete after hardware enumeration is completed, but before PciIo installation. The change corrects the spec/implementation gap. The change also benefits certain implementation that depends on the PciIo handle in PciEnumerationComplete callback. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c15
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c10
2 files changed, 13 insertions, 12 deletions
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
index 3bb5099bd3..c48e3bba96 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
@@ -360,8 +360,19 @@ PciBusDriverBindingStart (
//
StartPciDevices (Controller);
- gFullEnumeration = FALSE;
- return EFI_SUCCESS;
+ if (gFullEnumeration) {
+ gFullEnumeration = FALSE;
+
+ Status = gBS->InstallProtocolInterface (
+ &PciRootBridgeIo->ParentHandle,
+ &gEfiPciEnumerationCompleteProtocolGuid,
+ EFI_NATIVE_INTERFACE,
+ NULL
+ );
+ ASSERT_EFI_ERROR (Status);
+ }
+
+ return Status;
}
/**
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c
index f6aa327493..d5d3c07393 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c
@@ -104,16 +104,6 @@ PciEnumerator (
return Status;
}
- Status = gBS->InstallProtocolInterface (
- &HostBridgeHandle,
- &gEfiPciEnumerationCompleteProtocolGuid,
- EFI_NATIVE_INTERFACE,
- NULL
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
return EFI_SUCCESS;
}