Re: [PATCH] HID: sony: fix sleeping in atomic context in RB3 Pro raw event handler
From: Jiri Kosina
Date: Thu Nov 19 2026 - 16:05:57 EST
On Sun, 8 Nov 2026, Sanjay Govind wrote:
> Rock Band 3 Pro instruments only send navigation reports until they
> receive a magic SET_REPORT feature request. When such a report is seen,
> rb3_pro_instrument_raw_event() sends that request directly through
> rb3_pro_instrument_enable_full_report(), which does a GFP_KERNEL
> allocation and a synchronous hid_hw_raw_request().
>
> The raw event handler is called from the URB completion handler in
> softirq context, and on USB hid_hw_raw_request() ends up in
> usb_control_msg(), which sleeps. Plugging in an RB3 Pro instrument
> therefore triggers:
>
> BUG: scheduling while atomic
> ...
> softirq: huh, entered softirq 0 HI ... preempt_count 101, exited with 0
>
> This was reported on a Mustang guitar (12ba:2430).
>
> Move the request to process context by registering
> rb3_pro_instrument_enable_full_report() as the send_output_report
> callback of the existing state worker. The raw event handler now only
> schedules the work, keeping the 8 second rate limit. The state worker
> is already cancelled by sony_cleanup() on remove and on probe failure,
> and sony_schedule_work() is a no-op once cancellation has started, so
> no new teardown is needed.
>
> Fixes: 7245b0017d12 ("HID: sony: add support for more instruments")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Sanjay Govind <sanjay.govind9@xxxxxxxxx>
Applied, thanks.
--
Jiri Kosina
SUSE Labs