aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-ext-caps.h
diff options
context:
space:
mode:
authorEdward Shao <laface.tw@gmail.com>2010-02-10 14:37:30 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 17:55:02 -0500
commit05197921ff3dad52d99fd1647974c57d9c28d40e (patch)
tree733684b9d0acbcd43f6f3e95f3bbc2ca4c48e960 /drivers/usb/host/xhci-ext-caps.h
parentcceffe9348f93188d7811bda95924d4bd3040d0f (diff)
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>
Diffstat (limited to 'drivers/usb/host/xhci-ext-caps.h')
-rw-r--r--drivers/usb/host/xhci-ext-caps.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-ext-caps.h b/drivers/usb/host/xhci-ext-caps.h
index ecc131c3fe33..78c4edac1db1 100644
--- a/drivers/usb/host/xhci-ext-caps.h
+++ b/drivers/usb/host/xhci-ext-caps.h
@@ -101,12 +101,15 @@ static inline int xhci_find_next_cap_offset(void __iomem *base, int ext_offset)
101 101
102 next = readl(base + ext_offset); 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 /* Find the first extended capability */ 105 /* Find the first extended capability */
106 next = XHCI_HCC_EXT_CAPS(next); 106 next = XHCI_HCC_EXT_CAPS(next);
107 else 107 ext_offset = 0;
108 } else {
108 /* Find the next extended capability */ 109 /* Find the next extended capability */
109 next = XHCI_EXT_CAPS_NEXT(next); 110 next = XHCI_EXT_CAPS_NEXT(next);
111 }
112
110 if (!next) 113 if (!next)
111 return 0; 114 return 0;
112 /* 115 /*