]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
USB: xhci: fix U1/U2 handling for hardware with XHCI_INTEL_HOST quirk set
authorMichael Grzeschik <m.grzeschik@pengutronix.de>
Tue, 15 Dec 2020 19:31:47 +0000 (20:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jan 2021 19:10:21 +0000 (20:10 +0100)
commit6cae935a55a2944a5fa9768c77fdd4fd4f83102b
tree4a9f42a926fd9cadc62a38ed4315d0a85eb13ad9
parentb31a257c281ab8bf105e1d1290c30106ff6fae3f
USB: xhci: fix U1/U2 handling for hardware with XHCI_INTEL_HOST quirk set

commit 5d5323a6f3625f101dbfa94ba3ef7706cce38760 upstream.

The commit 0472bf06c6fd ("xhci: Prevent U1/U2 link pm states if exit
latency is too long") was constraining the xhci code not to allow U1/U2
sleep states if the latency to wake up from the U-states reached the
service interval of an periodic endpoint. This fix was not taking into
account that in case the quirk XHCI_INTEL_HOST is set, the wakeup time
will be calculated and configured differently.

It checks for u1_params.mel/u2_params.mel as a limit. But the code could
decide to write another MEL into the hardware. This leads to broken
cases where not enough bandwidth is available for other devices:

usb 1-2: can't set config #1, error -28

This patch is fixing that case by checking for timeout_ns after the
wakeup time was calculated depending on the quirks.

Fixes: 0472bf06c6fd ("xhci: Prevent U1/U2 link pm states if exit latency is too long")
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201215193147.11738-1-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.c