aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-pci.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2010-09-10 16:37:05 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 13:21:36 -0400
commit3df7169e73fc1d71a39cffeacc969f6840cdf52b (patch)
tree8d8eb044f3c3cc723b0a08563311317b8ccea0bf /drivers/usb/host/ohci-pci.c
parent637ed74ff9e86d8c2979e430309a1fd28c921de9 (diff)
OHCI: work around for nVidia shutdown problem
This patch (as1417) fixes a problem affecting some (or all) nVidia chipsets. When the computer is shut down, the OHCI controllers continue to power the USB buses and evidently they drive a Reset signal out all their ports. This prevents attached devices from going to low power. Mouse LEDs stay on, for example, which is disconcerting for users and a drain on laptop batteries. The fix involves leaving each OHCI controller in the OPERATIONAL state during system shutdown rather than putting it in the RESET state. Although this nominally means the controller is running, in fact it's not doing very much since all the schedules are all disabled. However there is ongoing DMA to the Host Controller Communications Area, so the patch also disables the bus-master capability of all PCI USB controllers after the shutdown routine runs. The fix is applied only to nVidia-based PCI OHCI controllers, so it shouldn't cause problems on systems using other hardware. As an added safety measure, in case the kernel encounters one of these running controllers during boot, the patch changes quirk_usb_handoff_ohci() (which runs early on during PCI discovery) to reset the controller before anything bad can happen. Reported-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: David Brownell <david-b@pacbell.net> Tested-by: Pali Rohár <pali.rohar@gmail.com> CC: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ohci-pci.c')
-rw-r--r--drivers/usb/host/ohci-pci.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
index 6bdc8b25a6a1..36ee9a666e93 100644
--- a/drivers/usb/host/ohci-pci.c
+++ b/drivers/usb/host/ohci-pci.c
@@ -201,6 +201,20 @@ static int ohci_quirk_amd700(struct usb_hcd *hcd)
201 return 0; 201 return 0;
202} 202}
203 203
204/* nVidia controllers continue to drive Reset signalling on the bus
205 * even after system shutdown, wasting power. This flag tells the
206 * shutdown routine to leave the controller OPERATIONAL instead of RESET.
207 */
208static int ohci_quirk_nvidia_shutdown(struct usb_hcd *hcd)
209{
210 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
211
212 ohci->flags |= OHCI_QUIRK_SHUTDOWN;
213 ohci_dbg(ohci, "enabled nVidia shutdown quirk\n");
214
215 return 0;
216}
217
204/* 218/*
205 * The hardware normally enables the A-link power management feature, which 219 * The hardware normally enables the A-link power management feature, which
206 * lets the system lower the power consumption in idle states. 220 * lets the system lower the power consumption in idle states.
@@ -332,6 +346,10 @@ static const struct pci_device_id ohci_pci_quirks[] = {
332 PCI_DEVICE(PCI_VENDOR_ID_ATI, 0x4399), 346 PCI_DEVICE(PCI_VENDOR_ID_ATI, 0x4399),
333 .driver_data = (unsigned long)ohci_quirk_amd700, 347 .driver_data = (unsigned long)ohci_quirk_amd700,
334 }, 348 },
349 {
350 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID),
351 .driver_data = (unsigned long) ohci_quirk_nvidia_shutdown,
352 },
335 353
336 /* FIXME for some of the early AMD 760 southbridges, OHCI 354 /* FIXME for some of the early AMD 760 southbridges, OHCI
337 * won't work at all. blacklist them. 355 * won't work at all. blacklist them.