diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-05-10 07:10:38 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-05-10 07:10:38 +0000 |
commit | fb8ecfb23e3eeb074885c400d369487f28085d91 (patch) | |
tree | ee9d2b3c6926915f915ea654825fdfd124b6651b | |
parent | 212e027c54dac6b6219718415c11b291ae20bb67 (diff) | |
download | edk2-fb8ecfb23e3eeb074885c400d369487f28085d91.zip edk2-fb8ecfb23e3eeb074885c400d369487f28085d91.tar.gz edk2-fb8ecfb23e3eeb074885c400d369487f28085d91.tar.bz2 |
Sync patch r14338 and r14339 from main trunk.
1. MdeMdeModulePkg/UsbBusDxe: Break device enumeration process if the device descriptor includes 0 configuration.
2. MdeMdeModulePkg/Xhci: Clear BIOS_OWN semaphore before halting XHCI controller.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/branches/UDK2010.SR1@14341 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 28 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c | 9 |
2 files changed, 20 insertions, 17 deletions
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c index ab32434..7fd5df6 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c @@ -1799,23 +1799,23 @@ XhcExitBootService ( XhcHaltHC (Xhc, XHC_GENERIC_TIMEOUT);
if (Xhc->PollTimer != NULL) {
- gBS->CloseEvent (Xhc->PollTimer);
- }
-
- //
- // Restore original PCI attributes
- //
+ gBS->CloseEvent (Xhc->PollTimer); + } + + XhcClearBiosOwnership (Xhc); + + // + // Restore original PCI attributes + // PciIo->Attributes (
PciIo,
EfiPciIoAttributeOperationSet,
- Xhc->OriginalPciAttributes,
- NULL
- );
-
- XhcClearBiosOwnership (Xhc);
-}
-
-/**
+ Xhc->OriginalPciAttributes, + NULL + ); +} + +/** Starting the Usb XHCI Driver.
@param This Protocol instance pointer.
diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c index 35cdaf5..1713e3c 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c @@ -786,10 +786,13 @@ UsbBuildDescTable ( return Status;
}
- DevDesc = UsbDev->DevDesc;
- NumConfig = DevDesc->Desc.NumConfigurations;
- DevDesc->Configs = AllocateZeroPool (NumConfig * sizeof (USB_CONFIG_DESC *));
+ DevDesc = UsbDev->DevDesc;
+ NumConfig = DevDesc->Desc.NumConfigurations;
+ if (NumConfig == 0) {
+ return EFI_DEVICE_ERROR;
+ }
+ DevDesc->Configs = AllocateZeroPool (NumConfig * sizeof (USB_CONFIG_DESC *));
if (DevDesc->Configs == NULL) {
return EFI_OUT_OF_RESOURCES;
}
|