summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Bus
diff options
context:
space:
mode:
authorSean Brogan <sean.brogan@microsoft.com>2019-02-11 15:57:26 +0800
committerHao Wu <hao.a.wu@intel.com>2019-02-13 11:31:09 +0800
commit63d8431a49cb5a900406e8d09a5dd10080dc818e (patch)
treed95e02a1be0fed6974a05418eca2a803fdf05f83 /MdeModulePkg/Bus
parentc0959b4426b2da45cdb8146a5116bb4fd9b86534 (diff)
downloadedk2-63d8431a49cb5a900406e8d09a5dd10080dc818e.tar.gz
edk2-63d8431a49cb5a900406e8d09a5dd10080dc818e.tar.bz2
edk2-63d8431a49cb5a900406e8d09a5dd10080dc818e.zip
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>
Diffstat (limited to 'MdeModulePkg/Bus')
-rw-r--r--MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.h3
-rw-r--r--MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf3
-rw-r--r--MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c10
3 files changed, 13 insertions, 3 deletions
diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.h b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.h
index fe7d37c118..dcc848e930 100644
--- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.h
+++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.h
@@ -3,7 +3,7 @@
NVM Express specification.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
- 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
@@ -45,6 +45,7 @@
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiDriverEntryPoint.h>
+#include <Library/ReportStatusCodeLib.h>
typedef struct _NVME_CONTROLLER_PRIVATE_DATA NVME_CONTROLLER_PRIVATE_DATA;
typedef struct _NVME_DEVICE_PRIVATE_DATA NVME_DEVICE_PRIVATE_DATA;
diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
index 38d793645b..4f888c49fb 100644
--- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
@@ -4,7 +4,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
@@ -59,6 +59,7 @@
UefiBootServicesTableLib
UefiLib
PrintLib
+ ReportStatusCodeLib
[Protocols]
gEfiPciIoProtocolGuid ## TO_START
diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
index 4a070f3f13..90ad22b539 100644
--- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
+++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
@@ -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));