Just for curiosity, I checked the NVME spec for the purpose of a shutdown
notification to the controller when there is a power-off for the device. And
found the following:
1. Will increase the field 'Unsafe Shutdowns' in the SMART/Health Information
data (Section 188.8.131.52).
2. Subsequent reads for locations written to the volatile write cache that were
not written to non-volatile storage may return older data. (Section 184.108.40.206)
For 2, the implementation of the NVME driver always sets the Force Unit
Access (FUA) bit for write operations. Hence, the read operation will reflect
the latest data on device.
So missing the shutdown notification will increase the number of 'Unsafe
Shutdowns' tracked by the controller. Is there any other issue being introduced
by missing the notification?
Besides, the change is good for me.
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ruiyu
> Sent: Monday, August 07, 2017 11:32 AM
> To: email@example.com
> Subject: [edk2] [PATCH 0/2] Notify NVME HW when system reset happens
> Per NVM Express Spec, software should notify NVME HW when shutdown
> The host should set the Shutdown Notification (CC.SHN) field to 01b
> to indicate a normal shutdown operation. The controller indicates
> when shutdown processing is completed by updating the Shutdown Status
> (CSTS.SHST) field to 10b.
> Ruiyu Ni (2):
> MdePkg/Nvme: Add NVME shutdown notification related macros
> MdeModulePkg/NvmExpressDxe: Notify NVME HW when system reset
> MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c | 7 +-
> MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.h | 23 ++-
> .../Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf | 3 +-
> MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 181
> MdePkg/Include/IndustryStandard/Nvme.h | 6 +-
> 5 files changed, 215 insertions(+), 5 deletions(-)
> edk2-devel mailing list
edk2-devel mailing list