summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-03-19 07:03:01 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-03-19 07:03:01 +0000
commit1e5914b54aa25ac3c6ad4e8b2a8a1573765d2759 (patch)
tree77ff606c6d3963118338bb48d12154329f65c845
parent533020ef8061171713edfcb1e28eac63876c9937 (diff)
downloadedk2-1e5914b54aa25ac3c6ad4e8b2a8a1573765d2759.zip
edk2-1e5914b54aa25ac3c6ad4e8b2a8a1573765d2759.tar.gz
edk2-1e5914b54aa25ac3c6ad4e8b2a8a1573765d2759.tar.bz2
R8 tracker sync:
Our UEFI Driver supports both SCSI Passthru (SPT) and Ext SCSI Passthru (That is our driver installs both SCSI Passthru and Ext SCSI Passthru). When we unload our driver SCSI Bus driver closes only ESPT and keeps SPT open. Due to this when I load my driver second time the SPT installation will fail and now attempting to unload will either crash the system or hang the system. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7906 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
index a311d0c..4d8eff6 100644
--- a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
+++ b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
@@ -531,12 +531,26 @@ SCSIBusDriverBindingStop (
// Close the bus driver
//
if (ScsiBusDev->ExtScsiSupport) {
+ //
+ // Close ExtPassThru Protocol from this controller handle
+ //
gBS->CloseProtocol (
Controller,
&gEfiExtScsiPassThruProtocolGuid,
This->DriverBindingHandle,
Controller
);
+ //
+ // When Start() succeeds to open ExtPassThru, it always tries to open PassThru BY_DRIVER.
+ // Its intent is to prevent another SCSI Bus Driver from woking on the same host handle.
+ // So Stop() needs to try to close PassThru if present here.
+ //
+ gBS->CloseProtocol (
+ Controller,
+ &gEfiScsiPassThruProtocolGuid,
+ This->DriverBindingHandle,
+ Controller
+ );
} else {
gBS->CloseProtocol (
Controller,