diff options
author | Hao Wu <hao.a.wu@intel.com> | 2016-03-25 09:46:58 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2016-04-18 09:09:33 +0800 |
commit | 60cfeeb3b656e746f98620cb99a971ee6310b028 (patch) | |
tree | 971085caa69f8749d8fe90ba8ed8ad2d508aaef5 /MdeModulePkg/Bus | |
parent | 619e6cf19fa1ab98878972e109d0c579f37388cd (diff) | |
download | edk2-platforms-60cfeeb3b656e746f98620cb99a971ee6310b028.tar.xz |
MdeModulePkg NvmExpressDxe: Ensure write-through for NVMe write command
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>
Diffstat (limited to 'MdeModulePkg/Bus')
-rw-r--r-- | MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c index 5ac90745bd..92d7d923df 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c @@ -127,7 +127,10 @@ WriteSectors ( CommandPacket.NvmeCmd->Cdw10 = (UINT32)Lba;
CommandPacket.NvmeCmd->Cdw11 = (UINT32)RShiftU64(Lba, 32);
- CommandPacket.NvmeCmd->Cdw12 = (Blocks - 1) & 0xFFFF;
+ //
+ // Set Force Unit Access bit (bit 30) to use write-through behaviour
+ //
+ CommandPacket.NvmeCmd->Cdw12 = ((Blocks - 1) & 0xFFFF) | BIT30;
CommandPacket.MetadataBuffer = NULL;
CommandPacket.MetadataLength = 0;
|