Revision: 19468
          http://sourceforge.net/p/edk2/code/19468
Author:   hwu1225
Date:     2015-12-23 01:35:47 +0000 (Wed, 23 Dec 2015)
Log Message:
-----------
MdeModulePkg ScsiBusDxe: Only signal caller event when PassThru() succeeds

In ScsiExecuteSCSICommand(), when SCSI devices do not support non-blocking
I/O but an event is passed from caller (UefiScsiLib), the function will
execute the SCSI I/O command in a blocking manner and signal the caller
event when the command completes.

Originally, caller event from UefiScsiLib will be signaled if the SCSI
command fails. UefiScsiLib will continue to signal its caller (BlockIO2
request from ScsiDiskDxe driver), which is not aligned with the UEFI spec
that event will not be signaled when BlockIO2 request returns with error.

This commit will signal ScsiExecuteSCSICommand()'s caller event only when
the SCSI command succeeds.

(Sync patch r19447 from main trunk.)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <[email protected]>
Reviewed-by: Feng Tian <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/19447

Modified Paths:
--------------
    branches/UDK2015/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c

Modified: branches/UDK2015/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
===================================================================
--- branches/UDK2015/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c 2015-12-23 
01:35:24 UTC (rev 19467)
+++ branches/UDK2015/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c 2015-12-23 
01:35:47 UTC (rev 19468)
@@ -1007,9 +1007,10 @@
                                                 ExtRequestPacket,
                                                 NULL
                                                 );
-      if (Event != NULL) {
+      if ((!EFI_ERROR(Status)) && (Event != NULL)) {
         //
-        // Signal Event to tell caller to pick up the SCSI IO Packet.
+        // Signal Event to tell caller to pick up the SCSI IO packet if the
+        // PassThru() succeeds.
         //
         gBS->SignalEvent (Event);
       }


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to