]> git.baikalelectronics.ru Git - kernel.git/commit
HID: nintendo: improve subcommand reliability
authorDaniel J. Ogorchock <djogorchock@gmail.com>
Sat, 11 Sep 2021 17:36:29 +0000 (13:36 -0400)
committerJiri Kosina <jkosina@suse.cz>
Wed, 27 Oct 2021 08:05:51 +0000 (10:05 +0200)
commit520e01f21505e9606ba95b4a4de6a7c1179cf416
treeff5d089358ab0e763dd265c6b6854bc4a5bf4ed2
parent17a7e9ec5e654ad2930c5bc04dc44e90666c154e
HID: nintendo: improve subcommand reliability

The controller occasionally doesn't respond to subcommands. It appears
that it's dropping them. To improve reliability, this patch attempts one
retry in the case of a synchronous send timeout. In testing, this has
resolved all timeout failures (most common for LED setting and rumble
setting subcommands).

The 1 second timeout is excessively long for rumble and LED subcommands,
so the timeout has been made a param for joycon_hid_send_sync. Most
subcommands continue to use the 1s timeout, since they can result in
long response times. Rumble and LED setting subcommands have been
reduced to 250ms, since response times for them are much quicker (and
this significantly reduces the observable impact in the case of a retry
being required).

Signed-off-by: Daniel J. Ogorchock <djogorchock@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-nintendo.c