Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 122277 | Differences between
and this patch

Collapse All | Expand All

(-)linux/drivers/usb/host/pci-quirks.c.orig (-9 / +44 lines)
Lines 92-97 int uhci_check_and_reset_hc(struct pci_d Link Here
92
	u16 legsup;
92
	u16 legsup;
93
	unsigned int cmd, intr;
93
	unsigned int cmd, intr;
94
94
95
	printk("uhci_check_and_reset_hc()\n");
96
95
	/*
97
	/*
96
	 * When restarting a suspended controller, we expect all the
98
	 * When restarting a suspended controller, we expect all the
97
	 * settings to be the same as we left them:
99
	 * settings to be the same as we left them:
Lines 123-133 int uhci_check_and_reset_hc(struct pci_d Link Here
123
				__FUNCTION__, intr);
125
				__FUNCTION__, intr);
124
		goto reset_needed;
126
		goto reset_needed;
125
	}
127
	}
128
	printk("uhci_check_and_reset_hc() return, no reset needed\n");
126
	return 0;
129
	return 0;
127
130
128
reset_needed:
131
reset_needed:
129
	dev_dbg(&pdev->dev, "Performing full reset\n");
132
	dev_dbg(&pdev->dev, "Performing full reset\n");
130
	uhci_reset_hc(pdev, base);
133
	uhci_reset_hc(pdev, base);
134
	printk("uhci_check_and_reset_hc() return, reset complete\n");
131
	return 1;
135
	return 1;
132
}
136
}
133
EXPORT_SYMBOL_GPL(uhci_check_and_reset_hc);
137
EXPORT_SYMBOL_GPL(uhci_check_and_reset_hc);
Lines 146-153 static void __devinit quirk_usb_handoff_ Link Here
146
	unsigned long base = 0;
150
	unsigned long base = 0;
147
	int i;
151
	int i;
148
152
149
	if (!pio_enabled(pdev))
153
	printk("quirk_usb_handoff_uhci()\n");
154
155
	if (!pio_enabled(pdev)) {
156
		printk("quirk_usb_handoff_uhci() no pio\n");
150
		return;
157
		return;
158
	}
151
159
152
	for (i = 0; i < PCI_ROM_RESOURCE; i++)
160
	for (i = 0; i < PCI_ROM_RESOURCE; i++)
153
		if ((pci_resource_flags(pdev, i) & IORESOURCE_IO)) {
161
		if ((pci_resource_flags(pdev, i) & IORESOURCE_IO)) {
Lines 157-162 static void __devinit quirk_usb_handoff_ Link Here
157
165
158
	if (base)
166
	if (base)
159
		uhci_check_and_reset_hc(pdev, base);
167
		uhci_check_and_reset_hc(pdev, base);
168
169
	printk("quirk_usb_handoff_uhci() complete\n");
160
}
170
}
161
171
162
static int __devinit mmio_resource_enabled(struct pci_dev *pdev, int idx)
172
static int __devinit mmio_resource_enabled(struct pci_dev *pdev, int idx)
Lines 170-181 static void __devinit quirk_usb_handoff_ Link Here
170
	int wait_time;
180
	int wait_time;
171
	u32 control;
181
	u32 control;
172
182
173
	if (!mmio_resource_enabled(pdev, 0))
183
	printk("quirk_usb_handoff_ohci()\n");
184
185
	if (!mmio_resource_enabled(pdev, 0)) {
186
		printk("quirk_usb_handoff_ohci() no mmio\n");
174
		return;
187
		return;
188
	}
175
189
176
	base = ioremap_nocache(pci_resource_start(pdev, 0),
190
	base = ioremap_nocache(pci_resource_start(pdev, 0),
177
				     pci_resource_len(pdev, 0));
191
				     pci_resource_len(pdev, 0));
178
	if (base == NULL) return;
192
	if (base == NULL) {
193
		printk("quirk_usb_handoff_ohci() no base\n");
194
		return;
195
	}
179
196
180
/* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */
197
/* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */
181
#ifndef __hppa__
198
#ifndef __hppa__
Lines 191-198 static void __devinit quirk_usb_handoff_ Link Here
191
		}
208
		}
192
		if (wait_time <= 0)
209
		if (wait_time <= 0)
193
			printk(KERN_WARNING "%s %s: BIOS handoff "
210
			printk(KERN_WARNING "%s %s: BIOS handoff "
194
					"failed (BIOS bug ?)\n",
211
					"failed (BIOS bug ?) %08x\n",
195
					pdev->dev.bus_id, "OHCI");
212
					pdev->dev.bus_id, "OHCI",
213
					readl(base + OHCI_CONTROL));
