Re: [PATCH v5] USB: HID: random timeout failures tackle try.
From: Alan Stern <stern@rowland.harvard.edu>
Date: 2020-02-04 18:07:33
Also in:
linux-usb
On Tue, 4 Feb 2020, Lauri Jakku wrote:
-- v1 ------------------------------------------------------------
send, 20ms apart, control messages, if error is timeout.
There is multiple reports of random behaviour of USB HID devices.
I have mouse that acts sometimes quite randomly, I debugged with
logs others have published that there is HW timeouts that leave
device in state that it is errorneus.
To fix this I introduced retry mechanism in root of USB HID drivers.
Fix does not slow down operations at all if there is no -ETIMEDOUT
got from control message sending. If there is one, then sleep 20ms
and try again. Retry count is 20 witch translates maximium of 400ms
before giving up.
NOTE: This does not sleep anymore then before, if all is golden.
-- v2 ------------------------------------------------------------
If there is timeout, then sleep 20ms and try again. Retry count is 20
witch translates maximium of 400ms before giving up. If the 400ms
boundary is reached the HW is really bad.
JUST to be clear:
This does not make USB HID devices to sleep anymore than
before, if all is golden.
Why modify usb-hid-core: No need to modify driver by driver.Please note: Your patch does _not_ modify usb-hid-core (that is, drivers/hid/usbhid). It modifies usb-core (that is, drivers/usb/core). Alan Stern