]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg NvmExpressDxe: Ensure write-through for NVMe write command
authorHao Wu <hao.a.wu@intel.com>
Fri, 25 Mar 2016 01:46:58 +0000 (09:46 +0800)
committerHao Wu <hao.a.wu@intel.com>
Mon, 18 Apr 2016 01:09:33 +0000 (09:09 +0800)
Set the Force Unit Access (FUA) bit in NVMe Write - Command Dword 12 to
ensure write-through behavior.

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>
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c

index 5ac90745bde15ec72761caa2667e840af4125865..92d7d923df437cb8c6f998a2aa627464deac943f 100644 (file)
@@ -127,7 +127,10 @@ WriteSectors (
 \r
   CommandPacket.NvmeCmd->Cdw10 = (UINT32)Lba;\r
   CommandPacket.NvmeCmd->Cdw11 = (UINT32)RShiftU64(Lba, 32);\r
 \r
   CommandPacket.NvmeCmd->Cdw10 = (UINT32)Lba;\r
   CommandPacket.NvmeCmd->Cdw11 = (UINT32)RShiftU64(Lba, 32);\r
-  CommandPacket.NvmeCmd->Cdw12 = (Blocks - 1) & 0xFFFF;\r
+  //\r
+  // Set Force Unit Access bit (bit 30) to use write-through behaviour\r
+  //\r
+  CommandPacket.NvmeCmd->Cdw12 = ((Blocks - 1) & 0xFFFF) | BIT30;\r
 \r
   CommandPacket.MetadataBuffer = NULL;\r
   CommandPacket.MetadataLength = 0;\r
 \r
   CommandPacket.MetadataBuffer = NULL;\r
   CommandPacket.MetadataLength = 0;\r