summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2015-12-23 01:35:47 +0000
committerhwu1225 <hwu1225@Edk2>2015-12-23 01:35:47 +0000
commita14f95dc9eb8490cf2e3eb4f0645008383e7f4c3 (patch)
tree64a435740eb12b56730f6a2e7158a8f6457ff9d6
parent1a77164911aaf60d45d00caab421e2a7587deaa1 (diff)
downloadedk2-platforms-a14f95dc9eb8490cf2e3eb4f0645008383e7f4c3.tar.xz
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 <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19468 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
index 8eb73e7673..b10e25a38e 100644
--- a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
+++ b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
@@ -1007,9 +1007,10 @@ ScsiExecuteSCSICommand (
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);
}