diff options
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.patch | 97 |
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 @@ | |||
1 | From 37377ccfbb44158128be2372cc9088b6c670e440 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alan Stern <stern@rowland.harvard.edu> | ||
3 | Date: Tue, 24 Apr 2012 14:07:22 -0400 | ||
4 | Subject: [PATCH 113/165] USB: EHCI: fix crash during suspend on ASUS | ||
5 | computers | ||
6 | |||
7 | commit 151b61284776be2d6f02d48c23c3625678960b97 upstream. | ||
8 | |||
9 | This patch (as1545) fixes a problem affecting several ASUS computers: | ||
10 | The machine crashes or corrupts memory when going into suspend if the | ||
11 | ehci-hcd driver is bound to any controllers. Users have been forced | ||
12 | to unbind or unload ehci-hcd before putting their systems to sleep. | ||
13 | |||
14 | After extensive testing, it was determined that the machines don't | ||
15 | like going into suspend when any EHCI controllers are in the PCI D3 | ||
16 | power state. Presumably this is a firmware bug, but there's nothing | ||
17 | we can do about it except to avoid putting the controllers in D3 | ||
18 | during system sleep. | ||
19 | |||
20 | The patch adds a new flag to indicate whether the problem is present, | ||
21 | and avoids changing the controller's power state if the flag is set. | ||
22 | Runtime suspend is unaffected; this matters only for system suspend. | ||
23 | However as a side effect, the controller will not respond to remote | ||
24 | wakeup requests while the system is asleep. Hence USB wakeup is not | ||
25 | functional -- but of course, this is already true in the current state | ||
26 | of affairs. | ||
27 | |||
28 | This fixes Bugzilla #42728. | ||
29 | |||
30 | Signed-off-by: Alan Stern <stern@rowland.harvard.edu> | ||
31 | Tested-by: Steven Rostedt <rostedt@goodmis.org> | ||
32 | Tested-by: Andrey Rahmatullin <wrar@wrar.name> | ||
33 | Tested-by: Oleksij Rempel (fishor) <bug-track@fisher-privat.net> | ||
34 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
35 | [bwh: Backported to 3.2: adjust context] | ||
36 | Signed-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 | |||
43 | diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c | ||
44 | index 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. | ||
63 | diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c | ||
64 | index 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) { | ||
82 | diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h | ||
83 | index 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 | -- | ||
96 | 1.7.7.6 | ||
97 | |||