From: Bin Liu <b-liu@ti.com>
To: Felipe Balbi <balbi@kernel.org>, linux-usb@vger.kernel.org
Subject: g_audio regression on dwc3 udc
Date: Fri, 10 Aug 2018 14:05:45 -0500 [thread overview]
Message-ID: <20180810190545.GA4119@uda0271908> (raw)
Hi Felipe,
I noticed a regression on g_audio (uac2) with dwc3 udc on v4.14:
- nosound in playback
- playback can only play once, the following error happens from the 2nd
playback
aplay: set_params:1361: Unable to install hw params:
A manual bisect tells the two issues are seperate and the regression
happens in v4.11-rc2 with the following two patches.
40d829fb2ec63 ("usb: dwc3: gadget: Correct ISOC DATA PIDs for short packets")
which cases the first no-sound issue.
ep->mult is already 1 from g_audio, so mult-- leads to incorrect value.
The following change solves it.
With the two changes above, g_audio works fine with v4.14.40, but not with
v4.18-rc7, in which the console is flooded with following message.
u_audio_iso_complete: iso_complete status(-18) 0/256
Regards,
-Bin.
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index f92e2f2c7fbe..758cc258895c 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -930,10 +930,10 @@ static void __dwc3_prepare_one_trb(struct dwc3_ep *dep, struct dwc3_trb *trb,
unsigned int mult = ep->mult - 1;
unsigned int maxp = usb_endpoint_maxp(ep->desc);
- if (length <= (2 * maxp))
+ if (mult && length <= (2 * maxp))
mult--;
- if (length <= maxp)
+ if (mult && length <= maxp)
mult--;
trb->size |= DWC3_TRB_SIZE_PCM1(mult);
cf3113d893d4 ("usb: dwc3: gadget: properly increment dequeue pointer on ep_dequeue")
which causes the multiple playback failure. The following hack covers it.
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index f92e2f2c7fbe..758cc258895c 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1411,7 +1411,7 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
if (r == req) {
/* wait until it is processed */
dwc3_stop_active_transfer(dwc, dep->number, true);
-
+#if 0
/*
* If request was already started, this means we had to
* stop the transfer. With that we also need to ignore
@@ -1473,6 +1473,7 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
dwc3_ep_inc_deq(dep);
}
}
+#endif
goto out1;
}
dev_err(dwc->dev, "request %pK was not queued to %s\n",
next reply other threads:[~2018-08-10 19:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-10 19:05 Bin Liu [this message]
2018-08-10 21:36 g_audio regression on dwc3 udc Thinh Nguyen
2018-08-13 15:21 Bin Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180810190545.GA4119@uda0271908 \
--to=b-liu@ti.com \
--cc=balbi@kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.