summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2015-12-23 01:37:50 +0000
committerhwu1225 <hwu1225@Edk2>2015-12-23 01:37:50 +0000
commit995e33bedcadf2d193085bdf2889ea651b1a6abe (patch)
tree89db4a25aacfa75298b97a348ca2a4f9a24067dc /MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
parent8a3c29386ac147670dda1a2d772a3d90cfad70ef (diff)
downloadedk2-platforms-995e33bedcadf2d193085bdf2889ea651b1a6abe.tar.xz
MdeModulePkg ScsiDiskDxe: Raise the Tpl of async IO callback to TPL_NOTIFY
When reading data from non-blockingly from a CD-ROM logic partition, the procedure can be shown by the following call stack: (The write process is similar) |-------------------| | DiskIoDxe (logic) |<---Raise Tpl to TPL_CALLBACK |-------------------| | | Sub-task 1 (UnderRun) succeeds | | |-----------------| |-----------------| |-----------------| +--->| PartitionDxe |---->| DiskIoDxe (Phy) |---->| ScsiDiskDxe | | |-----------------| |-----------------| |-----------------| | | Sub-task 2 (OverRun) fails | | |-----------------| |-----------------| |-----------------| +--->| PartitionDxe |---->| DiskIoDxe (Phy) |---->| ScsiDiskDxe | | |-----------------| |-----------------| |-----------------| | ^ | | More subtasks... Wait indefinitely | |<---Restore Tpl | Completes In PartitionDxe, if the 'Lba' and 'BufferSize' parameters passed to function PartitionReadBlocksEx() are invalid, the function will issue a blocking ReadDisk call (in function ProbeMediaStatusEx()). In DiskIoDxe, blocking I/O request will wait for all the non-blocking I/O requests to complete first before sending down the blocking request. If the Tpl of the async I/O callback in ScsiDiskDxe is TPL_CALLBACK and Sub-task 1 (UnderRun) succeeds but Sub-task 2 (OverRun) fails with an invalid parameter, DiskIoDxe will wait indefinitely for the event created by ScsiDiskDxe of Sub-task 1 to signal. Hence, this commit will raise the Tpl of async IO callback in ScsiDiskDxe to TPL_NOTIFY so that the indefinite wait in DiskIoDxe can be avoided. (Sync patch r19452 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@19473 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h')
-rw-r--r--MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
index 7a287d3bb3..2406df51b8 100644
--- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
+++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
@@ -98,7 +98,13 @@ typedef struct {
typedef struct {
EFI_BLOCK_IO2_TOKEN *Token;
//
- // The queue for Scsi Read/Write requests of a BlockIo2
+ // The flag indicates if the last Scsi Read/Write sub-task for a BlockIo2
+ // request is sent to device
+ //
+ BOOLEAN LastScsiRW;
+
+ //
+ // The queue for Scsi Read/Write sub-tasks of a BlockIo2 request
//
LIST_ENTRY ScsiRWQueue;