summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
index b7fdb8dd48..a48b295d26 100644
--- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
+++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
@@ -913,12 +913,22 @@ AtaAtapiPassThruStop (
//
DestroyDeviceInfoList (Instance);
+ PciIo = Instance->PciIo;
+
+ //
+ // Disable this ATA host controller.
+ //
+ PciIo->Attributes (
+ PciIo,
+ EfiPciIoAttributeOperationDisable,
+ Instance->EnabledPciAttributes,
+ NULL
+ );
+
//
// If the current working mode is AHCI mode, then pre-allocated resource
// for AHCI initialization should be released.
//
- PciIo = Instance->PciIo;
-
if (Instance->Mode == EfiAtaAhciMode) {
AhciRegisters = &Instance->AhciRegisters;
PciIo->Unmap (
@@ -951,16 +961,6 @@ AtaAtapiPassThruStop (
}
//
- // Disable this ATA host controller.
- //
- PciIo->Attributes (
- PciIo,
- EfiPciIoAttributeOperationDisable,
- Instance->EnabledPciAttributes,
- NULL
- );
-
- //
// Restore original PCI attributes
//
Status = PciIo->Attributes (