audk/MdeModulePkg/Bus
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
..
Ata MdeModulePkg/AtaAtapiPassThru: Revert patch to disable PCI attributes 2017-11-29 09:02:46 +08:00
I2c/I2cDxe
Isa MdeModulePkg: Update comments in SimpleTextInEx according to UEFI 2.7 2017-06-20 09:29:42 +08:00
Pci MdeModulePkg/NvmExpressDxe: fix error status override 2017-12-05 08:28:37 +08:00
Scsi MdeModulePkg/ScsiBusDxe: don't produce ScsiIo for nonexistent LUNs, part 2 2017-08-19 00:39:05 +02:00
Sd MdeModulePkg/SdBlockIoPei: Support IoMmu 2017-11-17 11:38:46 +08:00
Ufs MdeModulePkg/UfsBlockIoPei: Support IoMmu 2017-11-17 11:35:02 +08:00
Usb MdeModulePkg/UsbMassStorageDxe: Check Get Max LUN status/value 2017-11-20 14:43:37 -08:00