USB: EHCI: keep better track of resuming ports
The ehci-hcd driver isn't as careful as it should be about the way it
uses ehci->resuming_ports. One of the omissions was fixed recently by
commit 47a64a13d5
(USB: EHCI: Fix resume signalling on remote
wakeup), but there are other places that need attention:
When a port's suspend feature is explicitly cleared, the
corresponding bit in resuming_ports should be set and the core
should be notified about the port resume.
We don't need to clear a resuming_ports bit when a reset
completes.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b8bdad6082
commit
3a20446f02
|
@ -801,6 +801,8 @@ static int ehci_hub_control (
|
||||||
ehci_writel(ehci, temp | PORT_RESUME, status_reg);
|
ehci_writel(ehci, temp | PORT_RESUME, status_reg);
|
||||||
ehci->reset_done[wIndex] = jiffies
|
ehci->reset_done[wIndex] = jiffies
|
||||||
+ msecs_to_jiffies(20);
|
+ msecs_to_jiffies(20);
|
||||||
|
set_bit(wIndex, &ehci->resuming_ports);
|
||||||
|
usb_hcd_start_port_resume(&hcd->self, wIndex);
|
||||||
break;
|
break;
|
||||||
case USB_PORT_FEAT_C_SUSPEND:
|
case USB_PORT_FEAT_C_SUSPEND:
|
||||||
clear_bit(wIndex, &ehci->port_c_suspend);
|
clear_bit(wIndex, &ehci->port_c_suspend);
|
||||||
|
@ -911,7 +913,6 @@ static int ehci_hub_control (
|
||||||
ehci->reset_done[wIndex])) {
|
ehci->reset_done[wIndex])) {
|
||||||
status |= USB_PORT_STAT_C_RESET << 16;
|
status |= USB_PORT_STAT_C_RESET << 16;
|
||||||
ehci->reset_done [wIndex] = 0;
|
ehci->reset_done [wIndex] = 0;
|
||||||
clear_bit(wIndex, &ehci->resuming_ports);
|
|
||||||
|
|
||||||
/* force reset to complete */
|
/* force reset to complete */
|
||||||
ehci_writel(ehci, temp & ~(PORT_RWC_BITS | PORT_RESET),
|
ehci_writel(ehci, temp & ~(PORT_RWC_BITS | PORT_RESET),
|
||||||
|
|
Loading…
Reference in a new issue