Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322703
b: refs/heads/master
c: e955a1c
h: refs/heads/master
i:
  322701: f5a1ac3
  322699: 4300042
  322695: d1a38e4
  322687: e3fdb54
v: v3
  • Loading branch information
Matthew Garrett authored and Sarah Sharp committed Sep 5, 2012
1 parent 48d17aa commit 181c293
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 052c7f9ffb0e95843e75448d02664459253f9ff8
refs/heads/master: e955a1cd086de4d165ae0f4c7be7289d84b63bdc
12 changes: 10 additions & 2 deletions trunk/drivers/usb/host/pci-quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,12 +841,12 @@ static void __devinit quirk_usb_handoff_xhci(struct pci_dev *pdev)
void __iomem *op_reg_base;
u32 val;
int timeout;
int len = pci_resource_len(pdev, 0);

if (!mmio_resource_enabled(pdev, 0))
return;

base = ioremap_nocache(pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0));
base = ioremap_nocache(pci_resource_start(pdev, 0), len);
if (base == NULL)
return;

Expand All @@ -856,9 +856,17 @@ static void __devinit quirk_usb_handoff_xhci(struct pci_dev *pdev)
*/
ext_cap_offset = xhci_find_next_cap_offset(base, XHCI_HCC_PARAMS_OFFSET);
do {
if ((ext_cap_offset + sizeof(val)) > len) {
/* We're reading garbage from the controller */
dev_warn(&pdev->dev,
"xHCI controller failing to respond");
return;
}

if (!ext_cap_offset)
/* We've reached the end of the extended capabilities */
goto hc_init;

val = readl(base + ext_cap_offset);
if (XHCI_EXT_CAPS_ID(val) == XHCI_EXT_CAPS_LEGACY)
break;
Expand Down

0 comments on commit 181c293

Please sign in to comment.