Skip to content

Commit

Permalink
USB: xhci: Fix finding extended capabilities registers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Edward Shao authored and Greg Kroah-Hartman committed Mar 2, 2010
1 parent cceffe9 commit 0519792
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/usb/host/xhci-ext-caps.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,15 @@ static inline int xhci_find_next_cap_offset(void __iomem *base, int ext_offset)

next = readl(base + ext_offset);

if (ext_offset == XHCI_HCC_PARAMS_OFFSET)
if (ext_offset == XHCI_HCC_PARAMS_OFFSET) {
/* Find the first extended capability */
next = XHCI_HCC_EXT_CAPS(next);
else
ext_offset = 0;
} else {
/* Find the next extended capability */
next = XHCI_EXT_CAPS_NEXT(next);
}

if (!next)
return 0;
/*
Expand Down

0 comments on commit 0519792

Please sign in to comment.