提交 2b7aaf50 编写于 作者: A Alan Stern 提交者: Greg Kroah-Hartman

OHCI: fix regression caused by nVidia shutdown workaround

This patch (as1463) fixes a regression caused by commit
3df7169e (OHCI: work around for nVidia
shutdown problem).

The original problem encountered by people using NVIDIA chipsets was
that USB devices were not turning off when the system shut down.  For
example, the LED on an optical mouse would remain on, draining a
laptop's battery.  The problem was caused by a bug in the chipset; an
OHCI controller in the Reset state would continue to drive a bus reset
signal even after system shutdown.  The workaround was to put the
controllers into the Suspend state instead.

It turns out that later NVIDIA chipsets do not suffer from this bug.
Instead some have the opposite bug: If a system is shut down while an
OHCI controller is in the Suspend state, USB devices remain powered!
On other systems, shutting down with a Suspended controller causes the
system to reboot immediately.  Thus, working around the original bug
on some machines exposes other bugs on other machines.

The best solution seems to be to limit the workaround to OHCI
controllers with a low-numbered PCI product ID.  I don't know exactly
at what point NVIDIA changed their chipsets; the value used here is a
guess.  So far it was worked out okay for all the people who have
tested it.

This fixes Bugzilla #35032.
Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
Tested-by: NAndre "Osku" Schmidt <andre.osku.schmidt@googlemail.com>
Tested-by: NYury Siamashka <yurand2@gmail.com>
CC: <stable@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 e99c4309
...@@ -181,10 +181,18 @@ static int ohci_quirk_amd700(struct usb_hcd *hcd) ...@@ -181,10 +181,18 @@ static int ohci_quirk_amd700(struct usb_hcd *hcd)
*/ */
static int ohci_quirk_nvidia_shutdown(struct usb_hcd *hcd) static int ohci_quirk_nvidia_shutdown(struct usb_hcd *hcd)
{ {
struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
struct ohci_hcd *ohci = hcd_to_ohci(hcd); struct ohci_hcd *ohci = hcd_to_ohci(hcd);
ohci->flags |= OHCI_QUIRK_SHUTDOWN; /* Evidently nVidia fixed their later hardware; this is a guess at
ohci_dbg(ohci, "enabled nVidia shutdown quirk\n"); * the changeover point.
*/
#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_USB 0x026d
if (pdev->device < PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_USB) {
ohci->flags |= OHCI_QUIRK_SHUTDOWN;
ohci_dbg(ohci, "enabled nVidia shutdown quirk\n");
}
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册