]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[usb] Clear device endpoint halt before resetting host endpoint
authorMichael Brown <mcb30@ipxe.org>
Thu, 2 Jul 2020 01:51:58 +0000 (02:51 +0100)
committerMichael Brown <mcb30@ipxe.org>
Thu, 2 Jul 2020 02:06:50 +0000 (03:06 +0100)
commit5d6fb7282966e3b77e6bb187d171511e8348c3c9
tree2c718322b3017cf9c485a79fc56bd4c82e7100e1
parentd5874c9f2b9c62b2d87b6c1cfafd61ef3d8cc67a
[usb] Clear device endpoint halt before resetting host endpoint

Resetting the host endpoint may immediately restart any pending
transfers for that endpoint.  If the device endpoint halt has not yet
been cleared, then this will probably result in a second failed
transfer.

This second failure may be detected within usb_endpoint_reset() while
waiting for usb_clear_feature() to complete.  The endpoint will
subsequently be removed from the list of halted endpoints, causing the
second failure to be effectively ignored and leaving the host endpoint
in a permanently halted state.

Fix by deferring the host endpoint reset until after the device
endpoint is ready to accept new transfers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/bus/usb.c