All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] usb: gadget: f_uac2: Stop endpoint before enabling it.
@ 2021-04-26  4:48 Pawel Laszczak
  2021-04-26 10:22 ` Felipe Balbi
  0 siblings, 1 reply; 8+ messages in thread
From: Pawel Laszczak @ 2021-04-26  4:48 UTC (permalink / raw)
  To: balbi
  Cc: gregkh, ruslan.bilovol, jbrunet, linux-usb, kurahul, peter.chen,
	Pawel Laszczak

From: Pawel Laszczak <pawell@cadence.com>

Patch adds disabling endpoint before enabling it during changing
alternate setting. Lack of this functionality causes that in some
cases uac2 queue the same request multiple time.
Such situation can occur when host send set interface with
alternate setting 1 twice.

Signed-off-by: Pawel Laszczak <pawell@cadence.com>

---
Changelog:
v2:
- moved disabling endpoint into u_audio_start_playback

 drivers/usb/gadget/function/u_audio.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/gadget/function/u_audio.c b/drivers/usb/gadget/function/u_audio.c
index 265c4d805f81..c4bbc9decaba 100644
--- a/drivers/usb/gadget/function/u_audio.c
+++ b/drivers/usb/gadget/function/u_audio.c
@@ -401,6 +401,10 @@ int u_audio_start_playback(struct g_audio *audio_dev)
 
 	ep = audio_dev->in_ep;
 	prm = &uac->p_prm;
+
+	if (prm->ep_enabled)
+		u_audio_stop_capture(audio_dev);
+
 	config_ep_by_speed(gadget, &audio_dev->func, ep);
 
 	ep_desc = ep->desc;
-- 
2.25.1


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

end of thread, other threads:[~2021-04-28 10:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26  4:48 [PATCH v2 1/2] usb: gadget: f_uac2: Stop endpoint before enabling it Pawel Laszczak
2021-04-26 10:22 ` Felipe Balbi
2021-04-26 10:47   ` Pawel Laszczak
2021-04-26 12:52     ` Felipe Balbi
2021-04-26 14:50       ` Alan Stern
2021-04-26 14:54         ` Felipe Balbi
2021-04-27  4:35           ` Pawel Laszczak
2021-04-28 10:33             ` Felipe Balbi

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.