Merge tag 'usb-for-v4.1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-testing
Felipe writes: usb: generic resume timeout for v4.1 This part 2 pull request contains only the patches which make sure everybody on linux uses the same resume timeout value. Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
@@ -792,12 +792,12 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd)
|
||||
ehci->reset_done[i] == 0))
|
||||
continue;
|
||||
|
||||
/* start 20 msec resume signaling from this port,
|
||||
* and make hub_wq collect PORT_STAT_C_SUSPEND to
|
||||
* stop that signaling. Use 5 ms extra for safety,
|
||||
* like usb_port_resume() does.
|
||||
/* start USB_RESUME_TIMEOUT msec resume signaling from
|
||||
* this port, and make hub_wq collect
|
||||
* PORT_STAT_C_SUSPEND to stop that signaling.
|
||||
*/
|
||||
ehci->reset_done[i] = jiffies + msecs_to_jiffies(25);
|
||||
ehci->reset_done[i] = jiffies +
|
||||
msecs_to_jiffies(USB_RESUME_TIMEOUT);
|
||||
set_bit(i, &ehci->resuming_ports);
|
||||
ehci_dbg (ehci, "port %d remote wakeup\n", i + 1);
|
||||
usb_hcd_start_port_resume(&hcd->self, i);
|
||||
|
@@ -471,10 +471,13 @@ static int ehci_bus_resume (struct usb_hcd *hcd)
|
||||
ehci_writel(ehci, temp, &ehci->regs->port_status [i]);
|
||||
}
|
||||
|
||||
/* msleep for 20ms only if code is trying to resume port */
|
||||
/*
|
||||
* msleep for USB_RESUME_TIMEOUT ms only if code is trying to resume
|
||||
* port
|
||||
*/
|
||||
if (resume_needed) {
|
||||
spin_unlock_irq(&ehci->lock);
|
||||
msleep(20);
|
||||
msleep(USB_RESUME_TIMEOUT);
|
||||
spin_lock_irq(&ehci->lock);
|
||||
if (ehci->shutdown)
|
||||
goto shutdown;
|
||||
@@ -942,7 +945,7 @@ int ehci_hub_control(
|
||||
temp &= ~PORT_WAKE_BITS;
|
||||
ehci_writel(ehci, temp | PORT_RESUME, status_reg);
|
||||
ehci->reset_done[wIndex] = jiffies
|
||||
+ msecs_to_jiffies(20);
|
||||
+ msecs_to_jiffies(USB_RESUME_TIMEOUT);
|
||||
set_bit(wIndex, &ehci->resuming_ports);
|
||||
usb_hcd_start_port_resume(&hcd->self, wIndex);
|
||||
break;
|
||||
|
@@ -1595,7 +1595,7 @@ static int fotg210_hub_control(
|
||||
/* resume signaling for 20 msec */
|
||||
fotg210_writel(fotg210, temp | PORT_RESUME, status_reg);
|
||||
fotg210->reset_done[wIndex] = jiffies
|
||||
+ msecs_to_jiffies(20);
|
||||
+ msecs_to_jiffies(USB_RESUME_TIMEOUT);
|
||||
break;
|
||||
case USB_PORT_FEAT_C_SUSPEND:
|
||||
clear_bit(wIndex, &fotg210->port_c_suspend);
|
||||
|
@@ -1550,10 +1550,9 @@ static int fusbh200_hub_control (
|
||||
if ((temp & PORT_PE) == 0)
|
||||
goto error;
|
||||
|
||||
/* resume signaling for 20 msec */
|
||||
fusbh200_writel(fusbh200, temp | PORT_RESUME, status_reg);
|
||||
fusbh200->reset_done[wIndex] = jiffies
|
||||
+ msecs_to_jiffies(20);
|
||||
+ msecs_to_jiffies(USB_RESUME_TIMEOUT);
|
||||
break;
|
||||
case USB_PORT_FEAT_C_SUSPEND:
|
||||
clear_bit(wIndex, &fusbh200->port_c_suspend);
|
||||
|
@@ -1490,7 +1490,7 @@ static int isp116x_bus_resume(struct usb_hcd *hcd)
|
||||
spin_unlock_irq(&isp116x->lock);
|
||||
|
||||
hcd->state = HC_STATE_RESUMING;
|
||||
msleep(20);
|
||||
msleep(USB_RESUME_TIMEOUT);
|
||||
|
||||
/* Go operational */
|
||||
spin_lock_irq(&isp116x->lock);
|
||||
|
@@ -2500,11 +2500,12 @@ static irqreturn_t oxu210_hcd_irq(struct usb_hcd *hcd)
|
||||
|| oxu->reset_done[i] != 0)
|
||||
continue;
|
||||
|
||||
/* start 20 msec resume signaling from this port,
|
||||
* and make hub_wq collect PORT_STAT_C_SUSPEND to
|
||||
/* start USB_RESUME_TIMEOUT resume signaling from this
|
||||
* port, and make hub_wq collect PORT_STAT_C_SUSPEND to
|
||||
* stop that signaling.
|
||||
*/
|
||||
oxu->reset_done[i] = jiffies + msecs_to_jiffies(20);
|
||||
oxu->reset_done[i] = jiffies +
|
||||
msecs_to_jiffies(USB_RESUME_TIMEOUT);
|
||||
oxu_dbg(oxu, "port %d remote wakeup\n", i + 1);
|
||||
mod_timer(&hcd->rh_timer, oxu->reset_done[i]);
|
||||
}
|
||||
|
@@ -2301,7 +2301,7 @@ static int r8a66597_bus_resume(struct usb_hcd *hcd)
|
||||
rh->port &= ~USB_PORT_STAT_SUSPEND;
|
||||
rh->port |= USB_PORT_STAT_C_SUSPEND << 16;
|
||||
r8a66597_mdfy(r8a66597, RESUME, RESUME | UACT, dvstctr_reg);
|
||||
msleep(50);
|
||||
msleep(USB_RESUME_TIMEOUT);
|
||||
r8a66597_mdfy(r8a66597, UACT, RESUME | UACT, dvstctr_reg);
|
||||
}
|
||||
|
||||
|
@@ -1259,7 +1259,7 @@ sl811h_hub_control(
|
||||
sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1);
|
||||
|
||||
mod_timer(&sl811->timer, jiffies
|
||||
+ msecs_to_jiffies(20));
|
||||
+ msecs_to_jiffies(USB_RESUME_TIMEOUT));
|
||||
break;
|
||||
case USB_PORT_FEAT_POWER:
|
||||
port_power(sl811, 0);
|
||||
|
@@ -166,7 +166,7 @@ static void uhci_check_ports(struct uhci_hcd *uhci)
|
||||
/* Port received a wakeup request */
|
||||
set_bit(port, &uhci->resuming_ports);
|
||||
uhci->ports_timeout = jiffies +
|
||||
msecs_to_jiffies(25);
|
||||
msecs_to_jiffies(USB_RESUME_TIMEOUT);
|
||||
usb_hcd_start_port_resume(
|
||||
&uhci_to_hcd(uhci)->self, port);
|
||||
|
||||
@@ -338,7 +338,8 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
|
||||
uhci_finish_suspend(uhci, port, port_addr);
|
||||
|
||||
/* USB v2.0 7.1.7.5 */
|
||||
uhci->ports_timeout = jiffies + msecs_to_jiffies(50);
|
||||
uhci->ports_timeout = jiffies +
|
||||
msecs_to_jiffies(USB_RESUME_TIMEOUT);
|
||||
break;
|
||||
case USB_PORT_FEAT_POWER:
|
||||
/* UHCI has no power switching */
|
||||
|
@@ -1574,7 +1574,7 @@ static void handle_port_status(struct xhci_hcd *xhci,
|
||||
} else {
|
||||
xhci_dbg(xhci, "resume HS port %d\n", port_id);
|
||||
bus_state->resume_done[faked_port_index] = jiffies +
|
||||
msecs_to_jiffies(20);
|
||||
msecs_to_jiffies(USB_RESUME_TIMEOUT);
|
||||
set_bit(faked_port_index, &bus_state->resuming_ports);
|
||||
mod_timer(&hcd->rh_timer,
|
||||
bus_state->resume_done[faked_port_index]);
|
||||
|
Reference in New Issue
Block a user