Jordan, PciEnumeratorLight() in original code always runs in gFullEnumeration = FALSE when PcdPciDisableBusEnumeration = TRUE. But PciEnumeratorLight() in your code runs in gFullEnumeration=TRUE when PcdPciDisableBusEnumeration = TRUE for the first root bridge. When gFullEnumeration=TRUE, some hardware initializations are still performed in PciEnumeratorLight() path, e.g.: InitializePpb().
Thanks, Ray -----Original Message----- From: Jordan Justen [mailto:[email protected]] Sent: Saturday, February 14, 2015 3:26 AM To: [email protected] Subject: [edk2] [PATCH] MdeModulePkg/PciBusDxe: Always install PCI enumeration complete protocol Some software would like to watch for gEfiPciEnumerationCompleteProtocolGuid to be installed, but when PcdPciDisableBusEnumeration was enabled, we would not install the protocol. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <[email protected]> Cc: Feng Tian <[email protected]> Cc: Wei Liu <[email protected]> --- Wei: Does this also fix the issue for you? https://github.com/jljusten/edk2.git xen-pci-complete MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c | 6 +--- MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c | 46 ++++++++++++++++++++++---- 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c index 2252235..5afbb82 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c @@ -284,11 +284,7 @@ PciBusDriverBindingStart ( ); } - if (PcdGetBool (PcdPciDisableBusEnumeration)) { - gFullEnumeration = FALSE; - } else { - gFullEnumeration = (BOOLEAN) ((SearchHostBridgeHandle (Controller) ? FALSE : TRUE)); - } + gFullEnumeration = (BOOLEAN) ((SearchHostBridgeHandle (Controller) ? FALSE : TRUE)); // // Open Device Path Protocol for PCI root bridge diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c index 7329143..ca4963b 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c @@ -1,7 +1,7 @@ /** @file PCI eunmeration implementation on entire PCI bus system for PCI Bus module. -Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> +Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -15,6 +15,28 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "PciBus.h" /** + Installs gEfiPciEnumerationCompleteProtocolGuid on the given handle. + + @param Handle Handle of device to install the protocol on. + + @retval EFI_SUCCESS The protocol was installed successfully. + @retval other Some error occurred when installing the protocol. + +**/ +EFI_STATUS +InstallEnumerationCompleteProtocol ( + IN EFI_HANDLE Handle + ) +{ + return gBS->InstallProtocolInterface ( + &Handle, + &gEfiPciEnumerationCompleteProtocolGuid, + EFI_NATIVE_INTERFACE, + NULL + ); +} + +/** This routine is used to enumerate entire pci bus system in a given platform. @@ -63,6 +85,21 @@ PciEnumerator ( HostBridgeHandle = PciRootBridgeIo->ParentHandle; // + // PcdPciDisableBusEnumeration can be used to skip full enumeration, + // but we still install gEfiPciEnumerationCompleteProtocolGuid. + // + if (PcdGetBool (PcdPciDisableBusEnumeration)) { + Status = PciEnumeratorLight (Controller); + if (EFI_ERROR (Status)) { + return Status; + } + + gFullEnumeration = FALSE; + + return InstallEnumerationCompleteProtocol (HostBridgeHandle); + } + + // // Get the pci host bridge resource allocation protocol // Status = gBS->OpenProtocol ( @@ -133,12 +170,7 @@ PciEnumerator ( gFullEnumeration = FALSE; - Status = gBS->InstallProtocolInterface ( - &HostBridgeHandle, - &gEfiPciEnumerationCompleteProtocolGuid, - EFI_NATIVE_INTERFACE, - NULL - ); + Status = InstallEnumerationCompleteProtocol (HostBridgeHandle); if (EFI_ERROR (Status)) { return Status; } -- 2.1.4 ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel
