diff options
author | Takashi Iwai <tiwai@suse.de> | 2023-03-24 14:52:03 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2023-03-24 14:52:10 +0100 |
commit | a7a0dcdff41700d4dfc347a6d7786d8e695994e5 (patch) | |
tree | a0fc79d7a7123062c9937e9467288cb3ca99b5b3 /sound/usb/endpoint.c | |
parent | 2c7598903f18418aa18d11a9dd081acb22e9e108 (diff) | |
parent | fa4e7a6fa12b1132340785e14bd439cbe95b7a5a (diff) |
Merge branch 'for-linus' into for-next
Back-merge of 6.3 devel branch for further changes of PCM and
documentation.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/endpoint.c')
-rw-r--r-- | sound/usb/endpoint.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 1e0af1179ca8..25563a5093c5 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -455,8 +455,8 @@ static void push_back_to_ready_list(struct snd_usb_endpoint *ep, * This function is used both for implicit feedback endpoints and in low- * latency playback mode. */ -void snd_usb_queue_pending_output_urbs(struct snd_usb_endpoint *ep, - bool in_stream_lock) +int snd_usb_queue_pending_output_urbs(struct snd_usb_endpoint *ep, + bool in_stream_lock) { bool implicit_fb = snd_usb_endpoint_implicit_feedback_sink(ep); @@ -480,7 +480,7 @@ void snd_usb_queue_pending_output_urbs(struct snd_usb_endpoint *ep, spin_unlock_irqrestore(&ep->lock, flags); if (ctx == NULL) - return; + break; /* copy over the length information */ if (implicit_fb) { @@ -495,11 +495,14 @@ void snd_usb_queue_pending_output_urbs(struct snd_usb_endpoint *ep, break; if (err < 0) { /* push back to ready list again for -EAGAIN */ - if (err == -EAGAIN) + if (err == -EAGAIN) { push_back_to_ready_list(ep, ctx); - else + break; + } + + if (!in_stream_lock) notify_xrun(ep); - return; + return -EPIPE; } err = usb_submit_urb(ctx->urb, GFP_ATOMIC); @@ -507,13 +510,16 @@ void snd_usb_queue_pending_output_urbs(struct snd_usb_endpoint *ep, usb_audio_err(ep->chip, "Unable to submit urb #%d: %d at %s\n", ctx->index, err, __func__); - notify_xrun(ep); - return; + if (!in_stream_lock) + notify_xrun(ep); + return -EPIPE; } set_bit(ctx->index, &ep->active_mask); atomic_inc(&ep->submitted_urbs); } + + return 0; } /* |