summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-04-26 08:33:49 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-07 11:11:25 +0200
commit79c42099a9bcbccb26e1135b7bd7aa88e84eeaf3 (patch)
tree8de02e22f512944f4cb19109cccb564f86a161bc
parent60f3ce18f39741cf4c95491bdc7281be346ac5ac (diff)
ALSA: usb-audio: Fix implicit sync clearance at stopping stream
commit 988cc17552606be67a956cf8cd6ff504cfc5d643 upstream. The recent endpoint management change for implicit feedback mode added a clearance of ep->sync_sink (formerly ep->sync_slave) pointer at snd_usb_endpoint_stop() to assure no leftover for the feedback from the already stopped capture stream. This turned out to cause a regression, however, when full-duplex streams were running and only a capture was stopped. Because of the above clearance of ep->sync_sink pointer, no more feedback is done, hence the playback will stall. This patch fixes the ep->sync_sink clearance to be done only after all endpoints are released, for addressing the regression. Reported-and-tested-by: Lucas Endres <jaffa225man@gmail.com> Fixes: bf6313a0ff76 ("ALSA: usb-audio: Refactor endpoint management") Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20210426063349.18601-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--sound/usb/endpoint.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index 102d53515a76..933586a895e7 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -1442,11 +1442,11 @@ void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep)
if (snd_BUG_ON(!atomic_read(&ep->running)))
return;
- if (ep->sync_source)
- WRITE_ONCE(ep->sync_source->sync_sink, NULL);
-
- if (!atomic_dec_return(&ep->running))
+ if (!atomic_dec_return(&ep->running)) {
+ if (ep->sync_source)
+ WRITE_ONCE(ep->sync_source->sync_sink, NULL);
stop_urbs(ep, false);
+ }
}
/**