From: wlf <wulf@rock-chips.com>
To: Doug Anderson <dianders@google.com>,
William Wu <william.wu@rock-chips.com>
Cc: hminas@synopsys.com, felipe.balbi@linux.intel.com,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Sergei Shtylyov" <sergei.shtylyov@cogentembedded.com>,
"Heiko Stübner" <heiko@sntech.de>,
LKML <linux-kernel@vger.kernel.org>,
linux-usb@vger.kernel.org,
"open list:ARM/Rockchip SoC..."
<linux-rockchip@lists.infradead.org>,
"Frank Wang" <frank.wang@rock-chips.com>,
黄涛 <huangtao@rock-chips.com>,
"daniel.meng" <daniel.meng@rock-chips.com>,
"John Youn" <John.Youn@synopsys.com>, 王征增 <wzz@rock-chips.com>,
zsq@rock-chips.com, Allen.Hsu@quantatw.com, StanTsui@aopen.com,
"Vincent Palatin" <vpalatin@chromium.org>
Subject: Re: [PATCH v2 2/2] usb: dwc2: fix isoc split in transfer with no data
Date: Thu, 3 May 2018 01:16:26 +0800 [thread overview]
Message-ID: <abdf9cc8-c065-109f-82eb-0de61c3d976e@rock-chips.com> (raw)
In-Reply-To: <CAD=FV=XWzKZOF8+=z07UC3FBGRFifBvk9Oda7HRipqGy9Rxcnw@mail.gmail.com>
Dear Doug,
在 2018年05月02日 13:02, Doug Anderson 写道:
> Hi,
>
> On Tue, May 1, 2018 at 8:04 PM, William Wu <william.wu@rock-chips.com> wrote:
>> 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@rock-chips.com>
>> ---
>> 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;
> I don't think my USB-fu is strong enough to do a real review of this
> patch, but one small nitpick is that you can remove
> "qtd->isoc_split_offset = 0" in the if test now. AKA:
>
> if (!len && !qtd->isoc_split_offset) {
> qtd->complete_split = 0;
> return 0;
> }
Yes, good idea! I will fix it in next patch. Thank you!
>
> ...since you only enter the "if" test now when isoc_split_offset is
> already 0... Hopefully John Youn will have some time to comment on
> this patch with more real USB knowledge...
>
>
> -Doug
>
Best regards,
wulf
>
prev parent reply other threads:[~2018-05-02 17:16 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
2018-05-07 7:19 ` Allen Hsu (許嘉銘)
2018-05-07 13:28 ` wlf
2018-05-02 3:04 ` [PATCH v2 2/2] usb: dwc2: fix isoc split in transfer with no data William Wu
2018-05-02 5:02 ` Doug Anderson
2018-05-02 17:16 ` wlf [this message]
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=abdf9cc8-c065-109f-82eb-0de61c3d976e@rock-chips.com \
--to=wulf@rock-chips.com \
--cc=Allen.Hsu@quantatw.com \
--cc=John.Youn@synopsys.com \
--cc=StanTsui@aopen.com \
--cc=daniel.meng@rock-chips.com \
--cc=dianders@google.com \
--cc=felipe.balbi@linux.intel.com \
--cc=frank.wang@rock-chips.com \
--cc=gregkh@linuxfoundation.org \
--cc=heiko@sntech.de \
--cc=hminas@synopsys.com \
--cc=huangtao@rock-chips.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=vpalatin@chromium.org \
--cc=william.wu@rock-chips.com \
--cc=wzz@rock-chips.com \
--cc=zsq@rock-chips.com \
/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
all inboxes | Powered by JetHome®