diff options
author | Hao Wu <hao.a.wu@intel.com> | 2016-09-01 10:17:43 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2016-09-06 15:31:43 +0800 |
commit | aec53afb83893dc3ebb971ab5a714e276a81ff62 (patch) | |
tree | 95630c1b70a024c6fa5b9fd4dd5ebf1adcb99c9e /MdeModulePkg/Bus | |
parent | 80b405a64283b5adfd53b4f4fa48128c58422265 (diff) | |
download | edk2-platforms-aec53afb83893dc3ebb971ab5a714e276a81ff62.tar.xz |
MdeModulePkg NvmExpressDxe: Fix 'Event' won't be signaled for Admin cmds
This commit fixes the issue that the caller event passed to
EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL.PassThru() will not be signaled for
NVME Admin commands.
Cc: Feng Tian <feng.tian@intel.com>
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>
Diffstat (limited to 'MdeModulePkg/Bus')
-rw-r--r-- | MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c index 96e9d88e52..2c30009945 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c @@ -596,7 +596,7 @@ NvmExpressPassThru ( //
// Ring the submission queue doorbell.
//
- if (Event != NULL) {
+ if ((Event != NULL) && (QueueId != 0)) {
Private->SqTdbl[QueueId].Sqt =
(Private->SqTdbl[QueueId].Sqt + 1) % (NVME_ASYNC_CSQ_SIZE + 1);
} else {
@@ -616,7 +616,7 @@ NvmExpressPassThru ( // For non-blocking requests, return directly if the command is placed
// in the submission queue.
//
- if (Event != NULL) {
+ if ((Event != NULL) && (QueueId != 0)) {
AsyncRequest = AllocateZeroPool (sizeof (NVME_PASS_THRU_ASYNC_REQ));
if (AsyncRequest == NULL) {
Status = EFI_DEVICE_ERROR;
@@ -699,6 +699,15 @@ NvmExpressPassThru ( &Data
);
+ //
+ // For now, the code does not support the non-blocking feature for admin queue.
+ // If Event is not NULL for admin queue, signal the caller's event here.
+ //
+ if (Event != NULL) {
+ ASSERT (QueueId == 0);
+ gBS->SignalEvent (Event);
+ }
+
EXIT:
if (MapData != NULL) {
PciIo->Unmap (
|