coreboot-kgpe-d16/payloads/libpayload/drivers
Julius Werner e44a4e8787 libpayload: usb: xhci: Prevent address reuse
We have been trying to avoid reassigning previously used USB addresses
to different devices since CL:197420, because some devices seem to take
issue with that. Unfortunately, that patch doesn't affect XHCI: those
controllers insist on chosing addresses on their own. The only way to
prevent them from reusing a previously assigned address is to not
disable that slot at all.

This patch implements address reuse avoidance on XHCI by not disabling
slots when a device is detatched (which may occur both on physical
detachment or if we simply couldn't find a driver for that device).
Instead, we just release as many resources as we can for detached
devices (by dropping all endpoint contexts) and defer the final cleanup
until the point where the controller actually runs out of resources (a
point that we probably don't often reach in most firmware scenarios).

BRANCH=none
BUG=chrome-os-partner:42181
TEST=Booted an Oak plugged into a Servo without having a driver for the
SMSC network chip, observed that it could still enumerate the next
device afterwards. Kept unplugging/replugging stuff until the cleanup
triggered and made sure the controller still worked after that. Also
played around a bit on a Falco without issues.

Change-Id: Idfbab39abbc5bc5eff822bedf9c8d5bd4cad8cd2
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 88c6bcbc41156729c3c38937c8a4adebc66f1ccb
Original-Change-Id: I0653a4f6a02c02498210a70ffdda9d986592813b
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/284175
Original-Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Original-Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10957
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-18 09:40:32 +02:00
..
serial libpayload: Make Kconfig bools use IS_ENABLED() 2015-06-30 18:55:15 +02:00
storage libpayload: Make Kconfig bools use IS_ENABLED() 2015-06-30 18:55:15 +02:00
timer Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
udc libpayload: udc: dwc2: support force_shutdown() routine 2015-07-06 09:39:14 +02:00
usb libpayload: usb: xhci: Prevent address reuse 2015-07-18 09:40:32 +02:00
video libpayload: Make Kconfig bools use IS_ENABLED() 2015-06-30 18:55:15 +02:00
Makefile.inc libpayload: add UDC driver for Designware controller 2015-06-30 08:09:49 +02:00
cbmem_console.c libpayload: console: Allow output drivers to print whole strings at once 2014-12-22 21:44:37 +01:00
hid.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
keyboard.c libpayload: Make Kconfig bools use IS_ENABLED() 2015-06-30 18:55:15 +02:00
nvram.c libpayload: Make Kconfig bools use IS_ENABLED() 2015-06-30 18:55:15 +02:00
options.c
pci.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
serial.c libpayload: Make Kconfig bools use IS_ENABLED() 2015-06-30 18:55:15 +02:00
speaker.c