From: William Wu <william.wu-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
To: hminas-HKixBCOQz3hWk0Htik3J/w@public.gmane.org,
felipe.balbi-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org
Cc: huangtao-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
StanTsui-MW+71TLMfDcAvxtiuMwx3w@public.gmane.org,
wzz-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org,
sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org,
frank.wang-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
Allen.Hsu-nXwZKfITCkNWk0Htik3J/w@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
zsq-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
dianders-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
william.wu-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
John.Youn-HKixBCOQz3hWk0Htik3J/w@public.gmane.org,
daniel.meng-TNX95d0MmH7DzftRWevZcw@public.gmane.org
Subject: [PATCH v2 2/2] usb: dwc2: fix isoc split in transfer with no data
Date: Wed, 2 May 2018 11:04:48 +0800 [thread overview]
Message-ID: <1525230288-6014-3-git-send-email-william.wu@rock-chips.com> (raw)
In-Reply-To: <1525230288-6014-1-git-send-email-william.wu-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
If isoc split in transfer with no data (the length of DATA0
packet is zero), we can't simply return immediately. Because
the DATA0 can be the first transaction or the second transaction
for the isoc split in transaction. If the DATA0 packet with no
data is in the first transaction, we can return immediately.
But if the DATA0 packet with no data is in the second transaction
of isoc split in transaction sequence, we need to increase the
qtd->isoc_frame_index and giveback urb to device driver if needed,
otherwise, the MDATA packet will be lost.
A typical test case is that connect the dwc2 controller with an
usb hs Hub (GL852G-12), and plug an usb fs audio device (Plantronics
headset) into the downstream port of Hub. Then use the usb mic
to record, we can find noise when playback.
In the case, the isoc split in transaction sequence like this:
- SSPLIT IN transaction
- CSPLIT IN transaction
- MDATA packet (176 bytes)
- CSPLIT IN transaction
- DATA0 packet (0 byte)
This patch use both the length of DATA0 and qtd->isoc_split_offset
to check if the DATA0 is in the second transaction.
Signed-off-by: William Wu <william.wu-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
---
Changes in v2:
- Modify the commit message
drivers/usb/dwc2/hcd_intr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c
index 5e2378f..479f628 100644
--- a/drivers/usb/dwc2/hcd_intr.c
+++ b/drivers/usb/dwc2/hcd_intr.c
@@ -930,7 +930,7 @@ static int dwc2_xfercomp_isoc_split_in(struct dwc2_hsotg *hsotg,
frame_desc = &qtd->urb->iso_descs[qtd->isoc_frame_index];
len = dwc2_get_actual_xfer_length(hsotg, chan, chnum, qtd,
DWC2_HC_XFER_COMPLETE, NULL);
- if (!len) {
+ if (!len && !qtd->isoc_split_offset) {
qtd->complete_split = 0;
qtd->isoc_split_offset = 0;
return 0;
--
2.0.0
next prev parent reply other threads:[~2018-05-02 3:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-02 3:04 [PATCH v2 0/2] usb: dwc2: fix isoc split in transfer issue William Wu
2018-05-02 3:04 ` [PATCH v2 1/2] usb: dwc2: alloc dma aligned buffer for isoc split in William Wu
2018-05-02 4:33 ` Doug Anderson
2018-05-02 17:14 ` wlf
2018-05-04 15:58 ` Doug Anderson
[not found] ` <CAD=FV=V1gFsyG+PDp6xF2w+=t87vcoSNcXGvwVu_YchY4MyNAQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-05-07 7:19 ` Allen Hsu (許嘉銘)
[not found] ` <c257333733244cf680f43128153956fd-nXwZKfITCkNWk0Htik3J/w@public.gmane.org>
2018-05-07 13:28 ` wlf
[not found] ` <1525230288-6014-1-git-send-email-william.wu-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2018-05-02 3:04 ` William Wu [this message]
2018-05-02 5:02 ` [PATCH v2 2/2] usb: dwc2: fix isoc split in transfer with no data Doug Anderson
2018-05-02 17:16 ` wlf
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=1525230288-6014-3-git-send-email-william.wu@rock-chips.com \
--to=william.wu-tnx95d0mmh7dzftrwevzcw@public.gmane.org \
--cc=Allen.Hsu-nXwZKfITCkNWk0Htik3J/w@public.gmane.org \
--cc=John.Youn-HKixBCOQz3hWk0Htik3J/w@public.gmane.org \
--cc=StanTsui-MW+71TLMfDcAvxtiuMwx3w@public.gmane.org \
--cc=daniel.meng-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
--cc=dianders-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=felipe.balbi-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=frank.wang-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org \
--cc=hminas-HKixBCOQz3hWk0Htik3J/w@public.gmane.org \
--cc=huangtao-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org \
--cc=wzz-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
--cc=zsq-TNX95d0MmH7DzftRWevZcw@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox