Remove the special logic on EFI_PCI_DEVICE_ENABLE in PciBus driver. And update drivers that use this macro. The reason is that
PciIoAttributes() in PciIo.c treats EFI_PCI_DEVICE_ENABLE specially so that when EFI_PCI_DEVICE_ENABLE is passed in, only the supported bits of driver will be enabled. Now many drivers use EFI_PCI_DEVICE_ENABLE to enable PCI device even if some of them don't support some of the attributes like EFI_PCI_IO_ATTRIBUTE_MEMORY. This doesn't conform to UEFI 2.0 spec. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4115 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -2068,6 +2068,7 @@ UhciCleanDevUp (
|
||||
)
|
||||
{
|
||||
USB_HC_DEV *Uhc;
|
||||
UINT64 Supports;
|
||||
|
||||
//
|
||||
// Uninstall the USB_HC and USB_HC2 protocol, then disable the controller
|
||||
@ -2089,11 +2090,18 @@ UhciCleanDevUp (
|
||||
|
||||
UhciFreeAllAsyncReq (Uhc);
|
||||
UhciDestoryFrameList (Uhc);
|
||||
|
||||
|
||||
Uhc->PciIo->Attributes (
|
||||
Uhc->PciIo,
|
||||
EfiPciIoAttributeOperationSupported,
|
||||
0,
|
||||
&Supports
|
||||
);
|
||||
Supports &= EFI_PCI_DEVICE_ENABLE;
|
||||
Uhc->PciIo->Attributes (
|
||||
Uhc->PciIo,
|
||||
EfiPciIoAttributeOperationDisable,
|
||||
EFI_PCI_DEVICE_ENABLE,
|
||||
Supports,
|
||||
NULL
|
||||
);
|
||||
|
||||
@ -2126,6 +2134,7 @@ UhciDriverBindingStart (
|
||||
EFI_STATUS Status;
|
||||
EFI_PCI_IO_PROTOCOL *PciIo;
|
||||
USB_HC_DEV *Uhc;
|
||||
UINT64 Supports;
|
||||
|
||||
//
|
||||
// Open PCIIO, then enable the EHC device and turn off emulation
|
||||
@ -2148,10 +2157,19 @@ UhciDriverBindingStart (
|
||||
|
||||
Status = PciIo->Attributes (
|
||||
PciIo,
|
||||
EfiPciIoAttributeOperationEnable,
|
||||
EFI_PCI_DEVICE_ENABLE,
|
||||
NULL
|
||||
EfiPciIoAttributeOperationSupported,
|
||||
0,
|
||||
&Supports
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Supports &= EFI_PCI_DEVICE_ENABLE;
|
||||
Status = PciIo->Attributes (
|
||||
PciIo,
|
||||
EfiPciIoAttributeOperationEnable,
|
||||
Supports,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto CLOSE_PCIIO;
|
||||
|
Reference in New Issue
Block a user