coreboot-kgpe-d16/payloads/libpayload/drivers/usb
Julius Werner 49ba283390 libpayload: xhci: Ensure to reset dequeue pointer on stopped endpoints
This patch fixes a bug in the XHCI stack that occurs when a multi-TRB TD
times out before the last TRB is processed. The driver will correctly
issue a Stop Endpoint command in that case, but the xHC will still
preserve the transfer state and just pick up right after that on the
next doorbell ring. It will then process the leftover TRBs from the old
TD the next time a transfer is issued. (cf. XHCI 4.6.9)

We fix this by changing the existing xhci_reset_endpoint() calls in
transfer functions to not only trigger on Halted (2) and Error (4), but
also on Stopped (3). That function will not actually issue a Reset
Endpoint command in this case, but it will nuke the whole transfer ring
and issue a Set TR Dequeue Pointer command, which is sufficient (though
slightly overkill) to solve our problem.

Change-Id: I3abbe30ff9d4911a8af1f792324e018d427019e8
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170833
Reviewed-by: Ronald Minnich <rminnich@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
(cherry picked from commit f12424af0e29ac12963e8e5a7970fadcc0bb6cee)
Signed-off-by: Isaac Christensen <isaac.christensen@se-eng.com>
Reviewed-on: http://review.coreboot.org/6787
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
2014-08-31 23:49:54 +02:00
..
TODO
ehci.c libpayload: Make EHCI driver cache-aware 2014-08-14 23:40:25 +02:00
ehci.h libpayload: Use unsigned long for BARs in *hci_init() 2014-07-10 20:55:41 +02:00
ehci_private.h libpayload: Make EHCI driver cache-aware 2014-08-14 23:40:25 +02:00
ehci_rh.c
generic_hub.c
generic_hub.h
ohci.c libpayload: Make USB transfer functions return amount of bytes 2014-08-12 22:03:28 +02:00
ohci.h libpayload: Use unsigned long for BARs in *hci_init() 2014-07-10 20:55:41 +02:00
ohci_private.h
ohci_rh.c
quirks.c
uhci.c libpayload: Make USB transfer functions return amount of bytes 2014-08-12 22:03:28 +02:00
uhci.h
uhci_private.h
uhci_rh.c
usb.c libpayload: usb: Fix several minor USB stack bugs 2014-08-19 23:31:05 +02:00
usb_dev.c
usbhid.c libpayload: usb: Fix several minor USB stack bugs 2014-08-19 23:31:05 +02:00
usbhub.c libpayload: usbhub: Don't clear PSC unless it was set 2014-08-12 23:19:42 +02:00
usbinit.c libpayload: usb: Allow direct instantiation of MMIO host controllers 2014-08-28 00:09:32 +02:00
usbmsc.c libpayload: usb: Fix several minor USB stack bugs 2014-08-19 23:31:05 +02:00
xhci.c libpayload: xhci: Ensure to reset dequeue pointer on stopped endpoints 2014-08-31 23:49:54 +02:00
xhci.h libpayload: Use unsigned long for BARs in *hci_init() 2014-07-10 20:55:41 +02:00
xhci_commands.c libpayload: xhci: Make XHCI stack usable on ARM 2014-08-14 23:41:21 +02:00
xhci_debug.c libpayload: xhci: Make XHCI stack usable on ARM 2014-08-14 23:41:21 +02:00
xhci_devconf.c libpayload: usb: Fix several minor USB stack bugs 2014-08-19 23:31:05 +02:00
xhci_events.c libpayload: xhci: Make XHCI stack usable on ARM 2014-08-14 23:41:21 +02:00
xhci_private.h libpayload: xhci: Make XHCI stack usable on ARM 2014-08-14 23:41:21 +02:00
xhci_rh.c libpayload: xhci: Make XHCI stack usable on ARM 2014-08-14 23:41:21 +02:00