diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-11-08 08:52:45 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-11-08 08:56:44 +0100 |
commit | f58161ba1b05a968e5136824b5a16b714b6a5317 (patch) | |
tree | 66a8547463d97e87224b1192135a5921b70e3027 /sound/usb/pcm.c | |
parent | ALSA: hdspm - Fix sync check reporting on RME RayDAT (diff) | |
download | linux-f58161ba1b05a968e5136824b5a16b714b6a5317.tar.xz linux-f58161ba1b05a968e5136824b5a16b714b6a5317.zip |
ALSA: usb-audio: Fix crash at re-preparing the PCM stream
There are bug reports of a crash with USB-audio devices when PCM
prepare is performed immediately after the stream is stopped via
trigger callback. It turned out that the problem is that we don't
wait until all URBs are killed.
This patch adds a new function to synchronize the pending stop
operation on an endpoint, and calls in the prepare callback for
avoiding the crash above.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=49181
Reported-and-tested-by: Artem S. Tashkinov <t.artem@lycos.com>
Cc: <stable@vger.kernel.org> [v3.6]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to '')
-rw-r--r-- | sound/usb/pcm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index 37428f74dbb6..5c12a3fe8c3e 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -568,6 +568,9 @@ static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream) goto unlock; } + snd_usb_endpoint_sync_pending_stop(subs->sync_endpoint); + snd_usb_endpoint_sync_pending_stop(subs->data_endpoint); + ret = set_format(subs, subs->cur_audiofmt); if (ret < 0) goto unlock; |