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.27510.1682616987268069231 for ; Thu, 27 Apr 2023 10:36:27 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=ciH0QO/0; 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.1.171]) by linux.microsoft.com (Postfix) with ESMTPSA id D52C421C33E2; Thu, 27 Apr 2023 10:36:26 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com D52C421C33E2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1682616986; bh=fkmd7SInZiCXmbpI/PjG9BktMCp2Lx9QIFxqWN/t2xw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ciH0QO/0UMXNvLwQOafej4CBDq1bBoY9Grj+UbUpo3gqtZ4bvRo7pVqCLiSkPzOz9 w8OPSthOUxAcJIMkOJQqTdjK0KcIeg+zDeR1SE5IjqbkMn0zG2f2iDLQoM7wdn+AZ1 05xypxE1oK+XvEt9gaITXS7uCYM4PJq+Q4i6lDRA= 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 v2 2/2] Add volatile keyword to NvmExpressPei's Passthru CQ Date: Thu, 27 Apr 2023 10:36:22 -0700 Message-Id: <20230427173622.10614-3-osde@linux.microsoft.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230427173622.10614-1-osde@linux.microsoft.com> References: <20230427173622.10614-1-osde@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable This applies the volatile keyword and appropriate casts to the NvmExpressPei's Passthru CQ. Cc: Hao A Wu Cc: Ray Ni Cc: Jian J Wang Cc: Liming Gao Cc: Michael Kubacki Cc: Sean Brogan Signed-off-by: Oliver Smith-Denny --- MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c b= /MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c index 5081b53cd5e8..ac9328047fef 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c @@ -115,7 +115,7 @@ NvmeCreatePrpList ( **/ EFI_STATUS NvmeCheckCqStatus ( - IN NVME_CQ *Cq + IN volatile NVME_CQ *Cq ) { if ((Cq->Sct =3D=3D 0x0) && (Cq->Sc =3D=3D 0x0)) { @@ -344,7 +344,7 @@ NvmePassThruExecute ( { EFI_STATUS Status; NVME_SQ *Sq; - NVME_CQ *Cq; + volatile NVME_CQ *Cq; UINT8 QueueId; UINTN SqSize; UINTN CqSize; @@ -617,7 +617,7 @@ NvmePassThruExecute ( // // Copy the Respose Queue entry for this command to the callers respon= se buffer // - CopyMem (Packet->NvmeCompletion, Cq, sizeof (EFI_NVM_EXPRESS_COMPLETIO= N)); + CopyMem (Packet->NvmeCompletion, (VOID *)Cq, sizeof (EFI_NVM_EXPRESS_C= OMPLETION)); =20 // // Check the NVMe cmd execution result --=20 2.40.0