* [PATCH v1 0/1] MdeModulePkg/NvmExpressDxe: Report StatusCode for device init failure
@ 2019-02-11 0:05 Hao Wu
2019-02-11 0:05 ` [PATCH v1 1/1] " Hao Wu
0 siblings, 1 reply; 4+ messages in thread
From: Hao Wu @ 2019-02-11 0:05 UTC (permalink / raw)
To: edk2-devel; +Cc: Hao Wu, Sean Brogan, Bret Barkelew, Jian J Wang, Ray Ni
This patch is also available at:
https://github.com/hwu25/edk2/tree/nvme_status_code
Please refer to the log message of the patch for more details.
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <brbarkel@microsoft.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Sean Brogan (1):
MdeModulePkg/NvmExpressDxe: Report StatusCode for device init failure
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf | 3 ++-
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.h | 3 ++-
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 10 +++++++++-
3 files changed, 13 insertions(+), 3 deletions(-)
--
2.12.0.windows.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v1 1/1] MdeModulePkg/NvmExpressDxe: Report StatusCode for device init failure
2019-02-11 0:05 [PATCH v1 0/1] MdeModulePkg/NvmExpressDxe: Report StatusCode for device init failure Hao Wu
@ 2019-02-11 0:05 ` Hao Wu
0 siblings, 0 replies; 4+ messages in thread
From: Hao Wu @ 2019-02-11 0:05 UTC (permalink / raw)
To: edk2-devel; +Cc: Sean Brogan, Bret Barkelew, Jian J Wang, Ray Ni, Hao Wu
From: Sean Brogan <sean.brogan@microsoft.com>
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>
Cc: Ray Ni <ray.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
---
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf | 3 ++-
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.h | 3 ++-
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 10 +++++++++-
3 files changed, 13 insertions(+), 3 deletions(-)
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/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/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));
--
2.12.0.windows.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v4 00/13] Split the S3 PEI phase HW init codes from Opal driver
@ 2019-02-11 7:57 Hao Wu
2019-02-11 7:57 ` [PATCH v1 1/1] MdeModulePkg/NvmExpressDxe: Report StatusCode for device init failure Hao Wu
0 siblings, 1 reply; 4+ messages in thread
From: Hao Wu @ 2019-02-11 7:57 UTC (permalink / raw)
To: edk2-devel
Cc: Hao Wu, Jian J Wang, Ray Ni, Eric Dong, Star Zeng, Chao Zhang,
Jiewen Yao, Laszlo Ersek
The series is also available at:
https://github.com/hwu25/edk2/tree/opal_remodel_v4
V4 changes:
As suggested by Laszlo, add a new patch to sync the API description
comment for UpdateLockBox() in file
"OvmfPkg/Library/LockBoxLib/LockBoxLib.c" with its counterparts in
MdeModulePkg.
For patch 13 (compared with patch 12 in V3), minor type refinement in
structure definition 'OPAL_DEVICE_LOCKBOX_DATA'.
V3 history:
For patch 2, reuse the definitions within AtaPassThru protocol header file
to reduce code duplication.
For patch 4, add detailed comments to illustrate the content that will be
stored in the newly introduced LockBox.
For patch 6, device path validity check refinement within function
NvmeCheckHcDevicePath().
For patch 7:
* Remove a redundant check within function NvmeS3SkipThisController();
* Replace internal implementation of GetNextDevicePathInstance() with
GetDevicePathInstanceSize(), which avoids unnecessary memory allocation.
For patch 8:
* Device path validity check refinement within function
AhciCheckHcDevicePath();
* Remove a redundant check within function AhciS3GetEumeratePorts();
* Replace internal implementation of GetNextDevicePathInstance() with
GetDevicePathInstanceSize(), which avoids unnecessary memory allocation.
For patch 11:
* Remove the ASSERT() for memory allocation failure. Since error handling
codes already exist, no new code is added for this;
* Refine the codes to only allocate new SMM buffer when the required
LockBox size is greater than the size of origin pages allocated;
* Add additional parameter check for 'Offset' & 'Length' to prevent
potential numeric overflow.
V2 history:
For patch 8, the new series removes the codes to produce the Block IO PPIs
from the AhciPei driver.
The task to produce the Block IO services is out of the scope of BZ-1409
(actually covered by BZ-1483). And we will later propose seperate patch(s)
to address this.
V1 history:
For the below 2 types of storage device:
1. NVM Express devices;
2. ATA hard disk devices working under AHCI mode.
the OpalPassword driver supports auto-unlocking those devices during S3
resume.
Current implementation of the OpalPassword driver is handling the device
initialization (using boot script to restore the host controller PCI
configuration space also counts) in the PEI phase during S3 resume by
itself.
Meanwhile, the NvmExpressPei driver in MdeModulePkg also handles the NVME
device initialization during the PEI phase in order to produce the Block
IO PPI.
Moreover, there is a Bugzilla request (BZ-1483) for adding the Block IO
PPI support for ATA device as well. So there is likely to be an PEI driver
for ATA device that will handle the ATA device initialization.
In order to remove code duplication, the series will split the S3 phase
device initialization related codes out from the OpalPassword driver. And
let the existing NvmExpressPei driver and the new AhciPei driver to handle
the task.
After this remodel, NvmExpressPei and AhciPei drivers will produce a PPI
called Storage Security Command PPI. And the OpalPassword driver will
consume this PPI to perform the device auto-unlock in S3 resume.
Patch 1~4: Add the definitions of PPIs and GUIDs;
Patch 5: Refinement for the NvmExpressPei driver;
Patch 6~7: Update the NvmExpressPei driver to produce the PPI needed by
OpalPassword;
Patch 8: Add the Ahci mode ATA device support in the PEI phase, it
will produce the PPI needed by OpalPassword;
Patch 9~10: Refinements for the SmmLockBoxLib;
Patch 11: Support LockBox enlarge for LockBoxLib API UpdateLockBox();
Patch 12: Remove the hardware initialization codes from the
OpalPassword driver. And consume the SSC PPI to unlock device
in S3 resume.
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Hao Wu (12):
MdeModulePkg: Add definitions for ATA AHCI host controller PPI
MdeModulePkg: Add definitions for EDKII PEI ATA PassThru PPI
MdeModulePkg: Add definitions for Storage Security Command PPI
MdeModulePkg: Add GUID for LockBox to save storage dev to init in S3
MdeModulePkg/NvmExpressPei: Avoid updating the module-level variable
MdeModulePkg/NvmExpressPei: Add logic to produce SSC PPI
MdeModulePkg/NvmExpressPei: Consume S3StorageDeviceInitList LockBox
MdeModulePkg/AhciPei: Add AHCI mode ATA device support in PEI
MdeModulePkg/SmmLockBoxLib: Use 'DEBUG_' prefix instead of 'EFI_D_'
MdeModulePkg/SmmLockBox(PEI): Remove an ASSERT in RestoreLockBox()
MdeModulePkg/SmmLockBoxLib: Support LockBox enlarge in UpdateLockBox()
OvmfPkg/LockBoxLib: Update the comments for API UpdateLockBox()
SecurityPkg/OpalPassword: Remove HW init codes and consume SSC PPI
MdeModulePkg/MdeModulePkg.dec | 12 +
MdeModulePkg/MdeModulePkg.dsc | 1 +
MdeModulePkg/Bus/Ata/AhciPei/AhciPei.inf | 74 +
MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.inf | 18 +-
SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordDxe.inf | 6 +-
SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.inf | 12 +-
MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h | 708 +++++++
MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.h | 184 ++
MdeModulePkg/Bus/Ata/AhciPei/AhciPeiStorageSecurity.h | 247 +++
MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.h | 106 +-
MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiHci.h | 20 +-
MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiStorageSecurity.h | 247 +++
MdeModulePkg/Include/Guid/S3StorageDeviceInitList.h | 64 +
MdeModulePkg/Include/Library/LockBoxLib.h | 7 +-
MdeModulePkg/Include/Ppi/AtaAhciController.h | 89 +
MdeModulePkg/Include/Ppi/AtaPassThru.h | 219 +++
MdeModulePkg/Include/Ppi/StorageSecurityCommand.h | 283 +++
SecurityPkg/Tcg/Opal/OpalPassword/OpalAhciMode.h | 412 ----
SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.h | 4 +-
SecurityPkg/Tcg/Opal/OpalPassword/OpalNvmeMode.h | 327 ----
SecurityPkg/Tcg/Opal/OpalPassword/OpalNvmeReg.h | 815 --------
SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordCommon.h | 45 +-
SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.h | 106 +-
MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c | 2015 ++++++++++++++++++++
MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c | 304 +++
MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.c | 521 +++++
MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c | 139 ++
MdeModulePkg/Bus/Ata/AhciPei/AhciPeiStorageSecurity.c | 391 ++++
MdeModulePkg/Bus/Ata/AhciPei/DevicePath.c | 284 +++
MdeModulePkg/Bus/Ata/AhciPei/DmaMem.c | 270 +++
MdeModulePkg/Bus/Pci/NvmExpressPei/DevicePath.c | 284 +++
MdeModulePkg/Bus/Pci/NvmExpressPei/DmaMem.c | 153 +-
MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c | 166 +-
MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiHci.c | 32 +-
MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiS3.c | 114 ++
MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiStorageSecurity.c | 423 ++++
MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.c | 7 +-
MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxDxeLib.c | 27 +-
MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c | 32 +-
MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxSmmLib.c | 148 +-
OvmfPkg/Library/LockBoxLib/LockBoxLib.c | 11 +-
SecurityPkg/Tcg/Opal/OpalPassword/OpalAhciMode.c | 1282 -------------
SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c | 411 ++--
SecurityPkg/Tcg/Opal/OpalPassword/OpalNvmeMode.c | 1823 ------------------
SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c | 757 ++------
MdeModulePkg/Bus/Ata/AhciPei/AhciPei.uni | 21 +
MdeModulePkg/Bus/Ata/AhciPei/AhciPeiExtra.uni | 19 +
47 files changed, 7751 insertions(+), 5889 deletions(-)
create mode 100644 MdeModulePkg/Bus/Ata/AhciPei/AhciPei.inf
create mode 100644 MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h
create mode 100644 MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.h
create mode 100644 MdeModulePkg/Bus/Ata/AhciPei/AhciPeiStorageSecurity.h
create mode 100644 MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiStorageSecurity.h
create mode 100644 MdeModulePkg/Include/Guid/S3StorageDeviceInitList.h
create mode 100644 MdeModulePkg/Include/Ppi/AtaAhciController.h
create mode 100644 MdeModulePkg/Include/Ppi/AtaPassThru.h
create mode 100644 MdeModulePkg/Include/Ppi/StorageSecurityCommand.h
delete mode 100644 SecurityPkg/Tcg/Opal/OpalPassword/OpalAhciMode.h
delete mode 100644 SecurityPkg/Tcg/Opal/OpalPassword/OpalNvmeMode.h
delete mode 100644 SecurityPkg/Tcg/Opal/OpalPassword/OpalNvmeReg.h
create mode 100644 MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c
create mode 100644 MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c
create mode 100644 MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.c
create mode 100644 MdeModulePkg/Bus/Ata/AhciPei/AhciPeiS3.c
create mode 100644 MdeModulePkg/Bus/Ata/AhciPei/AhciPeiStorageSecurity.c
create mode 100644 MdeModulePkg/Bus/Ata/AhciPei/DevicePath.c
create mode 100644 MdeModulePkg/Bus/Ata/AhciPei/DmaMem.c
create mode 100644 MdeModulePkg/Bus/Pci/NvmExpressPei/DevicePath.c
create mode 100644 MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiS3.c
create mode 100644 MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiStorageSecurity.c
delete mode 100644 SecurityPkg/Tcg/Opal/OpalPassword/OpalAhciMode.c
delete mode 100644 SecurityPkg/Tcg/Opal/OpalPassword/OpalNvmeMode.c
create mode 100644 MdeModulePkg/Bus/Ata/AhciPei/AhciPei.uni
create mode 100644 MdeModulePkg/Bus/Ata/AhciPei/AhciPeiExtra.uni
--
2.12.0.windows.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v1 1/1] MdeModulePkg/NvmExpressDxe: Report StatusCode for device init failure
2019-02-11 7:57 [PATCH v4 00/13] Split the S3 PEI phase HW init codes from Opal driver Hao Wu
@ 2019-02-11 7:57 ` Hao Wu
2019-02-13 0:51 ` Ni, Ray
0 siblings, 1 reply; 4+ messages in thread
From: Hao Wu @ 2019-02-11 7:57 UTC (permalink / raw)
To: edk2-devel; +Cc: Sean Brogan, Bret Barkelew, Jian J Wang, Ray Ni, Hao Wu
From: Sean Brogan <sean.brogan@microsoft.com>
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>
Cc: Ray Ni <ray.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
---
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf | 3 ++-
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.h | 3 ++-
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 10 +++++++++-
3 files changed, 13 insertions(+), 3 deletions(-)
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/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/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));
--
2.12.0.windows.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1 1/1] MdeModulePkg/NvmExpressDxe: Report StatusCode for device init failure
2019-02-11 7:57 ` [PATCH v1 1/1] MdeModulePkg/NvmExpressDxe: Report StatusCode for device init failure Hao Wu
@ 2019-02-13 0:51 ` Ni, Ray
0 siblings, 0 replies; 4+ messages in thread
From: Ni, Ray @ 2019-02-13 0:51 UTC (permalink / raw)
To: Hao Wu, edk2-devel; +Cc: Sean Brogan, Bret Barkelew, Jian J Wang
On 2/11/2019 3:57 PM, Hao Wu wrote:
> From: Sean Brogan<sean.brogan@microsoft.com>
>
> 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>
> Cc: Ray Ni<ray.ni@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>
--
Thanks,
Ray
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-02-13 0:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-11 0:05 [PATCH v1 0/1] MdeModulePkg/NvmExpressDxe: Report StatusCode for device init failure Hao Wu
2019-02-11 0:05 ` [PATCH v1 1/1] " Hao Wu
-- strict thread matches above, loose matches on Subject: below --
2019-02-11 7:57 [PATCH v4 00/13] Split the S3 PEI phase HW init codes from Opal driver Hao Wu
2019-02-11 7:57 ` [PATCH v1 1/1] MdeModulePkg/NvmExpressDxe: Report StatusCode for device init failure Hao Wu
2019-02-13 0:51 ` Ni, Ray
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox