MdeModulePkg/Usb: All h/w related stop operation at DriverBindingStop() should be behind s/w related stop operation, which could avoid h/w not working if s/w stop operation fails.

Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Elvin Li <elvin.li@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14927 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Feng Tian
2013-12-03 07:04:08 +00:00
committed by erictian
parent 6855763eb2
commit 0f58371b5d
4 changed files with 79 additions and 66 deletions

View File

@@ -2049,13 +2049,6 @@ EhcDriverBindingStop (
Ehc = EHC_FROM_THIS (Usb2Hc);
PciIo = Ehc->PciIo;
//
// Stop AsyncRequest Polling timer then stop the EHCI driver
// and uninstall the EHCI protocl.
//
gBS->SetTimer (Ehc->PollTimer, TimerCancel, EHC_ASYNC_POLL_INTERVAL);
EhcHaltHC (Ehc, EHC_GENERIC_TIMEOUT);
Status = gBS->UninstallProtocolInterface (
Controller,
&gEfiUsb2HcProtocolGuid,
@@ -2066,6 +2059,13 @@ EhcDriverBindingStop (
return Status;
}
//
// Stop AsyncRequest Polling timer then stop the EHCI driver
// and uninstall the EHCI protocl.
//
gBS->SetTimer (Ehc->PollTimer, TimerCancel, EHC_ASYNC_POLL_INTERVAL);
EhcHaltHC (Ehc, EHC_GENERIC_TIMEOUT);
if (Ehc->PollTimer != NULL) {
gBS->CloseEvent (Ehc->PollTimer);
}