diff options
author | Feng Tian <feng.tian@intel.com> | 2016-06-22 16:21:35 +0800 |
---|---|---|
committer | Feng Tian <feng.tian@intel.com> | 2016-07-01 14:44:47 +0800 |
commit | 3b1d8241d0dac25c5e678c364fa2754ac1731060 (patch) | |
tree | 874284eee06eca9933166cf9227c905fbc969495 /MdeModulePkg/Bus/Pci/SdMmcPciHcDxe | |
parent | e1f3583409e7fa5041be829440f0139b1a70c3c4 (diff) | |
download | edk2-platforms-3b1d8241d0dac25c5e678c364fa2754ac1731060.tar.xz |
MdeModulePkg/SdMmc: update TPL to notify to fix UEFI SCT hang
We have to upgrade the TPL level used by SdMmc stack because the
following flow:
DiskIo2ReadWriteDisk() in logical partition -> PartitionReadBlocksEx()
in logical partition at TPL callback level -> ProbeMediaStatusEx()
with sync request -> DiskIo2ReadWriteDisk() in physical partition ->
waiting for async task completion.
if the low layer driver doesn't run at TPL_NOTIFY level, it will have
no time to trigger async task and cause system hang.
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Diffstat (limited to 'MdeModulePkg/Bus/Pci/SdMmcPciHcDxe')
-rw-r--r-- | MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 9 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c index ed6b557347..0be081dad0 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c @@ -238,6 +238,7 @@ SdMmcPciHcEnumerateDevice ( LIST_ENTRY *Link;
LIST_ENTRY *NextLink;
SD_MMC_HC_TRB *Trb;
+ EFI_TPL OldTpl;
Private = (SD_MMC_HC_PRIVATE_DATA*)Context;
@@ -251,6 +252,7 @@ SdMmcPciHcEnumerateDevice ( //
// Signal all async task events at the slot with EFI_NO_MEDIA status.
//
+ OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
for (Link = GetFirstNode (&Private->Queue);
!IsNull (&Private->Queue, Link);
Link = NextLink) {
@@ -263,6 +265,7 @@ SdMmcPciHcEnumerateDevice ( SdMmcFreeTrb (Trb);
}
}
+ gBS->RestoreTPL (OldTpl);
//
// Notify the upper layer the connect state change through ReinstallProtocolInterface.
//
@@ -665,7 +668,7 @@ SdMmcPciHcDriverBindingStart ( //
Status = gBS->CreateEvent (
EVT_TIMER | EVT_NOTIFY_SIGNAL,
- TPL_CALLBACK,
+ TPL_NOTIFY,
ProcessAsyncTaskList,
Private,
&Private->TimerEvent
@@ -961,7 +964,7 @@ SdMmcPassThruPassThru ( // Wait async I/O list is empty before execute sync I/O operation.
//
while (TRUE) {
- OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
+ OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
if (IsListEmpty (&Private->Queue)) {
gBS->RestoreTPL (OldTpl);
break;
@@ -1273,7 +1276,7 @@ SdMmcPassThruResetDevice ( //
// Free all async I/O requests in the queue
//
- OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
+ OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
for (Link = GetFirstNode (&Private->Queue);
!IsNull (&Private->Queue, Link);
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c index 8978182f9e..b4ff2af019 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c @@ -1315,7 +1315,7 @@ SdMmcCreateTrb ( }
if (Event != NULL) {
- OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
+ OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
InsertTailList (&Private->Queue, &Trb->TrbList);
gBS->RestoreTPL (OldTpl);
}
|