]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Usb: Adjust TPL to not block async transfer during usb enum.
authorFeng Tian <feng.tian@intel.com>
Thu, 6 Aug 2015 07:13:16 +0000 (07:13 +0000)
committererictian <erictian@Edk2>
Thu, 6 Aug 2015 07:13:16 +0000 (07:13 +0000)
EDKII usb stack is using a TPL_CALLBACK timer to monitor async transfer
request and signal event if it's done. As usb enumeration and usb mass
storage block i/o read/write runs on TPL_CALLBACK and TPL_NOTIFY level
respectively, It blocks usb async transfer requests, usually usb mouse
/use kb, getting time to run.

Without this change, user couldn't get usb mouse/kb state in time (will
show a little lag from UI view) when there is other usb transactions, such
as a new usb device inserted.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18169 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c

index 315f2cbbdbc47487f3937863071638455a463e0d..4e9e05f0e43134403c89557f84488381721eafe9 100644 (file)
@@ -1615,7 +1615,7 @@ EhcCreateUsb2Hc (
   //\r
   Status = gBS->CreateEvent (\r
                   EVT_TIMER | EVT_NOTIFY_SIGNAL,\r
-                  TPL_CALLBACK,\r
+                  TPL_NOTIFY,\r
                   EhcMonitorAsyncRequests,\r
                   Ehc,\r
                   &Ehc->PollTimer\r
index ad9c85c5573214122d9b790aa1fbd2bf458d6a4f..179e36c3a2115cd82c94041fcbb70fba2abaf5d6 100644 (file)
@@ -1482,7 +1482,7 @@ UhciAllocateDev (
 \r
   Status = gBS->CreateEvent (\r
                   EVT_TIMER | EVT_NOTIFY_SIGNAL,\r
-                  TPL_CALLBACK,\r
+                  TPL_NOTIFY,\r
                   UhciMonitorAsyncReqList,\r
                   Uhc,\r
                   &Uhc->AsyncIntMonitor\r
index 6143b200ab790f5e3bae73b9bd26342030d9f9eb..390ca0a3762eb1f2956892986c671915538c9499 100644 (file)
@@ -1822,7 +1822,7 @@ XhcCreateUsbHc (
   //\r
   Status = gBS->CreateEvent (\r
                   EVT_TIMER | EVT_NOTIFY_SIGNAL,\r
-                  TPL_CALLBACK,\r
+                  TPL_NOTIFY,\r
                   XhcMonitorAsyncRequests,\r
                   Xhc,\r
                   &Xhc->PollTimer\r
index be11cc78fefa77eba99fb4d76979c660ddee8085..9d1bb25fb39d630b73ae4bd9a7c0e8f1e53ed2e6 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   USB Mass Storage Driver that manages USB Mass Storage Device and produces Block I/O Protocol.\r
 \r
-Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -63,7 +63,7 @@ UsbMassReset (
   // Raise TPL to TPL_NOTIFY to serialize all its operations\r
   // to protect shared data structures.\r
   //\r
-  OldTpl  = gBS->RaiseTPL (TPL_NOTIFY);\r
+  OldTpl  = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
   UsbMass = USB_MASS_DEVICE_FROM_BLOCK_IO (This);\r
   Status  = UsbMass->Transport->Reset (UsbMass->Context, ExtendedVerification);\r
@@ -117,7 +117,7 @@ UsbMassReadBlocks (
   // Raise TPL to TPL_NOTIFY to serialize all its operations\r
   // to protect shared data structures.\r
   //\r
-  OldTpl  = gBS->RaiseTPL (TPL_NOTIFY);\r
+  OldTpl  = gBS->RaiseTPL (TPL_CALLBACK);\r
   UsbMass = USB_MASS_DEVICE_FROM_BLOCK_IO (This);\r
   Media   = &UsbMass->BlockIoMedia;\r
 \r
@@ -233,7 +233,7 @@ UsbMassWriteBlocks (
   // Raise TPL to TPL_NOTIFY to serialize all its operations\r
   // to protect shared data structures.\r
   //\r
-  OldTpl  = gBS->RaiseTPL (TPL_NOTIFY);\r
+  OldTpl  = gBS->RaiseTPL (TPL_CALLBACK);\r
   UsbMass = USB_MASS_DEVICE_FROM_BLOCK_IO (This);\r
   Media   = &UsbMass->BlockIoMedia;\r
 \r