aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hid/usbhid/hid-core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 7c0fc11e972a..35a41e60f541 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -554,6 +554,11 @@ static void hid_io_error(struct hid_device *hid)
554 if (usb_get_intfdata(usbhid->intf) == NULL) 554 if (usb_get_intfdata(usbhid->intf) == NULL)
555 goto done; 555 goto done;
556 556
557 /* If it has been a while since the last error, we'll assume
558 * this a brand new error and reset the retry timeout. */
559 if (time_after(jiffies, usbhid->stop_retry + HZ/2))
560 usbhid->retry_delay = 0;
561
557 /* When an error occurs, retry at increasing intervals */ 562 /* When an error occurs, retry at increasing intervals */
558 if (usbhid->retry_delay == 0) { 563 if (usbhid->retry_delay == 0) {
559 usbhid->retry_delay = 13; /* Then 26, 52, 104, 104, ... */ 564 usbhid->retry_delay = 13; /* Then 26, 52, 104, 104, ... */