usb: host: ehci: use new USB_RESUME_TIMEOUT
authorFelipe Balbi <balbi@ti.com>
Fri, 13 Feb 2015 20:42:25 +0000 (14:42 -0600)
committerFelipe Balbi <balbi@ti.com>
Tue, 7 Apr 2015 17:58:35 +0000 (12:58 -0500)
Make sure we're using the new macro, so our
resume signaling will always pass certification.

Cc: <stable@vger.kernel.org> # v3.10+
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ehci-hub.c

index 85e56d1abd2307a8620c6fcfa1211a4136f74faf..f4d88dfb26a7e5ca0200620e39210b1080a3f263 100644 (file)
@@ -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);
index 87cf86f38b363ff0f81dd66367769ff594d266bc..7354d0129a72a77891e2a002a5ed3806d788e78c 100644 (file)
@@ -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;