Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: 2ba169b02f7eebb34816c2d02a1cd9f92a524b1a
      
https://github.com/tianocore/edk2/commit/2ba169b02f7eebb34816c2d02a1cd9f92a524b1a
  Author: Marlboro_Chuang <[email protected]>
  Date:   2026-09-21 (Mon, 21 Sep 2026)

  Changed paths:
    M MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c

  Log Message:
  -----------
  MdeModulePkg/UsbBusDxe: Raise TPL to CALLBACK for wanted UsbIo connect

Raise TPL to TPL_CALLBACK around the ConnectController() call in
UsbBusRecursivelyConnectWantedUsbIo() and restore the original TPL
afterward.

UsbBusRecursivelyConnectWantedUsbIo() is normally reached through the
DriverBinding Start routine invoked by gBS->ConnectController(), which
runs at TPL_APPLICATION. While the wanted UsbIo handle is being
connected, the USB device can be removed. The device removal polling
event in UsbBus runs at TPL_CALLBACK. If the connect runs at
TPL_APPLICATION, that event can preempt the connection and cause
commands to be sent to a stale or non-existent USB device address,
producing a lot of timeout transfers.

This differs from UsbConnectDriver(), which is called from the
enumeration polling event (XHCI async event) and is usually already
at TPL_CALLBACK or TPL_NOTIFY. That function uses RestoreTPL()/
RaiseTPL() to ensure ConnectController() runs at TPL_CALLBACK.

Signed-off-by: Marlboro_Chuang <[email protected]>



To unsubscribe from these emails, change your notification settings at 
https://github.com/tianocore/edk2/settings/notifications


_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to