audk/MdeModulePkg/Bus/Pci
Heyi Guo 9a77210b43 MdeModulePkg/NvmExpressDxe: fix error status override
Commit f6b139b added return status handling to PciIo->Mem.Write.
However, the second status handling will override EFI_DEVICE_ERROR
returned in this branch:

  //
  // Check the NVMe cmd execution result
  //
  if (Status != EFI_TIMEOUT) {
    if ((Cq->Sct == 0) && (Cq->Sc == 0)) {
      Status = EFI_SUCCESS;
    } else {
      Status = EFI_DEVICE_ERROR;
               ^^^^^^^^^^^^^^^^

Since PciIo->Mem.Write will probably return SUCCESS, it causes
NvmExpressPassThru to return SUCCESS even when DEVICE_ERROR occurs.
Callers of NvmExpressPassThru will then continue executing which may
cause further unexpected results, e.g. DiscoverAllNamespaces couldn't
break out the loop.

So we save previous status before calling PciIo->Mem.Write and restore
the previous one if it already contains error.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-12-05 08:28:37 +08:00
..
EhciDxe
EhciPei MdeModulePkg EhciPei: Minor refinement about IOMMU 2017-11-22 18:37:48 +08:00
IdeBusPei
IncompatiblePciDeviceSupportDxe
NonDiscoverablePciDeviceDxe MdeModulePkg/NonDiscoverable: fix memory override bug 2017-11-08 12:52:04 +08:00
NvmExpressDxe MdeModulePkg/NvmExpressDxe: fix error status override 2017-12-05 08:28:37 +08:00
PciBusDxe MdeModulePkg/PciBus: Revert "Enable BM on P2P bridges on demand" 2017-11-22 18:00:48 +08:00
PciHostBridgeDxe MdeModulePkg/PciHostBridge: Set SpecificFlag to 0 for Mem32/Mem64 2017-10-20 12:52:08 +08:00
PciSioSerialDxe
SataControllerDxe
SdMmcPciHcDxe MdeModulePkg/SdMmcPciHcDxe: call SdMmcFreeTrb() to complete sync operation 2017-11-06 10:33:02 +00:00
SdMmcPciHcPei
UfsPciHcDxe
UfsPciHcPei
UhciDxe
UhciPei MdeModulePkg UhciPei: Also check TempPtr against NULL to return error 2017-11-24 09:34:00 +08:00
XhciDxe
XhciPei MdeModulePkg XhciPei: Minor refinement about IoMmu 2017-11-17 11:14:22 +08:00