Received: by 10.192.165.148 with SMTP id m20csp3963329imm; Tue, 8 May 2018 00:02:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoQ78EYQCqecGLRBavZb0Z0alnltKCAY1YoYmxNh475BLCjVrxYvO3WLyGJ/1I4B9YMArQb X-Received: by 2002:a63:7e4e:: with SMTP id o14-v6mr31350727pgn.18.1525762972425; Tue, 08 May 2018 00:02:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525762972; cv=none; d=google.com; s=arc-20160816; b=ZDq9y65EqHkC1oYaZknms5JMb1A964ZsmsV4+4qFKl+BJpiqXy/VRhe0SdEsv4tkmH lVDRiJcVJCUxXqJhVccjThz/NlM+gU5P0/M6GSAHNGwxDC4gnZtuivODWlU53xNQnV7M cZy5rxhb511OaqwAH651h7s/EwMMMLQvLFcz5ULhrrzwkqRM614PcDCz/lyE3QcDcWxW RWxByzC6KkV3TarKqA6bD5zUsb+uc9buFFhqeAN1r5wVX6ar1H3kyybOpAMRK9qZUSij TGYZyF3cE8jk7zPHAPNjQFKaB9rQ724kgTJKucZ9Jrf7vS38JA2D5oZ6wIvGflAP9ZzV KOMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=C4QhrQ91SqF+4/fsjT6TY5hThvnPOLRAaBENFrQbJ1s=; b=zVFyFuG1egGljXcYDDBo1s8YdejXViLtOH36CjBfiL0ngQu7TyyddBcNUoopKm2OiZ voljzUGmAabxUq0sNB3pzXh8XK1XtOW8Vl/lHVxQtcn0iQConHZVzVQgqGbKK1Vu/K3g HGgdXjzBjpgV+1l54+nP/ZnY3mPhpG2QeR2XrzZQpqyV9KPnQePEG3IrEew297JozJ0+ a+lMtHc9WxW8bBk0VU8hAuFixeDFSQ+F1ES0MaAatY9LdOi/ynu6X+IbV3AmytQ7EwWg 7T1L164MWXuLWZNE7Qp2BmMIbWO/+1FO5bBsfuCazi8GN4M06P+Thtf/uODWy5ZImwJc NRmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f15-v6si22367717pln.359.2018.05.08.00.02.37; Tue, 08 May 2018 00:02:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754408AbeEHHCF (ORCPT + 99 others); Tue, 8 May 2018 03:02:05 -0400 Received: from regular1.263xmail.com ([211.150.99.140]:53060 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754287AbeEHHCB (ORCPT ); Tue, 8 May 2018 03:02:01 -0400 Received: from wulf?rock-chips.com (unknown [192.168.165.103]) by regular1.263xmail.com (Postfix) with ESMTP id C45BD4CBF; Tue, 8 May 2018 15:01:54 +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 [192.168.60.27] (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 28B86430; Tue, 8 May 2018 15:01:33 +0800 (CST) X-IP-DOMAINF: 1 X-RL-SENDER: wulf@rock-chips.com X-FST-TO: milesschofield@aopen.com X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: wulf@rock-chips.com X-UNIQUE-TAG: <5a4c9904656581c8e84b306531bacaaa> X-ATTACHMENT-NUM: 0 X-SENDER: wulf@rock-chips.com X-DNS-TYPE: 0 Received: from [192.168.60.27] (unknown [103.29.142.67]) by smtp.263.net (Postfix) whith ESMTP id 29889A6BC4X; Tue, 08 May 2018 15:01:52 +0800 (CST) Subject: Re: [PATCH v3 2/2] usb: dwc2: fix isoc split in transfer with no data To: Doug Anderson , William Wu Cc: hminas@synopsys.com, felipe.balbi@linux.intel.com, Greg Kroah-Hartman , Sergei Shtylyov , =?UTF-8?Q?Heiko_St=c3=bcbner?= , LKML , linux-usb@vger.kernel.org, "open list:ARM/Rockchip SoC..." , Frank Wang , =?UTF-8?B?6buE5rab?= , "daniel.meng" , John Youn , =?UTF-8?B?546L5b6B5aKe?= , zsq@rock-chips.com, =?UTF-8?B?6Kix5ZiJ6YqY?= , Stan Tsui , =?UTF-8?B?U3BydWNlIFd1ICjlkLPlu7rli7Mp?= , Martin.Tsai@quantatw.com, Kevin.Shai@quantatw.com, =?UTF-8?B?TW9uLUplciBXdSAo5ZCz5a2f5ZOyKQ==?= , =?UTF-8?B?Q2xhdWQgQ2hhbmcgKOW8teaBreeviSk=?= , =?UTF-8?B?U2FuIExpbiAo5p6X5bu66I+xKQ==?= , Ren.Kuo@quantatw.com, "David H.T. Wang" , Fong Lin , Steven Cheng , Tom Chen , donchang@aopen.com, milesschofield@aopen.com References: <1525748846-7767-1-git-send-email-william.wu@rock-chips.com> <1525748846-7767-3-git-send-email-william.wu@rock-chips.com> From: wlf Message-ID: Date: Tue, 8 May 2018 15:01:32 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Doug, 在 2018年05月08日 13:13, Doug Anderson 写道: > Hi, > > On Mon, May 7, 2018 at 8:07 PM, William Wu 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 >> --- >> 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(-) >> >> diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c >> index ba6fd852..3003594 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; >> } > This looks fine to me now, but as per my comments on the previous > version I don't think I've dug through this problem enough to add my > Reviewed-by tag. I'll assume that John or someone with more knowledge > of the USB protocol than I have will Review / Ack. Thanks very much for your review. Let's wait for other experts' suggestion. > > -Doug > > >