diff options
author | Takashi Iwai <tiwai@suse.de> | 2021-02-06 21:30:51 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2021-02-08 16:00:06 +0100 |
commit | 5c2b301476ec493be15546f05e23414e2aa9d472 (patch) | |
tree | b836b5bc2b61a7d0f8e49d8bfebf323615d79393 /sound/usb/pcm.c | |
parent | d6cda4655e2a7612a1e48c49795a5330abc01c5a (diff) |
ALSA: usb-audio: More strict state change in EP
The endpoint management has bit flags to indicate the current state,
and we're dealing two things: the running bit and the stopping bit.
There is a thin window in transition from the running to the stopping
in stop_urbs(), and as long as the bit flags are used, it's difficult
to plug.
This patch modifies the state management code to use the atomic int
and follow the explicit three states, STOPPED, RUNNING and STOPPING.
The state change is done via atomic_cmpxhg() for avoiding possible
races, and check the state change more strictly. The unexpected state
change is now handled as an error.
Fixes: d0f09d1e4a88 ("ALSA: usb-audio: Refactoring endpoint URB deactivation")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210206203052.15606-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/pcm.c')
0 files changed, 0 insertions, 0 deletions