aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/core/hcd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 8969e42434b9..c5a2f83991dc 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -582,10 +582,12 @@ void usb_hcd_poll_rh_status(struct usb_hcd *hcd)
582 } 582 }
583 583
584 /* The USB 2.0 spec says 256 ms. This is close enough and won't 584 /* The USB 2.0 spec says 256 ms. This is close enough and won't
585 * exceed that limit if HZ is 100. */ 585 * exceed that limit if HZ is 100. The math is more clunky than
586 * maybe expected, this is to make sure that all timers for USB devices
587 * fire at the same time to give the CPU a break inbetween */
586 if (hcd->uses_new_polling ? hcd->poll_rh : 588 if (hcd->uses_new_polling ? hcd->poll_rh :
587 (length == 0 && hcd->status_urb != NULL)) 589 (length == 0 && hcd->status_urb != NULL))
588 mod_timer (&hcd->rh_timer, jiffies + msecs_to_jiffies(250)); 590 mod_timer (&hcd->rh_timer, (jiffies/(HZ/4) + 1) * (HZ/4));
589} 591}
590EXPORT_SYMBOL_GPL(usb_hcd_poll_rh_status); 592EXPORT_SYMBOL_GPL(usb_hcd_poll_rh_status);
591 593
@@ -614,8 +616,8 @@ static int rh_queue_status (struct usb_hcd *hcd, struct urb *urb)
614 urb->hcpriv = hcd; /* indicate it's queued */ 616 urb->hcpriv = hcd; /* indicate it's queued */
615 617
616 if (!hcd->uses_new_polling) 618 if (!hcd->uses_new_polling)
617 mod_timer (&hcd->rh_timer, jiffies + 619 mod_timer (&hcd->rh_timer,
618 msecs_to_jiffies(250)); 620 (jiffies/(HZ/4) + 1) * (HZ/4));
619 621
620 /* If a status change has already occurred, report it ASAP */ 622 /* If a status change has already occurred, report it ASAP */
621 else if (hcd->poll_pending) 623 else if (hcd->poll_pending)