MdeModulePkg/AtaAtapiPassThru: Revert patch to disable PCI attributes

This patch caused Windows 10 S4 resume failure.
Considering the similar changes are reverted from PciBus driver,
revert the patch from AtaAtapiPassThru as well.

Revert "MdeModulePkg/AtaAtapiPassThru: disable the device
at ExitBootServices()"

This reverts commit 6fb8ddd36b.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Ruiyu Ni 2017-11-27 09:17:24 +08:00
parent 0641808ece
commit df076c7bab
2 changed files with 1 additions and 64 deletions

View File

@ -104,8 +104,7 @@ ATA_ATAPI_PASS_THRU_INSTANCE gAtaAtapiPassThruInstanceTemplate = {
{ // NonBlocking TaskList { // NonBlocking TaskList
NULL, NULL,
NULL NULL
}, }
NULL, // ExitBootEvent
}; };
ATAPI_DEVICE_PATH mAtapiDevicePathTemplate = { ATAPI_DEVICE_PATH mAtapiDevicePathTemplate = {
@ -479,38 +478,6 @@ InitializeAtaAtapiPassThru (
return Status; return Status;
} }
/**
Disable the device (especially Bus Master DMA) when exiting the boot
services.
@param[in] Event Event for which this notification function is being
called.
@param[in] Context Pointer to the ATA_ATAPI_PASS_THRU_INSTANCE that
represents the HBA.
**/
VOID
EFIAPI
AtaPassThruExitBootServices (
IN EFI_EVENT Event,
IN VOID *Context
)
{
ATA_ATAPI_PASS_THRU_INSTANCE *Instance;
EFI_PCI_IO_PROTOCOL *PciIo;
DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __FUNCTION__, Context));
Instance = Context;
PciIo = Instance->PciIo;
PciIo->Attributes (
PciIo,
EfiPciIoAttributeOperationDisable,
Instance->EnabledPciAttributes,
NULL
);
}
/** /**
Tests to see if this driver supports a given controller. If a child device is provided, Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device. it further tests to see if this driver supports creating a handle for the specified child device.
@ -790,17 +757,6 @@ AtaAtapiPassThruStart (
InitializeListHead(&Instance->DeviceList); InitializeListHead(&Instance->DeviceList);
InitializeListHead(&Instance->NonBlockingTaskList); InitializeListHead(&Instance->NonBlockingTaskList);
Status = gBS->CreateEvent (
EVT_SIGNAL_EXIT_BOOT_SERVICES,
TPL_CALLBACK,
AtaPassThruExitBootServices,
Instance,
&Instance->ExitBootEvent
);
if (EFI_ERROR (Status)) {
goto ErrorExit;
}
Instance->TimerEvent = NULL; Instance->TimerEvent = NULL;
Status = gBS->CreateEvent ( Status = gBS->CreateEvent (
@ -854,10 +810,6 @@ ErrorExit:
gBS->CloseEvent (Instance->TimerEvent); gBS->CloseEvent (Instance->TimerEvent);
} }
if ((Instance != NULL) && (Instance->ExitBootEvent != NULL)) {
gBS->CloseEvent (Instance->ExitBootEvent);
}
// //
// Remove all inserted ATA devices. // Remove all inserted ATA devices.
// //
@ -956,15 +908,6 @@ AtaAtapiPassThruStop (
Instance->TimerEvent = NULL; Instance->TimerEvent = NULL;
} }
DestroyAsynTaskList (Instance, FALSE); DestroyAsynTaskList (Instance, FALSE);
//
// Close event signaled at gBS->ExitBootServices().
//
if (Instance->ExitBootEvent != NULL) {
gBS->CloseEvent (Instance->ExitBootEvent);
Instance->ExitBootEvent = NULL;
}
// //
// Free allocated resource // Free allocated resource
// //

View File

@ -121,12 +121,6 @@ typedef struct {
// //
EFI_EVENT TimerEvent; EFI_EVENT TimerEvent;
LIST_ENTRY NonBlockingTaskList; LIST_ENTRY NonBlockingTaskList;
//
// For disabling the device (especially Bus Master DMA) at
// ExitBootServices().
//
EFI_EVENT ExitBootEvent;
} ATA_ATAPI_PASS_THRU_INSTANCE; } ATA_ATAPI_PASS_THRU_INSTANCE;
// //