196
214
197
		/* reset controller, preserving RWC */
215
		/* reset controller, preserving RWC */
198
		writel(control & OHCI_CTRL_RWC, base + OHCI_CONTROL);
216
		writel(control & OHCI_CTRL_RWC, base + OHCI_CONTROL);
Lines 206-211 static void __devinit quirk_usb_handoff_ Link Here
206
	writel(~(u32)0, base + OHCI_INTRSTATUS);
224
	writel(~(u32)0, base + OHCI_INTRSTATUS);
207
225
208
	iounmap(base);
226
	iounmap(base);
227
	printk("quirk_usb_handoff_ohci() complete\n");
209
}
228
}
210
229
211
static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
230
static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
Lines 216-227 static void __devinit quirk_usb_disable_ Link Here
216
	u8	offset, cap_length;
235
	u8	offset, cap_length;
217
	int	count = 256/4;
236
	int	count = 256/4;
218
237
219
	if (!mmio_resource_enabled(pdev, 0))
238
	printk("quirk_usb_disable_ehci()\n");
239
	
240
	if (!mmio_resource_enabled(pdev, 0)) {
241
		printk("quirk_usb_disable_ehci() no mmio\n");
220
		return;
242
		return;
243
	}
221
244
222
	base = ioremap_nocache(pci_resource_start(pdev, 0),
245
	base = ioremap_nocache(pci_resource_start(pdev, 0),
223
				pci_resource_len(pdev, 0));
246
				pci_resource_len(pdev, 0));
224
	if (base == NULL) return;
247
	if (base == NULL) {
248
		printk("quirk_usb_disable_ehci() no base\n");
249
		return;
250
	}
225
251
226
	cap_length = readb(base);
252
	cap_length = readb(base);
227
	op_reg_base = base + cap_length;
253
	op_reg_base = base + cap_length;
Lines 243-248 static void __devinit quirk_usb_disable_ Link Here
243
				pr_debug("%s %s: BIOS handoff\n",
269
				pr_debug("%s %s: BIOS handoff\n",
244
						pdev->dev.bus_id, "EHCI");
270
						pdev->dev.bus_id, "EHCI");
245
271
272
#if 0
273
/* aleksey_gorelov@phoenix.com reports that some systems need SMI forced on,
274
 * but that seems dubious in general (the BIOS left it off intentionally)
275
 * and is known to prevent some systems from booting.  so we won't do this
276
 * unless maybe we can determine when we're on a system that needs SMI forced.
277
 */
246
				/* BIOS workaround (?): be sure the
278
				/* BIOS workaround (?): be sure the
247
				 * pre-Linux code receives the SMI
279
				 * pre-Linux code receives the SMI
248
				 */
280
				 */
Lines 252-257 static void __devinit quirk_usb_disable_ Link Here
252
				pci_write_config_dword(pdev,
284
				pci_write_config_dword(pdev,
253
						offset + EHCI_USBLEGCTLSTS,
285
						offset + EHCI_USBLEGCTLSTS,
254
						val | EHCI_USBLEGCTLSTS_SOOE);
286
						val | EHCI_USBLEGCTLSTS_SOOE);
287
#endif
255
			}
288
			}
256
289
257
			/* always say Linux will own the hardware
290
			/* always say Linux will own the hardware
Lines 274-281 static void __devinit quirk_usb_disable_ Link Here
274
				 * it down, and hope nothing goes too wrong
307
				 * it down, and hope nothing goes too wrong
275
				 */
308
				 */
276
				printk(KERN_WARNING "%s %s: BIOS handoff "
309
				printk(KERN_WARNING "%s %s: BIOS handoff "
277
						"failed (BIOS bug ?)\n",
310
						"failed (BIOS bug ?) %08x\n",
278
					pdev->dev.bus_id, "EHCI");
311
					pdev->dev.bus_id, "EHCI", cap);
279
				pci_write_config_byte(pdev, offset + 2, 0);
312
				pci_write_config_byte(pdev, offset + 2, 0);
280
			}
313
			}
281
314
Lines 326-331 static void __devinit quirk_usb_disable_ Link Here
326
359
327
	iounmap(base);
360
	iounmap(base);
328
361
362
	printk("quirk_usb_disable_ehci() complete\n");
363
329
	return;
364
	return;
330
}
365
}
331
366

Return to bug 122277