From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B64191A1E56 for ; Wed, 31 Aug 2016 19:33:24 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP; 31 Aug 2016 19:33:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,264,1470726000"; d="scan'208";a="3388806" Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.34]) by orsmga005.jf.intel.com with ESMTP; 31 Aug 2016 19:33:23 -0700 From: Hao Wu To: edk2-devel@lists.01.org, feng.tian@intel.com Cc: Hao Wu Date: Thu, 1 Sep 2016 10:33:06 +0800 Message-Id: <1472697187-16092-10-git-send-email-hao.a.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.0 In-Reply-To: <1472697187-16092-1-git-send-email-hao.a.wu@intel.com> References: <1472697187-16092-1-git-send-email-hao.a.wu@intel.com> Subject: [PATCH v2 09/10] MdeModulePkg NvmExpressDxe: Fix 'Event' won't be signaled for Admin cmds X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2016 02:33:24 -0000 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 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu --- MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c index 96e9d88..2c30009 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 ( -- 1.9.5.msysgit.0