audk/MdeModulePkg/Bus/Pci/XhciDxe
Star Zeng 7779209971 MdeModulePkg XhciDxe: Use common buffer for AsyncInterruptTransfer
V3:
Call XhcFreeUrb after XhcCreateTransferTrb fails in XhcCreateTrb.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1274

In current code, XhcMonitorAsyncRequests (timer handler) will do
unmap and map operations for AsyncIntTransfers to "Flush data from
PCI controller specific address to mapped system memory address".
XhcMonitorAsyncRequests
  XhcFlushAsyncIntMap
    PciIo->Unmap
      IoMmu->SetAttribute
    PciIo->Map
      IoMmu->SetAttribute

This may impact the boot performance.

Since the data buffer for XhcMonitorAsyncRequests is internal
buffer, we can allocate common buffer by PciIo->AllocateBuffer
and map the buffer with EfiPciIoOperationBusMasterCommonBuffer,
then the unmap and map operations can be removed.

///
/// Provides both read and write access to system memory by
/// both the processor and a bus master. The buffer is coherent
/// from both the processor's and the bus master's point of view.
///
EfiPciIoOperationBusMasterCommonBuffer,

Test done:
USB KB works normally.
USB disk read/write works normally.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Jian J Wang <jian.j.wang@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>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
2018-10-28 21:20:08 +08:00
..
ComponentName.c 1) remove wrong global variable usage because it will bring data corrupt if there are multiple XHCI host controllers. 2011-09-14 12:13:03 +00:00
ComponentName.h
UsbHcMem.c MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
UsbHcMem.h MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
Xhci.c MdeModulePkg XhciDxe: Use common buffer for AsyncInterruptTransfer 2018-10-28 21:20:08 +08:00
Xhci.h MdeModulePkg/XhciDxe: Check timeout URB again after stopping endpoint 2017-07-05 11:31:06 +08:00
XhciDxe.inf MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
XhciDxe.uni MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
XhciDxeExtra.uni MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
XhciReg.c MdeModulePkg: XhciDxe: Prevent illegal memory access in XhcSetHsee 2018-09-26 08:33:52 +08:00
XhciReg.h MdeModulePkg Xhci: Handle value 5 in Port Speed field of PORTSC 2018-10-23 11:17:32 +08:00
XhciSched.c MdeModulePkg XhciDxe: Use common buffer for AsyncInterruptTransfer 2018-10-28 21:20:08 +08:00
XhciSched.h MdeModulePkg XhciDxe: Use common buffer for AsyncInterruptTransfer 2018-10-28 21:20:08 +08:00