From: Greg KH <gregkh@linuxfoundation.org>
To: Lauri Jakku <lja@iki.fi>
Cc: oneukum@suse.com, benjamin.tissoires@redhat.com,
jikos@kernel.org, linux-input@vger.kernel.org,
linux-usb@vger.kernel.org
Subject: Re: [PATCH v3] USB: HID: random timeout failures tackle try.
Date: Tue, 4 Feb 2020 13:53:49 +0000 [thread overview]
Message-ID: <20200204135349.GA1112714@kroah.com> (raw)
In-Reply-To: <20200204131555.25534-1-lja@iki.fi>
On Tue, Feb 04, 2020 at 03:15:56PM +0200, Lauri Jakku wrote:
> 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 introduce 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. 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 and no timeouts are got.
>
> Why modify usb-hid-core: No need to modify driver by driver.
> At this time i do not know all the USB HID devices that timeouts,
> but what i've researched, there are issues.
>
> Timeout given is divided by 100, but taken care that it is always
> at least 10ms.
>
> so total time in common worst-case-scenario is:
>
> sleep of 20ms + common timeout divided by 100 (50ms) makes
> 70ms per loop, 20 loops => 1.4sec .
>
> Signed-off-by: Lauri Jakku <lja@iki.fi>
> ---
> drivers/usb/core/message.c | 55 ++++++++++++++++++++++++++++++++++----
> 1 file changed, 50 insertions(+), 5 deletions(-)
What changed from v1 and v2?
That always has to be described below the --- line, as documented, to
give us a chance to understand what is happening here and why this is a
new version.
Please fix up and send a v4.
thanks,
greg k-h
next prev parent reply other threads:[~2020-02-04 13:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-04 13:15 [PATCH v3] USB: HID: random timeout failures tackle try Lauri Jakku
2020-02-04 13:53 ` Greg KH [this message]
2020-02-04 16:52 ` kbuild test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200204135349.GA1112714@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=benjamin.tissoires@redhat.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=lja@iki.fi \
--cc=oneukum@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox