MdeModulePkg/NvmExpressDxe: Notify NVME HW when system reset happens
authorRuiyu Ni <ruiyu.ni@intel.com>
Fri, 4 Aug 2017 09:07:31 +0000 (17:07 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Wed, 9 Aug 2017 07:59:13 +0000 (15:59 +0800)
commit7111e46fdebca0e03f6ddfcb029522c2fe68c74b
tree4db6f365ba6e43a6d6fb1bfb020e00cb6c447856
parenta607eb97ef92605d88ac72e551bae34da7c81394
MdeModulePkg/NvmExpressDxe: Notify NVME HW when system reset happens

Per NVM Express Spec, software should notify NVME HW when shutdown
occurs.

The NVME controller requires notification for shutdown as part of
its management of internal structures. Even with FUA, failing to
notify the NVME controller to shutdown power off causes the NVME
controller to take quite some time to organize its tables on the
next power on. This time exceeds the normal timeout, so we would
fail to boot the NVME disk.

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.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.h
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c