Message ID | 1526031992-16565-3-git-send-email-william.wu@rock-chips.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3086B60236 for <patchwork-linux-rockchip@patchwork.kernel.org>; Fri, 11 May 2018 09:48:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 005F028CEA for <patchwork-linux-rockchip@patchwork.kernel.org>; Fri, 11 May 2018 09:48:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E89E328E3E; Fri, 11 May 2018 09:48:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_SORBS_WEB autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A363328CEA for <patchwork-linux-rockchip@patchwork.kernel.org>; Fri, 11 May 2018 09:48:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=/dOjFKzJt9+2Ymb2qVzygjVP5x5aUN8FC/s5alOw9R4=; b=S9JyT8ZE1aXx7sEoo10wNdA6qi 4W9QDVWn6daRsKEWhn4gOhJbRtTlrL6kRF8rrzshtfoFHgSug59NJVJViuB2ffLy3LmNj1OYs6BtC Zu1DefVJAOb86isjVarz1E2TEwGewq+e22WLoHPy45SXYKRnk0iOBL+/8bBxpr9dtymmtTk8HUHH8 hAsLXF8lhi4HP6sX3S/kAId0XijadlmMOpyAYeThOYNtPQxi9G5ZpVRCIEQ/HhJvqLvh+warngICU yJbVvKYmVjjQ8IfDQMIOc9sCzi2ARx2M7yYE2XnNhqSQFW31o24V6zn207thyY4JtmFX6EI+ke34Q 3XPwwt+w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fH4fE-0005lx-4j; Fri, 11 May 2018 09:48:36 +0000 Received: from regular1.263xmail.com ([211.150.99.134]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fH4f9-0005hi-I5 for linux-rockchip@lists.infradead.org; Fri, 11 May 2018 09:48:33 +0000 Received: from william.wu?rock-chips.com (unknown [192.168.167.157]) by regular1.263xmail.com (Postfix) with ESMTP id 80A359154; Fri, 11 May 2018 17:48:17 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 1433E3EC; Fri, 11 May 2018 17:48:02 +0800 (CST) X-RL-SENDER: william.wu@rock-chips.com X-FST-TO: hminas@synopsys.com X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: william.wu@rock-chips.com X-UNIQUE-TAG: <bf844377ae7eda86af47201b1d61dc43> X-ATTACHMENT-NUM: 0 X-SENDER: wulf@rock-chips.com X-DNS-TYPE: 0 Received: from unknown (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith SMTP id 22140BYGRZD; Fri, 11 May 2018 17:48:16 +0800 (CST) From: William Wu <william.wu@rock-chips.com> To: hminas@synopsys.com, felipe.balbi@linux.intel.com, gregkh@linuxfoundation.org Subject: [PATCH v5 2/2] usb: dwc2: fix isoc split in transfer with no data Date: Fri, 11 May 2018 17:46:32 +0800 Message-Id: <1526031992-16565-3-git-send-email-william.wu@rock-chips.com> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1526031992-16565-1-git-send-email-william.wu@rock-chips.com> References: <1526031992-16565-1-git-send-email-william.wu@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180511_024832_011424_D24D8B04 X-CRM114-Status: GOOD ( 15.25 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms <linux-rockchip.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-rockchip>, <mailto:linux-rockchip-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-rockchip/> List-Post: <mailto:linux-rockchip@lists.infradead.org> List-Help: <mailto:linux-rockchip-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-rockchip>, <mailto:linux-rockchip-request@lists.infradead.org?subject=subscribe> Cc: donchang@aopen.com, heiko@sntech.de, Allen.Hsu@quantatw.com, davidhtwang@aopen.com, milesschofield@aopen.com, tomchen@aopen.com, zsq@rock-chips.com, linux-rockchip@lists.infradead.org, Ren.Kuo@quantatw.com, Martin.Tsai@quantatw.com, Kevin.Shai@quantatw.com, daniel.meng@rock-chips.com, huangtao@rock-chips.com, Spruce.Wu@quantatw.com, frank.wang@rock-chips.com, stevencheng@aopen.com, Mon-Jer.Wu@quantatw.com, StanTsui@AOPEN.com, Claud.Chang@quantatw.com, dianders@google.com, San.Lin@quantatw.com, wzz@rock-chips.com, sergei.shtylyov@cogentembedded.com, fonglin@aopen.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, John.Youn@synopsys.com, william.wu@rock-chips.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" <linux-rockchip-bounces@lists.infradead.org> Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c index ba6229e..9751785 100644 --- a/drivers/usb/dwc2/hcd_intr.c +++ b/drivers/usb/dwc2/hcd_intr.c @@ -930,9 +930,8 @@ 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; }
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 v5: - None Changes in v4: - None Changes in v3: - Remove "qtd->isoc_split_offset = 0" in the if test Changes in v2: - Modify the commit message drivers/usb/dwc2/hcd_intr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)