]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[xhci] Allow for permanent failure of the command mechanism
authorMichael Brown <mcb30@ipxe.org>
Wed, 27 Oct 2021 23:38:02 +0000 (00:38 +0100)
committerMichael Brown <mcb30@ipxe.org>
Thu, 28 Oct 2021 22:18:07 +0000 (23:18 +0100)
commit85eb961bf9afd61385430f8837485ba69cc0cc11
tree95faf9dc33c3614283490d906819179065616465
parentf24a2794e1b527e45efbbcad1c272f176f3d9df0
[xhci] Allow for permanent failure of the command mechanism

Some xHCI controllers (observed with the Thunderbolt ports on a
ThinkPad X1 Extreme Gen3 and a ThinkPad P53) seem to suffer a
catastrophic failure at the point that ExitBootServices() is called if
the IOMMU is enabled.  The symptoms appear to be consistent with
another UEFI driver (e.g. the IOMMU driver, or the Thunderbolt driver)
having torn down the DMA mappings, leaving the xHCI controller unable
to write to host memory.  The observable effect is that all commands
fail with a timeout, and attempts to abort command execution similarly
fail since the xHCI controller is unable to report the abort
completion.

Check for failure to abort a command, and respond by performing a full
device reset (as recommended by the xHCI specification) and by marking
the device as permanently failed.

Reported-by: Andreas Hammarskjöld <junior@2PintSoftware.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/usb/xhci.c
src/drivers/usb/xhci.h