Files
Prashanth K d1386b496a sound: usb: qmi: Prevent usb_audio_disconnect from getting blocked
Performing USB POPI during audio stream can cause a situation
where usb_audio_disconnect() gets stuck. Consider a scenario,
handle_uaudio_stream_req() increases the usage_count and calls
enable_audio_stream(). If disconnect happens during this time,
usb_audio_disconnect() waits for usage_count) to be zero. And
in the meantime, handle_uaudio_stream_req() will decrease the
usage_count, but usb_audio_disconnect will not proceed since
wake_up() wasn't called.

wait_event() requires wake_up() to be called after changing any
variable that could change the result of the wait condition.
Fix this by calling wake_up() in handle_uaudio_stream_req()
after decreasing the usage_count.

Change-Id: Ia4d8e7ab789d284476dfdd28eb53d81c8ac9b5b8
Signed-off-by: Prashanth K <quic_prashk@quicinc.com>
2023-11-29 02:52:40 -08:00
..
2022-11-03 23:59:18 +09:00