diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-07-14 09:19:37 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-07-14 09:19:37 -0400 |
commit | 4d0e677523a999e1dec28e55cc314c47ba09ca12 (patch) | |
tree | d96caef9f0fd2a74ccc7c681603c12d8ed06574e | |
parent | d1f15e06b2af57228d11e33e06a172ff58f5bc1c (diff) |
ALSA: line6: Fix -EBUSY error during active monitoring
When a monitor stream is active, the next PCM stream access results in
EBUSY error because of the check in line6_stream_start(). Fix this by
just skipping the submission of pending URBs when the stream is
already running instead.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=101431
Cc: <stable@vger.kernel.org> # v4.0+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/usb/line6/pcm.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/sound/usb/line6/pcm.c b/sound/usb/line6/pcm.c index 8461d6bf992f..204cc074adb9 100644 --- a/sound/usb/line6/pcm.c +++ b/sound/usb/line6/pcm.c | |||
@@ -186,12 +186,8 @@ static int line6_stream_start(struct snd_line6_pcm *line6pcm, int direction, | |||
186 | int ret = 0; | 186 | int ret = 0; |
187 | 187 | ||
188 | spin_lock_irqsave(&pstr->lock, flags); | 188 | spin_lock_irqsave(&pstr->lock, flags); |
189 | if (!test_and_set_bit(type, &pstr->running)) { | 189 | if (!test_and_set_bit(type, &pstr->running) && |
190 | if (pstr->active_urbs || pstr->unlink_urbs) { | 190 | !(pstr->active_urbs || pstr->unlink_urbs)) { |
191 | ret = -EBUSY; | ||
192 | goto error; | ||
193 | } | ||
194 | |||
195 | pstr->count = 0; | 191 | pstr->count = 0; |
196 | /* Submit all currently available URBs */ | 192 | /* Submit all currently available URBs */ |
197 | if (direction == SNDRV_PCM_STREAM_PLAYBACK) | 193 | if (direction == SNDRV_PCM_STREAM_PLAYBACK) |
@@ -199,7 +195,6 @@ static int line6_stream_start(struct snd_line6_pcm *line6pcm, int direction, | |||
199 | else | 195 | else |
200 | ret = line6_submit_audio_in_all_urbs(line6pcm); | 196 | ret = line6_submit_audio_in_all_urbs(line6pcm); |
201 | } | 197 | } |
202 | error: | ||
203 | if (ret < 0) | 198 | if (ret < 0) |
204 | clear_bit(type, &pstr->running); | 199 | clear_bit(type, &pstr->running); |
205 | spin_unlock_irqrestore(&pstr->lock, flags); | 200 | spin_unlock_irqrestore(&pstr->lock, flags); |