summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0113-USB-EHCI-fix-crash-during-suspend-on-ASUS-computers.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0113-USB-EHCI-fix-crash-during-suspend-on-ASUS-computers.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0113-USB-EHCI-fix-crash-during-suspend-on-ASUS-computers.patch97
1 files changed, 97 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0113-USB-EHCI-fix-crash-during-suspend-on-ASUS-computers.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0113-USB-EHCI-fix-crash-during-suspend-on-ASUS-computers.patch
new file mode 100644
index 00000000..ddf3dcf2
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0113-USB-EHCI-fix-crash-during-suspend-on-ASUS-computers.patch
@@ -0,0 +1,97 @@
1From 37377ccfbb44158128be2372cc9088b6c670e440 Mon Sep 17 00:00:00 2001
2From: Alan Stern <stern@rowland.harvard.edu>
3Date: Tue, 24 Apr 2012 14:07:22 -0400
4Subject: [PATCH 113/165] USB: EHCI: fix crash during suspend on ASUS
5 computers
6
7commit 151b61284776be2d6f02d48c23c3625678960b97 upstream.
8
9This patch (as1545) fixes a problem affecting several ASUS computers:
10The machine crashes or corrupts memory when going into suspend if the
11ehci-hcd driver is bound to any controllers. Users have been forced
12to unbind or unload ehci-hcd before putting their systems to sleep.
13
14After extensive testing, it was determined that the machines don't
15like going into suspend when any EHCI controllers are in the PCI D3
16power state. Presumably this is a firmware bug, but there's nothing
17we can do about it except to avoid putting the controllers in D3
18during system sleep.
19
20The patch adds a new flag to indicate whether the problem is present,
21and avoids changing the controller's power state if the flag is set.
22Runtime suspend is unaffected; this matters only for system suspend.
23However as a side effect, the controller will not respond to remote
24wakeup requests while the system is asleep. Hence USB wakeup is not
25functional -- but of course, this is already true in the current state
26of affairs.
27
28This fixes Bugzilla #42728.
29
30Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
31Tested-by: Steven Rostedt <rostedt@goodmis.org>
32Tested-by: Andrey Rahmatullin <wrar@wrar.name>
33Tested-by: Oleksij Rempel (fishor) <bug-track@fisher-privat.net>
34Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
35[bwh: Backported to 3.2: adjust context]
36Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
37---
38 drivers/usb/core/hcd-pci.c | 9 +++++++++
39 drivers/usb/host/ehci-pci.c | 8 ++++++++
40 include/linux/usb/hcd.h | 2 ++
41 3 files changed, 19 insertions(+), 0 deletions(-)
42
43diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
44index 61d08dd..5f1404a 100644
45--- a/drivers/usb/core/hcd-pci.c
46+++ b/drivers/usb/core/hcd-pci.c
47@@ -495,6 +495,15 @@ static int hcd_pci_suspend_noirq(struct device *dev)
48
49 pci_save_state(pci_dev);
50
51+ /*
52+ * Some systems crash if an EHCI controller is in D3 during
53+ * a sleep transition. We have to leave such controllers in D0.
54+ */
55+ if (hcd->broken_pci_sleep) {
56+ dev_dbg(dev, "Staying in PCI D0\n");
57+ return retval;
58+ }
59+
60 /* If the root hub is dead rather than suspended, disallow remote
61 * wakeup. usb_hc_died() should ensure that both hosts are marked as
62 * dying, so we only need to check the primary roothub.
63diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
64index f4b627d..971d312 100644
65--- a/drivers/usb/host/ehci-pci.c
66+++ b/drivers/usb/host/ehci-pci.c
67@@ -144,6 +144,14 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
68 hcd->has_tt = 1;
69 tdi_reset(ehci);
70 }
71+ if (pdev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK) {
72+ /* EHCI #1 or #2 on 6 Series/C200 Series chipset */
73+ if (pdev->device == 0x1c26 || pdev->device == 0x1c2d) {
74+ ehci_info(ehci, "broken D3 during system sleep on ASUS\n");
75+ hcd->broken_pci_sleep = 1;
76+ device_set_wakeup_capable(&pdev->dev, false);
77+ }
78+ }
79 break;
80 case PCI_VENDOR_ID_TDI:
81 if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {
82diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
83index 03354d5..64cec8d 100644
84--- a/include/linux/usb/hcd.h
85+++ b/include/linux/usb/hcd.h
86@@ -128,6 +128,8 @@ struct usb_hcd {
87 unsigned wireless:1; /* Wireless USB HCD */
88 unsigned authorized_default:1;
89 unsigned has_tt:1; /* Integrated TT in root hub */
90+ unsigned broken_pci_sleep:1; /* Don't put the
91+ controller in PCI-D3 for system sleep */
92
93 int irq; /* irq allocated */
94 void __iomem *regs; /* device memory/io */
95--
961.7.7.6
97