MdeModulePkg XhciDxe: Fix Map and Unmap inconsistency
We found there are loops of *2* Maps and only *1* Unmap and
the DMA buffer address is decreasing.
It is caused by the below code flow.
XhcAsyncInterruptTransfer ->
XhcCreateUrb ->
XhcCreateTransferTrb ->
Map Urb->DataMap (1)
Timer: loops of *2* Maps and only *1* Unmap
XhcMonitorAsyncRequests ->
XhcFlushAsyncIntMap ->
Unmap and Map Urb->DataMap (2)
XhcUpdateAsyncRequest ->
XhcCreateTransferTrb ->
Map Urb->DataMap (3)
This patch is to eliminate (3).
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
(cherry picked from commit 0b9c0c6540
)
This commit is contained in:
@@ -260,7 +260,10 @@ XhcCreateTransferTrb (
|
|||||||
EPType = (UINT8) ((DEVICE_CONTEXT_64 *)OutputContext)->EP[Dci-1].EPType;
|
EPType = (UINT8) ((DEVICE_CONTEXT_64 *)OutputContext)->EP[Dci-1].EPType;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Urb->Data != NULL) {
|
//
|
||||||
|
// No need to remap.
|
||||||
|
//
|
||||||
|
if ((Urb->Data != NULL) && (Urb->DataMap == NULL)) {
|
||||||
if (((UINT8) (Urb->Ep.Direction)) == EfiUsbDataIn) {
|
if (((UINT8) (Urb->Ep.Direction)) == EfiUsbDataIn) {
|
||||||
MapOp = EfiPciIoOperationBusMasterWrite;
|
MapOp = EfiPciIoOperationBusMasterWrite;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user