diff options
| -rw-r--r-- | drivers/usb/core/hub.c | 4 | ||||
| -rw-r--r-- | drivers/usb/dwc2/hcd.c | 2 | ||||
| -rw-r--r-- | drivers/usb/host/ehci-hcd.c | 10 | ||||
| -rw-r--r-- | drivers/usb/host/ehci-hub.c | 9 | ||||
| -rw-r--r-- | drivers/usb/host/fotg210-hcd.c | 2 | ||||
| -rw-r--r-- | drivers/usb/host/fusbh200-hcd.c | 3 | ||||
| -rw-r--r-- | drivers/usb/host/isp116x-hcd.c | 2 | ||||
| -rw-r--r-- | drivers/usb/host/oxu210hp-hcd.c | 7 | ||||
| -rw-r--r-- | drivers/usb/host/r8a66597-hcd.c | 2 | ||||
| -rw-r--r-- | drivers/usb/host/sl811-hcd.c | 2 | ||||
| -rw-r--r-- | drivers/usb/host/uhci-hub.c | 5 | ||||
| -rw-r--r-- | drivers/usb/host/xhci-ring.c | 2 | ||||
| -rw-r--r-- | drivers/usb/isp1760/isp1760-hcd.c | 2 | ||||
| -rw-r--r-- | drivers/usb/musb/musb_core.c | 7 | ||||
| -rw-r--r-- | drivers/usb/musb/musb_virthub.c | 2 | ||||
| -rw-r--r-- | include/linux/usb.h | 26 |
16 files changed, 59 insertions, 28 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index d7c3d5a35946..3b7151687776 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
| @@ -3406,10 +3406,10 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg) | |||
| 3406 | if (status) { | 3406 | if (status) { |
| 3407 | dev_dbg(&port_dev->dev, "can't resume, status %d\n", status); | 3407 | dev_dbg(&port_dev->dev, "can't resume, status %d\n", status); |
| 3408 | } else { | 3408 | } else { |
| 3409 | /* drive resume for at least 20 msec */ | 3409 | /* drive resume for USB_RESUME_TIMEOUT msec */ |
| 3410 | dev_dbg(&udev->dev, "usb %sresume\n", | 3410 | dev_dbg(&udev->dev, "usb %sresume\n", |
| 3411 | (PMSG_IS_AUTO(msg) ? "auto-" : "")); | 3411 | (PMSG_IS_AUTO(msg) ? "auto-" : "")); |
| 3412 | msleep(25); | 3412 | msleep(USB_RESUME_TIMEOUT); |
| 3413 | 3413 | ||
| 3414 | /* Virtual root hubs can trigger on GET_PORT_STATUS to | 3414 | /* Virtual root hubs can trigger on GET_PORT_STATUS to |
| 3415 | * stop resume signaling. Then finish the resume | 3415 | * stop resume signaling. Then finish the resume |
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 6f4acfa9252e..93bd4a10ab52 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c | |||
| @@ -1529,7 +1529,7 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq, | |||
| 1529 | dev_dbg(hsotg->dev, | 1529 | dev_dbg(hsotg->dev, |
| 1530 | "ClearPortFeature USB_PORT_FEAT_SUSPEND\n"); | 1530 | "ClearPortFeature USB_PORT_FEAT_SUSPEND\n"); |
| 1531 | writel(0, hsotg->regs + PCGCTL); | 1531 | writel(0, hsotg->regs + PCGCTL); |
| 1532 | usleep_range(20000, 40000); | 1532 | msleep(USB_RESUME_TIMEOUT); |
| 1533 | 1533 | ||
| 1534 | hprt0 = dwc2_read_hprt0(hsotg); | 1534 | hprt0 = dwc2_read_hprt0(hsotg); |
| 1535 | hprt0 |= HPRT0_RES; | 1535 | hprt0 |= HPRT0_RES; |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 85e56d1abd23..f4d88dfb26a7 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
| @@ -792,12 +792,12 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd) | |||
| 792 | ehci->reset_done[i] == 0)) | 792 | ehci->reset_done[i] == 0)) |
| 793 | continue; | 793 | continue; |
| 794 | 794 | ||
| 795 | /* start 20 msec resume signaling from this port, | 795 | /* start USB_RESUME_TIMEOUT msec resume signaling from |
| 796 | * and make hub_wq collect PORT_STAT_C_SUSPEND to | 796 | * this port, and make hub_wq collect |
| 797 | * stop that signaling. Use 5 ms extra for safety, | 797 | * PORT_STAT_C_SUSPEND to stop that signaling. |
| 798 | * like usb_port_resume() does. | ||
| 799 | */ | 798 | */ |
| 800 | ehci->reset_done[i] = jiffies + msecs_to_jiffies(25); | 799 | ehci->reset_done[i] = jiffies + |
| 800 | msecs_to_jiffies(USB_RESUME_TIMEOUT); | ||
| 801 | set_bit(i, &ehci->resuming_ports); | 801 | set_bit(i, &ehci->resuming_ports); |
| 802 | ehci_dbg (ehci, "port %d remote wakeup\n", i + 1); | 802 | ehci_dbg (ehci, "port %d remote wakeup\n", i + 1); |
| 803 | usb_hcd_start_port_resume(&hcd->self, i); | 803 | usb_hcd_start_port_resume(&hcd->self, i); |
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index d7b4b511b5c6..69208447d213 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c | |||
| @@ -471,10 +471,13 @@ static int ehci_bus_resume (struct usb_hcd *hcd) | |||
| 471 | ehci_writel(ehci, temp, &ehci->regs->port_status [i]); | 471 | ehci_writel(ehci, temp, &ehci->regs->port_status [i]); |
| 472 | } | 472 | } |
| 473 | 473 | ||
| 474 | /* msleep for 20ms only if code is trying to resume port */ | 474 | /* |
| 475 | * msleep for USB_RESUME_TIMEOUT ms only if code is trying to resume | ||
| 476 | * port | ||
| 477 | */ | ||
| 475 | if (resume_needed) { | 478 | if (resume_needed) { |
| 476 | spin_unlock_irq(&ehci->lock); | 479 | spin_unlock_irq(&ehci->lock); |
| 477 | msleep(20); | 480 | msleep(USB_RESUME_TIMEOUT); |
| 478 | spin_lock_irq(&ehci->lock); | 481 | spin_lock_irq(&ehci->lock); |
| 479 | if (ehci->shutdown) | 482 | if (ehci->shutdown) |
| 480 | goto shutdown; | 483 | goto shutdown; |
| @@ -942,7 +945,7 @@ int ehci_hub_control( | |||
| 942 | temp &= ~PORT_WAKE_BITS; | 945 | temp &= ~PORT_WAKE_BITS; |
| 943 | ehci_writel(ehci, temp | PORT_RESUME, status_reg); | 946 | ehci_writel(ehci, temp | PORT_RESUME, status_reg); |
| 944 | ehci->reset_done[wIndex] = jiffies | 947 | ehci->reset_done[wIndex] = jiffies |
| 945 | + msecs_to_jiffies(20); | 948 | + msecs_to_jiffies(USB_RESUME_TIMEOUT); |
| 946 | set_bit(wIndex, &ehci->resuming_ports); | 949 | set_bit(wIndex, &ehci->resuming_ports); |
| 947 | usb_hcd_start_port_resume(&hcd->self, wIndex); | 950 | usb_hcd_start_port_resume(&hcd->self, wIndex); |
| 948 | break; | 951 | break; |
diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c index af08ff12954d..000ed80ab592 100644 --- a/drivers/usb/host/fotg210-hcd.c +++ b/drivers/usb/host/fotg210-hcd.c | |||
| @@ -1595,7 +1595,7 @@ static int fotg210_hub_control( | |||
| 1595 | /* resume signaling for 20 msec */ | 1595 | /* resume signaling for 20 msec */ |
| 1596 | fotg210_writel(fotg210, temp | PORT_RESUME, status_reg); | 1596 | fotg210_writel(fotg210, temp | PORT_RESUME, status_reg); |
| 1597 | fotg210->reset_done[wIndex] = jiffies | 1597 | fotg210->reset_done[wIndex] = jiffies |
| 1598 | + msecs_to_jiffies(20); | 1598 | + msecs_to_jiffies(USB_RESUME_TIMEOUT); |
| 1599 | break; | 1599 | break; |
| 1600 | case USB_PORT_FEAT_C_SUSPEND: | 1600 | case USB_PORT_FEAT_C_SUSPEND: |
| 1601 | clear_bit(wIndex, &fotg210->port_c_suspend); | 1601 | clear_bit(wIndex, &fotg210->port_c_suspend); |
diff --git a/drivers/usb/host/fusbh200-hcd.c b/drivers/usb/host/fusbh200-hcd.c index eb39a451ef06..00e492eaba6a 100644 --- a/drivers/usb/host/fusbh200-hcd.c +++ b/drivers/usb/host/fusbh200-hcd.c | |||
| @@ -1550,10 +1550,9 @@ static int fusbh200_hub_control ( | |||
| 1550 | if ((temp & PORT_PE) == 0) | 1550 | if ((temp & PORT_PE) == 0) |
| 1551 | goto error; | 1551 | goto error; |
| 1552 | 1552 | ||
| 1553 | /* resume signaling for 20 msec */ | ||
| 1554 | fusbh200_writel(fusbh200, temp | PORT_RESUME, status_reg); | 1553 | fusbh200_writel(fusbh200, temp | PORT_RESUME, status_reg); |
| 1555 | fusbh200->reset_done[wIndex] = jiffies | 1554 | fusbh200->reset_done[wIndex] = jiffies |
| 1556 | + msecs_to_jiffies(20); | 1555 | + msecs_to_jiffies(USB_RESUME_TIMEOUT); |
| 1557 | break; | 1556 | break; |
| 1558 | case USB_PORT_FEAT_C_SUSPEND: | 1557 | case USB_PORT_FEAT_C_SUSPEND: |
| 1559 | clear_bit(wIndex, &fusbh200->port_c_suspend); | 1558 | clear_bit(wIndex, &fusbh200->port_c_suspend); |
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index aa335fa716d1..13181dcd9820 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c | |||
| @@ -1490,7 +1490,7 @@ static int isp116x_bus_resume(struct usb_hcd *hcd) | |||
| 1490 | spin_unlock_irq(&isp116x->lock); | 1490 | spin_unlock_irq(&isp116x->lock); |
| 1491 | 1491 | ||
| 1492 | hcd->state = HC_STATE_RESUMING; | 1492 | hcd->state = HC_STATE_RESUMING; |
| 1493 | msleep(20); | 1493 | msleep(USB_RESUME_TIMEOUT); |
| 1494 | 1494 | ||
| 1495 | /* Go operational */ | 1495 | /* Go operational */ |
| 1496 | spin_lock_irq(&isp116x->lock); | 1496 | spin_lock_irq(&isp116x->lock); |
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c index 681ce57bf7b9..6352f54e65a1 100644 --- a/drivers/usb/host/oxu210hp-hcd.c +++ b/drivers/usb/host/oxu210hp-hcd.c | |||
| @@ -2500,11 +2500,12 @@ static irqreturn_t oxu210_hcd_irq(struct usb_hcd *hcd) | |||
| 2500 | || oxu->reset_done[i] != 0) | 2500 | || oxu->reset_done[i] != 0) |
| 2501 | continue; | 2501 | continue; |
| 2502 | 2502 | ||
| 2503 | /* start 20 msec resume signaling from this port, | 2503 | /* start USB_RESUME_TIMEOUT resume signaling from this |
| 2504 | * and make hub_wq collect PORT_STAT_C_SUSPEND to | 2504 | * port, and make hub_wq collect PORT_STAT_C_SUSPEND to |
| 2505 | * stop that signaling. | 2505 | * stop that signaling. |
| 2506 | */ | 2506 | */ |
| 2507 | oxu->reset_done[i] = jiffies + msecs_to_jiffies(20); | 2507 | oxu->reset_done[i] = jiffies + |
| 2508 | msecs_to_jiffies(USB_RESUME_TIMEOUT); | ||
| 2508 | oxu_dbg(oxu, "port %d remote wakeup\n", i + 1); | 2509 | oxu_dbg(oxu, "port %d remote wakeup\n", i + 1); |
| 2509 | mod_timer(&hcd->rh_timer, oxu->reset_done[i]); | 2510 | mod_timer(&hcd->rh_timer, oxu->reset_done[i]); |
| 2510 | } | 2511 | } |
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index 5cbaa9846ab9..4cbd0633c5c2 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c | |||
| @@ -2301,7 +2301,7 @@ static int r8a66597_bus_resume(struct usb_hcd *hcd) | |||
| 2301 | rh->port &= ~USB_PORT_STAT_SUSPEND; | 2301 | rh->port &= ~USB_PORT_STAT_SUSPEND; |
| 2302 | rh->port |= USB_PORT_STAT_C_SUSPEND << 16; | 2302 | rh->port |= USB_PORT_STAT_C_SUSPEND << 16; |
| 2303 | r8a66597_mdfy(r8a66597, RESUME, RESUME | UACT, dvstctr_reg); | 2303 | r8a66597_mdfy(r8a66597, RESUME, RESUME | UACT, dvstctr_reg); |
| 2304 | msleep(50); | 2304 | msleep(USB_RESUME_TIMEOUT); |
| 2305 | r8a66597_mdfy(r8a66597, UACT, RESUME | UACT, dvstctr_reg); | 2305 | r8a66597_mdfy(r8a66597, UACT, RESUME | UACT, dvstctr_reg); |
| 2306 | } | 2306 | } |
| 2307 | 2307 | ||
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index 53e4fb75b04c..fd2a11473be7 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c | |||
| @@ -1259,7 +1259,7 @@ sl811h_hub_control( | |||
| 1259 | sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); | 1259 | sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); |
| 1260 | 1260 | ||
| 1261 | mod_timer(&sl811->timer, jiffies | 1261 | mod_timer(&sl811->timer, jiffies |
| 1262 | + msecs_to_jiffies(20)); | 1262 | + msecs_to_jiffies(USB_RESUME_TIMEOUT)); |
| 1263 | break; | 1263 | break; |
| 1264 | case USB_PORT_FEAT_POWER: | 1264 | case USB_PORT_FEAT_POWER: |
