Received: by 10.192.165.148 with SMTP id m20csp4487489imm; Tue, 24 Apr 2018 03:42:32 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoeamE+YWTl4ikKJSbWFed7k2npQIxXw/nx6EZCqap98OGzGSvpYWiTd6bRkCt6XXSaLBGd X-Received: by 10.167.133.206 with SMTP id z14mr2166308pfn.2.1524566552413; Tue, 24 Apr 2018 03:42:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524566552; cv=none; d=google.com; s=arc-20160816; b=AOG6CT3S6c1GScBsDUFMefqnUyunH2Ep8cJXpGKIKXRkXSxRI5AOAPeTmU9SkOPMPw 3K1oAifSEt3HdVvMVOeNL45scP+F2ERm2HNwAevaU111cYyU1h2fScVPOwkIL2D7Mlxe 0lHVd6O47pqu09E+kZ13TfODAPuh4GThq7F+Jz3FggArxLyU5uzxt5cnFlukM21Uf7PH O0SaXom91TqyaoZAh97v1OCAwmBXvK1scYqSYtcdUu1eoVjWson7GEW98NgcV4a8AvZL kggWlGhMkhn0lTm+tDA/qjZqWoAq49+cr8VFwNlNZ0+ND50pJHMD4BxxjB4RwPybZnRW vLgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=Q+6RSk4ep7QLRcZa90Zp6UPWz59pUmCZ3GTnZbeDbnQ=; b=PwBgMtxI7l7R+qZnSrTIFDa8AUDnxVUEEvOD6AVEzu69SP5HRDUNW9OH4pdcUX8FMO VnhDvPWaQrBXyxsTb7e14SktXKzCpzinBpJxGg2U+DFMMslO/9BYcOITEsX59O22YaHk QePZgER9TIu8Dzvj1NPrjEKiR+zHhhqOxyrDe1f4emGCCet/E0odEjHtdj4p+B+TideW GTDi7ogYNAQVkYX7WQUhyyaap6WdOXHfymBpcQXdCGICEy8+oWC9g412v3usfpm9D01+ 8u0pSUDtdMrGhF/RkpUPJCH3wCbCKfh/boDls6JuEHxsk+2D0Nu+vOaGfbq2LB2cTFhK ju3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=LqOhm9+t; 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 m21si13647083pfj.25.2018.04.24.03.42.17; Tue, 24 Apr 2018 03:42:32 -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; dkim=pass header.i=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=LqOhm9+t; 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 S1756589AbeDXI1T (ORCPT + 99 others); Tue, 24 Apr 2018 04:27:19 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:43276 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756329AbeDXI1M (ORCPT ); Tue, 24 Apr 2018 04:27:12 -0400 Received: by mail-lf0-f68.google.com with SMTP id g12-v6so2867537lfb.10 for ; Tue, 24 Apr 2018 01:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Q+6RSk4ep7QLRcZa90Zp6UPWz59pUmCZ3GTnZbeDbnQ=; b=LqOhm9+t0tASkeu+secgiYy6dESRl6sFNbxUUJLKupGE2WHGC3X6g5X6ZWr1s9+K+p 7Q1Tkg7nzma3f+mns/HjQqBGQJxvWxBLugVNgqtAM5iXXTyzowREj1PclmpMb7PesK6Q SlL2j4QVbfE1zff2jd1UQ459+beJ60nLS5Rd+/DIcbw+gbmNryIHxwwsJ4N48KhZOl2y 7sTrRLRSk8b3kWIvY71DRgT5n1N4PUqSMmmCLfsoUwKTxJ97HeDVEh7n/WHgabCrFtfs cx6RLSKJb2UbpUVoigXBWZE6bcjSJJApjXbMVQ2xsRGrqnVKUTMsGgBycZqEThqrBODS iO8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Q+6RSk4ep7QLRcZa90Zp6UPWz59pUmCZ3GTnZbeDbnQ=; b=nh3rzwDApYxvgoBBOJKaU0FuMbuSVA0GcqeIzRElgRt9ozbBKcUWVSINbzdIRQY2Kl dyHnj0oBn20kxdtqSgG1kslRJT5uFPk9l0Zenig84Us/R1Z182NMvNagWG3OJocgZeXz Qcd/oBCsE9NoGRGHGdnPKVrGX5TZbJGThf1Cvqwrvb3UsUaTG6dkTkZrpC6HkZ/iWfZX aBsJjF7+FN1vJo2QE6t3H307MqVi0r6iu59Bh2OO2NgL6fNWM+171PXpxJaaYFsdY5zz DjbBr/SfaS5PMDPFbAUMHmYkKxjeHD0AUvnh4CTnVFJCO4BKY2xDgIpFmqTE/lf2gkG7 CtYw== X-Gm-Message-State: ALQs6tAmLsQop4ntOJzDyMNeMnUB2OkwQLF9myfofAKCUQPSf9chemRC m+MjcG/RG8yG3cKUzTyZ5cmMWg== X-Received: by 10.46.128.16 with SMTP id j16mr16779214ljg.26.1524558430495; Tue, 24 Apr 2018 01:27:10 -0700 (PDT) Received: from [192.168.0.126] ([31.173.86.113]) by smtp.gmail.com with ESMTPSA id e24-v6sm465341lfb.54.2018.04.24.01.27.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 01:27:09 -0700 (PDT) Subject: Re: [PATCH 2/2] usb: dwc2: fix isoc split in transfer with no data To: William Wu , hminas@synopsys.com, felipe.balbi@linux.intel.com, gregkh@linuxfoundation.org Cc: heiko@sntech.de, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-rockchip@lists.infradead.org, frank.wang@rock-chips.com, huangtao@rock-chips.com, dianders@google.com, daniel.meng@rock-chips.com, John.Youn@synopsys.com, wzz@rock-chips.com, zsq@rock-chips.com, Allen.Hsu@quantatw.com, StanTsui@AOPEN.com References: <1524537824-22010-1-git-send-email-william.wu@rock-chips.com> <1524537824-22010-3-git-send-email-william.wu@rock-chips.com> From: Sergei Shtylyov Message-ID: <799e2eea-be83-b3c1-3ee7-7a66b1759379@cogentembedded.com> Date: Tue, 24 Apr 2018 11:27:04 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1524537824-22010-3-git-send-email-william.wu@rock-chips.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On 4/24/2018 5:43 AM, William Wu wrote: > If isoc split in transfer with no data (the length of DATA0 > packet is 0), 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 on data ^^ no? > is in the first transaction, we can return immediately. But if > the the DATA0 packet with on data is in the second transaction One "the" too many. And that "on data" again... :-) > 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 [...] MBR, Sergei