ALSA: usb-audio: Don't avoid stopping the stream at disconnection
authorTakashi Iwai <tiwai@suse.de>
Sat, 6 Feb 2021 20:30:52 +0000 (21:30 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 8 Feb 2021 15:00:16 +0000 (16:00 +0100)
In the later patch, we're going to issue the PCM sync_stop calls at
disconnection.  But currently the USB-audio driver can't handle it
because it has a check of shutdown flag for stopping the URBs.  This
is basically superfluous (the stopping URBs are safe at disconnection
state), so let's drop the check.

Fixes: dc5eafe7787c ("ALSA: usb-audio: Support PCM sync_stop")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210206203052.15606-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/endpoint.c
sound/usb/pcm.c

index 4390075b2c6f04340764348b9f9a1fa388ecccf2..102d53515a76f78e634668d59cca5504de873740 100644 (file)
@@ -890,9 +890,6 @@ static int stop_urbs(struct snd_usb_endpoint *ep, bool force)
 {
        unsigned int i;
 
-       if (!force && atomic_read(&ep->chip->shutdown)) /* to be sure... */
-               return -EBADFD;
-
        if (!force && atomic_read(&ep->running))
                return -EBUSY;
 
index dcadf8f164b293396dbba83f203a0b834f826aa0..bf5a0f3c1fadeb9b24084e7420e5783b39ec1914 100644 (file)
@@ -270,10 +270,7 @@ static int snd_usb_pcm_sync_stop(struct snd_pcm_substream *substream)
 {
        struct snd_usb_substream *subs = substream->runtime->private_data;
 
-       if (!snd_usb_lock_shutdown(subs->stream->chip)) {
-               sync_pending_stops(subs);
-               snd_usb_unlock_shutdown(subs->stream->chip);
-       }
+       sync_pending_stops(subs);
        return 0;
 }