All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] ALSA: usb-audio: Don't avoid stopping the stream at" failed to apply to 5.10-stable tree
@ 2021-03-01  9:55 gregkh
  2021-03-15 19:51 ` Sudip Mukherjee
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2021-03-01  9:55 UTC (permalink / raw)
  To: tiwai, stable; +Cc: stable


The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 257d2d7e9e798305d65825cb82b0a7d1c0511e89 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Sat, 6 Feb 2021 21:30:52 +0100
Subject: [PATCH] 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: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210206203052.15606-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index 4390075b2c6f..102d53515a76 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 dcadf8f164b2..bf5a0f3c1fad 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;
 }
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] ALSA: usb-audio: Don't avoid stopping the stream at" failed to apply to 5.10-stable tree
  2021-03-01  9:55 FAILED: patch "[PATCH] ALSA: usb-audio: Don't avoid stopping the stream at" failed to apply to 5.10-stable tree gregkh
@ 2021-03-15 19:51 ` Sudip Mukherjee
  2021-03-19 10:07   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Sudip Mukherjee @ 2021-03-15 19:51 UTC (permalink / raw)
  To: gregkh; +Cc: tiwai, stable

[-- Attachment #1: Type: text/plain, Size: 368 bytes --]

Hi Greg,

On Mon, Mar 01, 2021 at 10:55:57AM +0100, gregkh@linuxfoundation.org wrote:
> 
> The patch below does not apply to the 5.10-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.

Here is the backport.

--
Regards
Sudip

[-- Attachment #2: 0001-ALSA-usb-audio-Don-t-avoid-stopping-the-stream-at-di.patch --]
[-- Type: text/x-diff, Size: 1926 bytes --]

From 7005e6a6d911d3e2f42802ba80b894b49b43cb72 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Sat, 6 Feb 2021 21:30:52 +0100
Subject: [PATCH] ALSA: usb-audio: Don't avoid stopping the stream at
 disconnection

commit 257d2d7e9e798305d65825cb82b0a7d1c0511e89 upstream

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>
[sudip: adjust context]
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
 sound/usb/endpoint.c | 3 ---
 sound/usb/pcm.c      | 5 +----
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index e2f9ce2f5b8b..8527267725bb 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -576,9 +576,6 @@ static int deactivate_urbs(struct snd_usb_endpoint *ep, bool force)
 {
 	unsigned int i;
 
-	if (!force && atomic_read(&ep->chip->shutdown)) /* to be sure... */
-		return -EBADFD;
-
 	clear_bit(EP_FLAG_RUNNING, &ep->flags);
 
 	INIT_LIST_HEAD(&ep->ready_playback_urbs);
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index 1b08f52ef86f..f4494d054917 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -280,10 +280,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;
 }
 
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] ALSA: usb-audio: Don't avoid stopping the stream at" failed to apply to 5.10-stable tree
  2021-03-15 19:51 ` Sudip Mukherjee
@ 2021-03-19 10:07   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2021-03-19 10:07 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: tiwai, stable

On Mon, Mar 15, 2021 at 07:51:34PM +0000, Sudip Mukherjee wrote:
> Hi Greg,
> 
> On Mon, Mar 01, 2021 at 10:55:57AM +0100, gregkh@linuxfoundation.org wrote:
> > 
> > The patch below does not apply to the 5.10-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
> 
> Here is the backport.

Now applied, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-19 10:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-01  9:55 FAILED: patch "[PATCH] ALSA: usb-audio: Don't avoid stopping the stream at" failed to apply to 5.10-stable tree gregkh
2021-03-15 19:51 ` Sudip Mukherjee
2021-03-19 10:07   ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.