From: vanjeff Date: Tue, 24 Jun 2008 08:13:58 +0000 (+0000) Subject: [Description]: X-Git-Tag: edk2-stable201903~20851 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=7e388f859fee079f0c5eb035354b1f1bb79ea2fc [Description]: The Usb1.1 flash disk will hang for Bootable Image Support Test -> Bloack IO protocol Test -> Reset_Func. [Solution]: Add a stall 20ms after set address when port reset for Usb hub. [Impaction]: UsbBusDxe. [Reference Info]: EDK tracker 1120 - USB flash disk hang or fail in the new SCT blockIo test. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5365 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c index 332871a685..5c4d4025eb 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c @@ -840,7 +840,8 @@ UsbIoPortReset ( Address = Dev->Address; Dev->Address = 0; Status = UsbSetAddress (Dev, Address); - + Dev->Address = Address; + if (EFI_ERROR (Status)) { DEBUG (( EFI_D_ERROR, "UsbIoPortReset: failed to set address for device %d - %r\n", Address, Status)); @@ -848,8 +849,10 @@ UsbIoPortReset ( goto ON_EXIT; } - Dev->Address = Address; + gBS->Stall (USB_SET_DEVICE_ADDRESS_STALL); + DEBUG (( EFI_D_INFO, "UsbIoPortReset: device is now ADDRESSED at %d\n", Address)); + // // Reset the current active configure, after this device // is in CONFIGURED state.