From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.54078.1681947672146615853 for ; Wed, 19 Apr 2023 16:41:12 -0700 Authentication-Results: mx.groups.io; dkim=fail, err=malformed MIME header line: Subject: [edk2-devel][PATCH v1 1/2] Add the volatile keyword to NvmExpressDxe's Passthru CQs and SQs.; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: osde@linux.microsoft.com) Received: from OSD-Desktop.redmond.corp.microsoft.com (unknown [131.107.159.171]) by linux.microsoft.com (Postfix) with ESMTPSA id 75F6B21C205A; Wed, 19 Apr 2023 16:41:11 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 75F6B21C205A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1681947671; bh=yUsWK+WASwEAxKGxBlarJKC/lodv2oCGO6bFMLjMnqU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A9v2wTrgs/2xdc6XBjF7DCyrChep46YMPy+iZ2n+TVLjvffT/SCSn3VygZYXf4Edo gvy+CFMFV4P2G13RgUpKx07ywCKAs1q85927Y8lFkO7D8H+QA7U9Vngoq1Dw932XO7 30dptzCQb4Kx/solPy93aDPau4HfNAdjmAXGLlr8= From: "Oliver Smith-Denny" To: devel@edk2.groups.io Cc: Hao A Wu , Ray Ni , Jian J Wang , Liming Gao , Michael Kubacki , Sean Brogan Subject: [edk2-devel][PATCH v1 1/2] Add the volatile keyword to NvmExpressDxe's Passthru CQs and SQs. Date: Wed, 19 Apr 2023 16:41:07 -0700 Message-Id: <20230419234108.10243-2-osde@linux.microsoft.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230419234108.10243-1-osde@linux.microsoft.com> References: <20230419234108.10243-1-osde@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable This updates the relevant functions that expect a non-volatile=0D structure to be passed to them to take casts of the CQ and SQ,=0D now that they are volatile.=0D =0D Cc: Hao A Wu =0D Cc: Ray Ni =0D Cc: Jian J Wang =0D Cc: Liming Gao =0D Cc: Michael Kubacki =0D Cc: Sean Brogan =0D Signed-off-by: Oliver Smith-Denny =0D ---=0D MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c | 10 +++++-----=0D 1 file changed, 5 insertions(+), 5 deletions(-)=0D =0D diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c b/MdeM= odulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c=0D index f37baa626a16..1a7e39500ac0 100644=0D --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c=0D +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c=0D @@ -459,8 +459,8 @@ NvmExpressPassThru (=0D EFI_STATUS Status;=0D EFI_STATUS PreviousStatus;=0D EFI_PCI_IO_PROTOCOL *PciIo;=0D - NVME_SQ *Sq;=0D - NVME_CQ *Cq;=0D + volatile NVME_SQ *Sq;=0D + volatile NVME_CQ *Cq;=0D UINT16 QueueId;=0D UINT16 QueueSize;=0D UINT32 Bytes;=0D @@ -581,7 +581,7 @@ NvmExpressPassThru (=0D return EFI_INVALID_PARAMETER;=0D }=0D =0D - ZeroMem (Sq, sizeof (NVME_SQ));=0D + ZeroMem ((VOID *)Sq, sizeof (NVME_SQ));=0D Sq->Opc =3D (UINT8)Packet->NvmeCmd->Cdw0.Opcode;=0D Sq->Fuse =3D (UINT8)Packet->NvmeCmd->Cdw0.FusedOperation;=0D Sq->Cid =3D Private->Cid[QueueId]++;=0D @@ -815,14 +815,14 @@ NvmExpressPassThru (=0D // Dump every completion entry status for debugging.=0D //=0D DEBUG_CODE_BEGIN ();=0D - NvmeDumpStatus (Cq);=0D + NvmeDumpStatus ((NVME_CQ *)Cq);=0D DEBUG_CODE_END ();=0D }=0D =0D //=0D // Copy the Respose Queue entry for this command to the callers respon= se buffer=0D //=0D - CopyMem (Packet->NvmeCompletion, Cq, sizeof (EFI_NVM_EXPRESS_COMPLETIO= N));=0D + CopyMem (Packet->NvmeCompletion, (VOID *)Cq, sizeof (EFI_NVM_EXPRESS_C= OMPLETION));=0D } else {=0D //=0D // Timeout occurs for an NVMe command. Reset the controller to abort t= he=0D -- =0D 2.39.2=0D =0D