Commit d0f2fb25 authored by Wang Zhi's avatar Wang Zhi Committed by Greg Kroah-Hartman

USB: EHCI: Do not rely on PORT_SUSPEND to stop USB resuming in ehci_bus_resume().

From EHCI Spec p.28 HC should clear PORT_SUSPEND when SW clears
PORT_RESUME. In Intel Oaktrail platform, MPH (Multi-Port Host
Controller) core clears PORT_SUSPEND directly when SW sets PORT_RESUME
bit. If we rely on PORT_SUSPEND bit to stop USB resume, we will miss
the action of clearing PORT_RESUME. This will cause unexpected long
resume signal on USB bus.
Signed-off-by: default avatarWang Zhi <zhi.wang@windriver.com>
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7e180584
...@@ -343,7 +343,7 @@ static int ehci_bus_resume (struct usb_hcd *hcd) ...@@ -343,7 +343,7 @@ static int ehci_bus_resume (struct usb_hcd *hcd)
u32 temp; u32 temp;
u32 power_okay; u32 power_okay;
int i; int i;
u8 resume_needed = 0; unsigned long resume_needed = 0;
if (time_before (jiffies, ehci->next_statechange)) if (time_before (jiffies, ehci->next_statechange))
msleep(5); msleep(5);
...@@ -416,7 +416,7 @@ static int ehci_bus_resume (struct usb_hcd *hcd) ...@@ -416,7 +416,7 @@ static int ehci_bus_resume (struct usb_hcd *hcd)
if (test_bit(i, &ehci->bus_suspended) && if (test_bit(i, &ehci->bus_suspended) &&
(temp & PORT_SUSPEND)) { (temp & PORT_SUSPEND)) {
temp |= PORT_RESUME; temp |= PORT_RESUME;
resume_needed = 1; set_bit(i, &resume_needed);
} }
ehci_writel(ehci, temp, &ehci->regs->port_status [i]); ehci_writel(ehci, temp, &ehci->regs->port_status [i]);
} }
...@@ -431,8 +431,7 @@ static int ehci_bus_resume (struct usb_hcd *hcd) ...@@ -431,8 +431,7 @@ static int ehci_bus_resume (struct usb_hcd *hcd)
i = HCS_N_PORTS (ehci->hcs_params); i = HCS_N_PORTS (ehci->hcs_params);
while (i--) { while (i--) {
temp = ehci_readl(ehci, &ehci->regs->port_status [i]); temp = ehci_readl(ehci, &ehci->regs->port_status [i]);
if (test_bit(i, &ehci->bus_suspended) && if (test_bit(i, &resume_needed)) {
(temp & PORT_SUSPEND)) {
temp &= ~(PORT_RWC_BITS | PORT_RESUME); temp &= ~(PORT_RWC_BITS | PORT_RESUME);
ehci_writel(ehci, temp, &ehci->regs->port_status [i]); ehci_writel(ehci, temp, &ehci->regs->port_status [i]);
ehci_vdbg (ehci, "resumed port %d\n", i + 1); ehci_vdbg (ehci, "resumed port %d\n", i + 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment