diff options
Diffstat (limited to 'drivers/usb/host/pci-quirks.c')
-rw-r--r-- | drivers/usb/host/pci-quirks.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index 8ee5c3ed4cd6..49f7381a6fd3 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c | |||
@@ -60,6 +60,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_2, qui | |||
60 | #define OHCI_INTRENABLE 0x10 | 60 | #define OHCI_INTRENABLE 0x10 |
61 | #define OHCI_INTRDISABLE 0x14 | 61 | #define OHCI_INTRDISABLE 0x14 |
62 | #define OHCI_OCR (1 << 3) /* ownership change request */ | 62 | #define OHCI_OCR (1 << 3) /* ownership change request */ |
63 | #define OHCI_CTRL_RWC (1 << 9) /* remote wakeup connected */ | ||
63 | #define OHCI_CTRL_IR (1 << 8) /* interrupt routing */ | 64 | #define OHCI_CTRL_IR (1 << 8) /* interrupt routing */ |
64 | #define OHCI_INTR_OC (1 << 30) /* ownership change */ | 65 | #define OHCI_INTR_OC (1 << 30) /* ownership change */ |
65 | 66 | ||
@@ -140,13 +141,17 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev) | |||
140 | { | 141 | { |
141 | void __iomem *base; | 142 | void __iomem *base; |
142 | int wait_time; | 143 | int wait_time; |
144 | u32 control; | ||
143 | 145 | ||
144 | base = ioremap_nocache(pci_resource_start(pdev, 0), | 146 | base = ioremap_nocache(pci_resource_start(pdev, 0), |
145 | pci_resource_len(pdev, 0)); | 147 | pci_resource_len(pdev, 0)); |
146 | if (base == NULL) return; | 148 | if (base == NULL) return; |
147 | 149 | ||
148 | if (readl(base + OHCI_CONTROL) & OHCI_CTRL_IR) { | 150 | /* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */ |
149 | wait_time = 500; /* 0.5 seconds */ | 151 | #ifndef __hppa__ |
152 | control = readl(base + OHCI_CONTROL); | ||
153 | if (control & OHCI_CTRL_IR) { | ||
154 | wait_time = 500; /* arbitrary; 5 seconds */ | ||
150 | writel(OHCI_INTR_OC, base + OHCI_INTRENABLE); | 155 | writel(OHCI_INTR_OC, base + OHCI_INTRENABLE); |
151 | writel(OHCI_OCR, base + OHCI_CMDSTATUS); | 156 | writel(OHCI_OCR, base + OHCI_CMDSTATUS); |
152 | while (wait_time > 0 && | 157 | while (wait_time > 0 && |
@@ -154,7 +159,15 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev) | |||
154 | wait_time -= 10; | 159 | wait_time -= 10; |
155 | msleep(10); | 160 | msleep(10); |
156 | } | 161 | } |
162 | if (wait_time <= 0) | ||
163 | printk(KERN_WARNING "%s %s: early BIOS handoff " | ||
164 | "failed (BIOS bug ?)\n", | ||
165 | pdev->dev.bus_id, "OHCI"); | ||
166 | |||
167 | /* reset controller, preserving RWC */ | ||
168 | writel(control & OHCI_CTRL_RWC, base + OHCI_CONTROL); | ||
157 | } | 169 | } |
170 | #endif | ||
158 | 171 | ||
159 | /* | 172 | /* |
160 | * disable interrupts | 173 | * disable interrupts |
@@ -211,8 +224,9 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev) | |||
211 | /* | 224 | /* |
212 | * well, possibly buggy BIOS... | 225 | * well, possibly buggy BIOS... |
213 | */ | 226 | */ |
214 | printk(KERN_WARNING "EHCI early BIOS handoff " | 227 | printk(KERN_WARNING "%s %s: early BIOS handoff " |
215 | "failed (BIOS bug ?)\n"); | 228 | "failed (BIOS bug ?)\n", |
229 | pdev->dev.bus_id, "EHCI"); | ||
216 | pci_write_config_dword(pdev, | 230 | pci_write_config_dword(pdev, |
217 | hcc_params + EHCI_USBLEGSUP, | 231 | hcc_params + EHCI_USBLEGSUP, |
218 | EHCI_USBLEGSUP_OS); | 232 | EHCI_USBLEGSUP_OS); |