]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.27.46/ehci-fix-bug-in-keeping-track-of-resuming-ports.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.27.46 / ehci-fix-bug-in-keeping-track-of-resuming-ports.patch
1 From stern@rowland.harvard.edu Fri Feb 12 15:37:33 2010
2 From: Alan Stern <stern@rowland.harvard.edu>
3 Date: Mon, 8 Feb 2010 09:43:22 -0500 (EST)
4 Subject: EHCI: fix bug in keeping track of resuming ports
5 To: Greg KH <greg@kroah.com>
6 Cc: Corey Wright <undefined@pobox.com>, stable@kernel.org
7 Message-ID: <Pine.LNX.4.44L0.1002080940430.1809-100000@iolanthe.rowland.org>
8
9
10 This patch fixes a bug caused by backporting commit
11 cec3a53c7fe794237b582e8e77fc0e48465e65ee (USB: EHCI & UHCI: fix race
12 between root-hub suspend and port resume) to 2.6.27.stable without
13 also backporting commit eafe5b99f2135488b21cf17a262c54997c44f784 (USB:
14 EHCI: fix remote-wakeup support for ARC/TDI core). This extracts the
15 necessary changes from the earlier patch and backports them.
16
17 The symptom of the bug is that the system will fail to suspend more
18 than once. The problem is caused by setting ehci->reset_done[i] but
19 never clearing it. When ehci_bus_suspend() sees a nonzero value
20 there, it assumes this means the port is in the middle of resuming so
21 it aborts the bus suspend.
22
23 Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
24 Cc: Corey Wright <undefined@pobox.com>
25 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
26
27 ---
28 drivers/usb/host/ehci-hub.c | 7 ++++---
29 1 file changed, 4 insertions(+), 3 deletions(-)
30
31 --- a/drivers/usb/host/ehci-hub.c
32 +++ b/drivers/usb/host/ehci-hub.c
33 @@ -254,10 +254,8 @@ static int ehci_bus_resume (struct usb_h
34 temp = ehci_readl(ehci, &ehci->regs->port_status [i]);
35 temp &= ~(PORT_RWC_BITS | PORT_WAKE_BITS);
36 if (test_bit(i, &ehci->bus_suspended) &&
37 - (temp & PORT_SUSPEND)) {
38 - ehci->reset_done [i] = jiffies + msecs_to_jiffies (20);
39 + (temp & PORT_SUSPEND))
40 temp |= PORT_RESUME;
41 - }
42 ehci_writel(ehci, temp, &ehci->regs->port_status [i]);
43 }
44 i = HCS_N_PORTS (ehci->hcs_params);
45 @@ -752,6 +750,9 @@ static int ehci_hub_control (
46 ehci_readl(ehci, status_reg));
47 }
48
49 + if (!(temp & (PORT_RESUME|PORT_RESET)))
50 + ehci->reset_done[wIndex] = 0;
51 +
52 /* transfer dedicated ports to the companion hc */
53 if ((temp & PORT_CONNECT) &&
54 test_bit(wIndex, &ehci->companion_ports)) {