Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: xhci: Fix finding extended capabilities registers

According "5.3.6 Capability Parameters (HCCPARAMS)" of xHCI rev0.96 spec,
value of xECP register indicates a relative offset, in 32-bit words,
from Base to the beginning of the first extended capability.
The wrong calculation will cause BIOS handoff fail (not handoff from BIOS)
in some platform with BIOS USB legacy sup support.

Signed-off-by: Edward Shao <laface.tw@gmail.com>
Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Edward Shao and committed by
Greg Kroah-Hartman
05197921 cceffe93

+5 -2
+5 -2
drivers/usb/host/xhci-ext-caps.h
··· 101 101 102 102 next = readl(base + ext_offset); 103 103 104 - if (ext_offset == XHCI_HCC_PARAMS_OFFSET) 104 + if (ext_offset == XHCI_HCC_PARAMS_OFFSET) { 105 105 /* Find the first extended capability */ 106 106 next = XHCI_HCC_EXT_CAPS(next); 107 - else 107 + ext_offset = 0; 108 + } else { 108 109 /* Find the next extended capability */ 109 110 next = XHCI_EXT_CAPS_NEXT(next); 111 + } 112 + 110 113 if (!next) 111 114 return 0; 112 115 /*