From: Takashi Iwai Date: Sat, 6 Feb 2021 20:30:52 +0000 (+0100) Subject: ALSA: usb-audio: Don't avoid stopping the stream at disconnection X-Git-Tag: iomap-folio-5.17-old~2030^2~3^2~7 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=257d2d7e9e798305d65825cb82b0a7d1c0511e89;p=users%2Fwilly%2Flinux.git ALSA: usb-audio: Don't avoid stopping the stream at disconnection 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: Link: https://lore.kernel.org/r/20210206203052.15606-4-tiwai@suse.de Signed-off-by: Takashi Iwai --- diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 4390075b2c6f0..102d53515a76f 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -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; diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index dcadf8f164b29..bf5a0f3c1fade 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -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; }