diff options
author | Jann Horn <jannh@google.com> | 2020-04-01 09:46:19 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-16 14:46:00 +0200 |
commit | 7dbdb53d72a51cea9b921d9dbba54be00752212a (patch) | |
tree | 1a37c38cd2541ae73f9075ef1c8781e650d9225c /drivers/irqchip/irq-bcm6345-l1.c | |
parent | USB: core: Fix free-while-in-use bug in the USB S-Glibrary (diff) | |
download | linux-7dbdb53d72a51cea9b921d9dbba54be00752212a.tar.xz linux-7dbdb53d72a51cea9b921d9dbba54be00752212a.zip |
USB: early: Handle AMD's spec-compliant identifiers, too
This fixes a bug that causes the USB3 early console to freeze after
printing a single line on AMD machines because it can't parse the
Transfer TRB properly.
The spec at
https://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/extensible-host-controler-interface-usb-xhci.pdf
says in section "4.5.1 Device Context Index" that the Context Index,
also known as Endpoint ID according to
section "1.6 Terms and Abbreviations", is normally computed as
`DCI = (Endpoint Number * 2) + Direction`, which matches the current
definitions of XDBC_EPID_OUT and XDBC_EPID_IN.
However, the numbering in a Debug Capability Context data structure is
supposed to be different:
Section "7.6.3.2 Endpoint Contexts and Transfer Rings" explains that a
Debug Capability Context data structure has the endpoints mapped to indices
0 and 1.
Change XDBC_EPID_OUT/XDBC_EPID_IN to the spec-compliant values, add
XDBC_EPID_OUT_INTEL/XDBC_EPID_IN_INTEL with Intel's incorrect values, and
let xdbc_handle_tx_event() handle both.
I have verified that with this patch applied, the USB3 early console works
on both an Intel and an AMD machine.
Fixes: aeb9dd1de98c ("usb/early: Add driver for xhci debug capability")
Cc: stable@vger.kernel.org
Signed-off-by: Jann Horn <jannh@google.com>
Link: https://lore.kernel.org/r/20200401074619.8024-1-jannh@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/irqchip/irq-bcm6345-l1.c')
0 files changed, 0 insertions, 0 deletions