summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus/Pci/EhciDxe
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Bus/Pci/EhciDxe')
-rwxr-xr-x[-rw-r--r--]MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c6
-rw-r--r--MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c9
-rw-r--r--MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c1
-rw-r--r--MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.h3
4 files changed, 18 insertions, 1 deletions
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
index 3fcb0f9914..a3eb14b28c 100644..100755
--- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
@@ -1095,6 +1095,12 @@ EhcAsyncInterruptTransfer (
EhcLinkQhToPeriod (Ehc, Urb->Qh);
InsertHeadList (&Ehc->AsyncIntTransfers, &Urb->UrbList);
+ // ARM: Force an asynchonous transfer after waiting an interval
+ // Polling interval is in milliseconds while BS.Stall except
+ // Microseconds.
+ gBS->Stall (PollingInterval * 1000);
+ EhcMonitorAsyncRequests (Ehc->PollTimer, Ehc);
+
ON_EXIT:
Ehc->PciIo->Flush (Ehc->PciIo);
gBS->RestoreTPL (OldTpl);
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
index 5594e6699e..cc6e77e385 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
@@ -573,6 +573,12 @@ EhcCheckUrbResult (
ASSERT ((Ehc != NULL) && (Urb != NULL) && (Urb->Qh != NULL));
+ // The URB is already being processed, we do not want the callback to be
+ // called twice for the same URB
+ if (Urb->InProgress) {
+ return FALSE;
+ }
+
Finished = TRUE;
Urb->Completed = 0;
@@ -992,6 +998,9 @@ EhcMonitorAsyncRequests (
continue;
}
+ // Mark the URB as 'in-progress' to prevent the URB to be processed twice.
+ Urb->InProgress = TRUE;
+
//
// Flush any PCI posted write transactions from a PCI host
// bridge to system memory.
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c b/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c
index 6afb327df1..1ad37d5bd1 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c
@@ -600,6 +600,7 @@ EhcCreateUrb (
Urb->DataLen = DataLen;
Urb->Callback = Callback;
Urb->Context = Context;
+ Urb->InProgress = FALSE;
PciIo = Ehc->PciIo;
Urb->Qh = EhcCreateQh (Ehc, &Urb->Ep);
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.h b/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.h
index 02e9af81be..0c80e76248 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.h
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.h
@@ -232,7 +232,8 @@ struct _URB {
// Transaction result
//
UINT32 Result;
- UINTN Completed; // completed data length
+ BOOLEAN InProgress; // defined when the URB is being processed
+ UINTN Completed; // Length of the data being processed
UINT8 DataToggle;
};