]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/NvmExpressDxe: Report StatusCode for device init failure
authorSean Brogan <sean.brogan@microsoft.com>
Mon, 11 Feb 2019 07:57:26 +0000 (15:57 +0800)
committerHao Wu <hao.a.wu@intel.com>
Wed, 13 Feb 2019 03:31:09 +0000 (11:31 +0800)
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>
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.h
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c

index fe7d37c118062cee810e024a12e497959d6ddabf..dcc848e930ea3b0439cb2c341a3b02f581390ed1 100644 (file)
@@ -3,7 +3,7 @@
   NVM Express specification.\r
 \r
   (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
   NVM Express specification.\r
 \r
   (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
-  Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -45,6 +45,7 @@
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
+#include <Library/ReportStatusCodeLib.h>\r
 \r
 typedef struct _NVME_CONTROLLER_PRIVATE_DATA NVME_CONTROLLER_PRIVATE_DATA;\r
 typedef struct _NVME_DEVICE_PRIVATE_DATA     NVME_DEVICE_PRIVATE_DATA;\r
 \r
 typedef struct _NVME_CONTROLLER_PRIVATE_DATA NVME_CONTROLLER_PRIVATE_DATA;\r
 typedef struct _NVME_DEVICE_PRIVATE_DATA     NVME_DEVICE_PRIVATE_DATA;\r
index 38d793645b915e044ed275da0ed476989b29d891..4f888c49fb0d4e21579159a94b0c28047966edb2 100644 (file)
@@ -4,7 +4,7 @@
 #  NvmExpressDxe driver is used to manage non-volatile memory subsystem which follows\r
 #  NVM Express specification.\r
 #\r
 #  NvmExpressDxe driver is used to manage non-volatile memory subsystem which follows\r
 #  NVM Express specification.\r
 #\r
-#  Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -59,6 +59,7 @@
   UefiBootServicesTableLib\r
   UefiLib\r
   PrintLib\r
   UefiBootServicesTableLib\r
   UefiLib\r
   PrintLib\r
+  ReportStatusCodeLib\r
 \r
 [Protocols]\r
   gEfiPciIoProtocolGuid                       ## TO_START\r
 \r
 [Protocols]\r
   gEfiPciIoProtocolGuid                       ## TO_START\r
index 4a070f3f13367e669e1cb6eb3a8c471490ca7f7e..90ad22b5390fb16dc209ea3355ea3a708fc1ba8d 100644 (file)
@@ -2,7 +2,7 @@
   NvmExpressDxe driver is used to manage non-volatile memory subsystem which follows\r
   NVM Express specification.\r
 \r
   NvmExpressDxe driver is used to manage non-volatile memory subsystem which follows\r
   NVM Express specification.\r
 \r
-  Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2013 - 2019, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -379,6 +379,10 @@ NvmeDisableController (
 \r
   if (Index == 0) {\r
     Status = EFI_DEVICE_ERROR;\r
 \r
   if (Index == 0) {\r
     Status = EFI_DEVICE_ERROR;\r
+    REPORT_STATUS_CODE (\r
+      (EFI_ERROR_CODE | EFI_ERROR_MAJOR),\r
+      (EFI_IO_BUS_SCSI | EFI_IOB_EC_INTERFACE_ERROR)\r
+      );\r
   }\r
 \r
   DEBUG ((EFI_D_INFO, "NVMe controller is disabled with status [%r].\n", Status));\r
   }\r
 \r
   DEBUG ((EFI_D_INFO, "NVMe controller is disabled with status [%r].\n", Status));\r
@@ -449,6 +453,10 @@ NvmeEnableController (
 \r
   if (Index == 0) {\r
     Status = EFI_TIMEOUT;\r
 \r
   if (Index == 0) {\r
     Status = EFI_TIMEOUT;\r
+    REPORT_STATUS_CODE (\r
+      (EFI_ERROR_CODE | EFI_ERROR_MAJOR),\r
+      (EFI_IO_BUS_SCSI | EFI_IOB_EC_INTERFACE_ERROR)\r
+      );\r
   }\r
 \r
   DEBUG ((EFI_D_INFO, "NVMe controller is enabled with status [%r].\n", Status));\r
   }\r
 \r
   DEBUG ((EFI_D_INFO, "NVMe controller is enabled with status [%r].\n", Status));\r