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:
@@ -2129,6 +2129,16 @@ XhcDriverBindingStop (
|
||||
return Status;
|
||||
}
|
||||
|
||||
Status = gBS->UninstallProtocolInterface (
|
||||
Controller,
|
||||
&gEfiUsb2HcProtocolGuid,
|
||||
Usb2Hc
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
Xhc = XHC_FROM_THIS (Usb2Hc);
|
||||
PciIo = Xhc->PciIo;
|
||||
|
||||
@@ -2154,19 +2164,6 @@ XhcDriverBindingStop (
|
||||
}
|
||||
}
|
||||
|
||||
XhcHaltHC (Xhc, XHC_GENERIC_TIMEOUT);
|
||||
XhcClearBiosOwnership (Xhc);
|
||||
|
||||
Status = gBS->UninstallProtocolInterface (
|
||||
Controller,
|
||||
&gEfiUsb2HcProtocolGuid,
|
||||
Usb2Hc
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
if (Xhc->PollTimer != NULL) {
|
||||
gBS->CloseEvent (Xhc->PollTimer);
|
||||
}
|
||||
@@ -2175,6 +2172,8 @@ XhcDriverBindingStop (
|
||||
gBS->CloseEvent (Xhc->ExitBootServiceEvent);
|
||||
}
|
||||
|
||||
XhcHaltHC (Xhc, XHC_GENERIC_TIMEOUT);
|
||||
XhcClearBiosOwnership (Xhc);
|
||||
XhciDelAllAsyncIntTransfers (Xhc);
|
||||
XhcFreeSched (Xhc);
|
||||
|
||||
|
Reference in New Issue
Block a user