MdeModulePkg/NvmExpressDxe: Report StatusCode for device init failure

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1408

According to the information of the above BZ-1408 and other platform
owners, NVM Express devices are becoming more likely to be a critical
part during the boot process.

This commit will add the calls to 'REPORT_STATUS_CODE' when there is a
failure happens during the NVM Express controller/device initialization
process.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <brbarkel@microsoft.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
Sean Brogan
2019-02-11 15:57:26 +08:00
committed by Hao Wu
parent c0959b4426
commit 63d8431a49
3 changed files with 13 additions and 3 deletions

View File

@ -2,7 +2,7 @@
NvmExpressDxe driver is used to manage non-volatile memory subsystem which follows
NVM Express specification.
Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2013 - 2019, 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
@ -379,6 +379,10 @@ NvmeDisableController (
if (Index == 0) {
Status = EFI_DEVICE_ERROR;
REPORT_STATUS_CODE (
(EFI_ERROR_CODE | EFI_ERROR_MAJOR),
(EFI_IO_BUS_SCSI | EFI_IOB_EC_INTERFACE_ERROR)
);
}
DEBUG ((EFI_D_INFO, "NVMe controller is disabled with status [%r].\n", Status));
@ -449,6 +453,10 @@ NvmeEnableController (
if (Index == 0) {
Status = EFI_TIMEOUT;
REPORT_STATUS_CODE (
(EFI_ERROR_CODE | EFI_ERROR_MAJOR),
(EFI_IO_BUS_SCSI | EFI_IOB_EC_INTERFACE_ERROR)
);
}
DEBUG ((EFI_D_INFO, "NVMe controller is enabled with status [%r].\n", Status));