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>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
NvmExpressDxe driver is used to manage non-volatile memory subsystem which follows
|
||||
NVM Express specification.
|
||||
|
||||
Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -1046,6 +1046,8 @@ NvmExpressDriverBindingStart (
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
NvmeRegisterShutdownNotification ();
|
||||
} else {
|
||||
Status = gBS->OpenProtocol (
|
||||
Controller,
|
||||
@@ -1239,6 +1241,9 @@ NvmExpressDriverBindingStop (
|
||||
This->DriverBindingHandle,
|
||||
Controller
|
||||
);
|
||||
|
||||
NvmeUnregisterShutdownNotification ();
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user