diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-10-12 15:12:55 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-10-30 11:06:54 +0100 |
commit | 978520b75f0a1ce82b17e1e8186417250de6d545 (patch) | |
tree | 2b0d8619df66706779d9520789e27bf6ca385383 /sound/usb/card.h | |
parent | ALSA: PCM: Fix some races at disconnection (diff) | |
download | linux-978520b75f0a1ce82b17e1e8186417250de6d545.tar.xz linux-978520b75f0a1ce82b17e1e8186417250de6d545.zip |
ALSA: usb-audio: Fix races at disconnection
Close some races at disconnection of a USB audio device by adding the
chip->shutdown_mutex and chip->shutdown check at appropriate places.
The spots to put bandaids are:
- PCM prepare, hw_params and hw_free
- where the usb device is accessed for communication or get speed, in
mixer.c and others; the device speed is now cached in subs->speed
instead of accessing to chip->dev
The accesses in PCM open and close don't need the mutex protection
because these are already handled in the core PCM disconnection code.
The autosuspend/autoresume codes are still uncovered by this patch
because of possible mutex deadlocks. They'll be covered by the
upcoming change to rwsem.
Also the mixer codes are untouched, too. These will be fixed in
another patch, too.
Reported-by: Matthieu CASTET <matthieu.castet@parrot.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/card.h')
-rw-r--r-- | sound/usb/card.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/usb/card.h b/sound/usb/card.h index afa4f9e9b27a..814cb357ff88 100644 --- a/sound/usb/card.h +++ b/sound/usb/card.h @@ -126,6 +126,7 @@ struct snd_usb_substream { struct snd_usb_endpoint *sync_endpoint; unsigned long flags; bool need_setup_ep; /* (re)configure EP at prepare? */ + unsigned int speed; /* USB_SPEED_XXX */ u64 formats; /* format bitmasks (all or'ed) */ unsigned int num_formats; /* number of supported audio formats (list) */ |