From 1e5914b54aa25ac3c6ad4e8b2a8a1573765d2759 Mon Sep 17 00:00:00 2001 From: eric_tian Date: Thu, 19 Mar 2009 07:03:01 +0000 Subject: 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 --- MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'MdeModulePkg/Bus') diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c index a311d0cd2c..4d8eff6eee 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, -- cgit v1.2.3