diff options
author | Joseph Shifflett <joseph.shifflett@hpe.com> | 2015-10-06 20:55:36 +0000 |
---|---|---|
committer | lersek <lersek@Edk2> | 2015-10-06 20:55:36 +0000 |
commit | 30a35388d12944e499642a0694c038a7e3ad6770 (patch) | |
tree | 50a7bed5fbd525d982086aadab96c1ba70cd3dab /DuetPkg | |
parent | 25a2664625f892e4a35cdb57a567e060bcde043c (diff) | |
download | edk2-30a35388d12944e499642a0694c038a7e3ad6770.tar.gz edk2-30a35388d12944e499642a0694c038a7e3ad6770.tar.bz2 edk2-30a35388d12944e499642a0694c038a7e3ad6770.zip |
DuetPkg: exit pci function loops early if device is not multi-function
When looping through all PCI functions, code should not look for functions
1-7 if function 0 is not present or if function 0 indicates the device is
not multifunction. Prior to this fix the code would use stale data in a
buffer to determine if a device is multifunction even if function 0 is not
present. This fixes a code bug and provides very small performance
improvements.
PCI 2.3 Specification states: They [multifunction devices] are also
required to always implement function 0 in the device. Implementing other
functions is optional and may be assigned in any order.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Joseph Shifflett <joseph.shifflett@hpe.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18575 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'DuetPkg')
-rw-r--r-- | DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c b/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c index fb41727e7a..80b2b6b24d 100644 --- a/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c +++ b/DuetPkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c @@ -1,6 +1,7 @@ /*++
Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.<BR>
+(C) Copyright 2015 Hewlett Packard Enterprise Development LP<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
@@ -216,6 +217,13 @@ Returns: (UINT8) Func
);
+ if (EFI_ERROR (Status) && Func == 0) {
+ //
+ // go to next device if there is no Function 0
+ //
+ break;
+ }
+
if (!EFI_ERROR (Status)) {
//
|