]> www.infradead.org Git - users/jedix/linux-maple.git/commit
HID: nintendo: avoid bluetooth suspend/resume stalls
authorDaniel J. Ogorchock <djogorchock@gmail.com>
Tue, 13 May 2025 07:47:00 +0000 (03:47 -0400)
committerJiri Kosina <jkosina@suse.com>
Tue, 10 Jun 2025 19:14:11 +0000 (21:14 +0200)
commit4a0381080397e77792a5168069f174d3e56175ff
treede97a39d69d0bdce5b6ca9668008aa0fbca7d02c
parent85a720f4337f0ddf1603c8b75a8f1ffbbe022ef9
HID: nintendo: avoid bluetooth suspend/resume stalls

Ensure we don't stall or panic the kernel when using bluetooth-connected
controllers. This was reported as an issue on android devices using
kernel 6.6 due to the resume hook which had been added for usb joycons.

First, set a new state value to JOYCON_CTLR_STATE_SUSPENDED in a
newly-added nintendo_hid_suspend. This makes sure we will not stall out
the kernel waiting for input reports during led classdev suspend. The
stalls could happen if connectivity is unreliable or lost to the
controller prior to suspend.

Second, since we lose connectivity during suspend, do not try
joycon_init() for bluetooth controllers in the nintendo_hid_resume path.

Tested via multiple suspend/resume flows when using the controller both
in USB and bluetooth modes.

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