History

USB: add NO_D3_DURING_SLEEP flag and revert 151b61284776be2

This patch (as1558) fixes a problem affecting several ASUS computers: The machine crashes or corrupts memory when going into suspend if the ehci-hcd driver is bound to any controllers. Users have been forced to unbind or unload ehci-hcd before putting their systems to sleep. After extensive testing, it was determined that the machines don't like going into suspend when any EHCI controllers are in the PCI D3 power state. Presumably this is a firmware bug, but there's nothing we can do about it except to avoid putting the controllers in D3 during system sleep. The patch adds a new flag to indicate whether the problem is present, and avoids changing the controller's power state if the flag is set. Runtime suspend is unaffected; this matters only for system suspend. However as a side effect, the controller will not respond to remote wakeup requests while the system is asleep. Hence USB wakeup is not functional -- but of course, this is already true in the current state of affairs. A similar patch has already been applied as commit 151b61284776be2d6f02d48c23c3625678960b97 (USB: EHCI: fix crash during suspend on ASUS computers). The patch supersedes that one and reverts it. There are two differences: The old patch added the flag at the USB level; this patch adds it at the PCI level. The old patch applied to all chipsets with the same vendor, subsystem vendor, and product IDs; this patch makes an exception for a known-good system (based on DMI information).

Alan Stern committed 14 years ago

Commit c2fb8a31 parent 0ef0be16 files · +33 −19Browse files

Showing the changes to include/linux (2 of 6 files). Show all

Unified · Split

2 files
  1. include/linux/pci.h +2 −0
  2. include/linux/usb/hcd.h +0 −2
include/linux/pci.h+2−0
@@ -176,6 +176,8 @@ enum pci_dev_flags { · 175 unmodified lines
176176 PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2,
177177 /* Provide indication device is assigned by a Virtual Machine Manager */
178178 PCI_DEV_FLAGS_ASSIGNED = (__force pci_dev_flags_t) 4,
179+ /* Device causes system crash if in D3 during S3 sleep */
180+ PCI_DEV_FLAGS_NO_D3_DURING_SLEEP = (__force pci_dev_flags_t) 8,
179181 };
180182
181183 enum pci_irq_reroute_variant {
include/linux/usb/hcd.h+0−2
@@ -126,8 +126,6 @@ struct usb_hcd { · 125 unmodified lines
126126 unsigned wireless:1; /* Wireless USB HCD */
127127 unsigned authorized_default:1;
128128 unsigned has_tt:1; /* Integrated TT in root hub */
129− unsigned broken_pci_sleep:1; /* Don't put the
130− controller in PCI-D3 for system sleep */
131129
132130 unsigned int irq; /* irq allocated */
133131 void __iomem *regs; /* device memory/io */