Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1379024imu; Fri, 21 Dec 2018 19:10:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/XUL9LbBiuGUNi3eB1ODZrtGsnUOnUlb2KqJBJpMcN2Z3XYddqI3DaJP2YTMsWYvmeehHG5 X-Received: by 2002:a62:f247:: with SMTP id y7mr5042510pfl.25.1545448250809; Fri, 21 Dec 2018 19:10:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545448250; cv=none; d=google.com; s=arc-20160816; b=K9WdT0YoYhyKKycoVfM9Ayfs1RQqqmh/8beYIwJgFOQ94cUdy3amCrvjT3HINlyUiM yvt8ElIHAkHiGuCbqW8SO4jhb3/Ga/EFWlFNMggbw9f+FWOR7JA9pyrak3ZWATzNV+d3 AhG80/zTuV3l2a1CtRCnTlggz+PNDvdWzZCMqqDoN4rYijjsiMV+zS3XuU+E6GfiHic2 dwIjAqzfg+Wiz//0xn3fwOQHwQrRNuXqTtj0wralono6yAAGKl4ksx4GdKIUkCPS2PJH Y5zcza44thOyJFxsZs02JTtTMdTQJAtT4bY5gmJNZsOHY98PdneFeYGgk6yeJdUZ2SBh dj2g== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=C9+MT/4b4S+6GNmCnCVUhcf4WrcHXR6tsoCZWsmc4rE=; b=ZIjkcG82Q7DLYC9qVJrIsXZAgKkMwgTEqBdmzUa2kOtpoSxcooLhp+A7/2ho7hNJ4X YaYg0iAojbjSExVGaVWGx8AmSpCtYlYxnPMOQfCxusd8IttnR3L8Bw2UzM1BAZJ0C2DD i1mjEGEfoiyre6e1MwbVpUsCLr3zBhCDHHPYzezm6KPWNmGghj5YLxAJtZdQrSNXgLb/ Wi1thQG/HG0+XEMZxT5hEVnPIxZnmB/x55gnwCRbhGc1O8PSyRqa+szgc8rzNfCfxT2H 5f6n8hedeQVW9WVYiex3bTd958hXnCK/K8E4/wEROWbV8s3Mt/Ji+VWLnPfkvXg8czXK aBxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@metanate.com header.s=stronger header.b=qFa5XFJl; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=metanate.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u9si23598729plk.61.2018.12.21.19.10.35; Fri, 21 Dec 2018 19:10:50 -0800 (PST) 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=fail (test mode) header.i=@metanate.com header.s=stronger header.b=qFa5XFJl; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=metanate.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387927AbeLUQFQ (ORCPT + 99 others); Fri, 21 Dec 2018 11:05:16 -0500 Received: from dougal.metanate.com ([90.155.101.14]:39445 "EHLO metanate.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729268AbeLUQFP (ORCPT ); Fri, 21 Dec 2018 11:05:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=metanate.com; s=stronger; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References :In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=NOwvhVdcPFWzLduLqDqyQbNnEYBnCK66DE311pDNx1E=; b=qFa5XFJltUiyPTZWQZjOxJxv9/ GL8nvZtPLU+QwPKdfGfnW7a2I9XT6J6h2y+dpy+R4Ym47LvZEsdDBdF0X6B0J9Mha9jAj8F/Qz7Xn Tmzly7DbtownP2GLWESoLUQuyVUfiJN/lebH6qMTXEKqipk35xy+5Txu82k+86PqMCdTkWt3UH6v4 Z74c2D7F+DPfkUVgSOFGsBijh1TfrFilf5gHT2qFvNDbGCHwBRjik06AdvN95AH1XTfQcCZJ/Dp5C fxm0TW/zY5z9WihTBUBlLrrfmm/QudwKkmKI/XChwfNo1kvwCEBfg+2JMrsVlsEOBeYjkFo4RVgjg DosJV/cA==; Received: from johnkeeping.plus.com ([81.174.171.191] helo=donbot) by shrek.metanate.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1gaNIR-00018m-2x; Fri, 21 Dec 2018 16:05:07 +0000 Date: Fri, 21 Dec 2018 16:05:04 +0000 From: John Keeping To: Minas Harutyunyan Cc: Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "arthur.petrosyan@synopsys.com" Subject: Re: [PATCH] usb: dwc2: gadget: fix ISOC frame overflow handling Message-ID: <20181221160504.15e93827@donbot> In-Reply-To: <410670D7E743164D87FA6160E7907A56013A7BECBB@am04wembxa.internal.synopsys.com> References: <20181023134355.29829-1-john@metanate.com> <410670D7E743164D87FA6160E7907A56013A79E7CE@am04wembxa.internal.synopsys.com> <20181108173654.118f9e3e@donbot> <410670D7E743164D87FA6160E7907A56013A7A0F2B@am04wembxa.internal.synopsys.com> <410670D7E743164D87FA6160E7907A56013A7A12C1@am04wembxa.internal.synopsys.com> <20181109184246.33cb4487@donbot> <410670D7E743164D87FA6160E7907A56013A7A27D7@am04wembxa.internal.synopsys.com> <20181112224626.6b44568a@donbot> <410670D7E743164D87FA6160E7907A56013A7BAB28@am04wembxa.internal.synopsys.com> <20181218143504.027fc53c@donbot> <410670D7E743164D87FA6160E7907A56013A7BECBB@am04wembxa.internal.synopsys.com> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Authenticated: YES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Minas, On Wed, 19 Dec 2018 14:09:01 +0000 Minas Harutyunyan wrote: > On 12/18/2018 6:35 PM, John Keeping wrote: > > Hi Minas, > > > > On Fri, 14 Dec 2018 09:00:08 +0000 > > Minas Harutyunyan wrote: > >> First of all, sorry for delayed answer. > >> Looks like similar issue seen by Andrzej Pietrasiewicz > >> : "dwc2 isochronous transfers issues". Same > >> feedback provided to Andrzej. > >> > >> I run tests on 4.20.0-rc4 in DDMA. By default IN ISOC traffic > >> failed because of BNA interrupts. It's happen because UAC2 > >> requests count set by default to 2. Our core and driver can't work > >> in DDMA with descriptor list length equal to 2. It's not possible > >> on time prepare next descriptors to avoid BNA interrupt. > >> > >> By changing UAC2_DEF_REQ_NUM to 4 all audio gadget tests passed > >> smoothly. Could you please apply this patch and run tests in DDMA > >> mode: > >> > >> diff --git a/drivers/usb/gadget/function/u_uac2.h > >> b/drivers/usb/gadget/function/u_uac2.h > >> index 8362ee572e1e..5e649259ab76 100644 > >> --- a/drivers/usb/gadget/function/u_uac2.h > >> +++ b/drivers/usb/gadget/function/u_uac2.h > >> @@ -21,7 +21,7 @@ > >> #define UAC2_DEF_CCHMASK 0x3 > >> #define UAC2_DEF_CSRATE 64000 > >> #define UAC2_DEF_CSSIZE 2 > >> -#define UAC2_DEF_REQ_NUM 2 > >> +#define UAC2_DEF_REQ_NUM 4 > >> > >> struct f_uac2_opts { > >> struct usb_function_instance func_inst; > >> > >> > >> If it will OK on your side also then will switch to BDMA mode and > >> debug. > > > > With DDMA enabled, I see the following error after the stream has > > been running for a while (anything from a few seconds to a few > > minutes): > > -- >8 -- > > [ 1798.836322] dwc2 ff580000.usb: dwc2_hsotg_ep_disable: called for > > ep0 [ 1798.836329] dwc2 ff580000.usb: dwc2_hsotg_ep_disable: called > > for ep0 [ 1798.851092] dwc2 ff580000.usb: new device is high-speed > > [ 1798.924461] dwc2 ff580000.usb: new device is high-speed > > [ 1798.982887] dwc2 ff580000.usb: new address 25 > > [ 1799.002463] configfs-gadget gadget: high-speed config #1: config > > -- 8< -- > > > > On the host side (Linux 4.18.16 Intel xHCI), I see this logged at > > the same time: > > > > -- >8 -- > > [1735740.716242] retire_capture_urb: usb 1-2.2.7: frame 0 active: > > -71 [1735740.716990] retire_capture_urb: usb 1-2.2.7: frame 0 > > active: -71 [1735740.717906] retire_capture_urb: usb 1-2.2.7: frame > > 0 active: -71 [1735740.718905] retire_capture_urb: usb 1-2.2.7: > > frame 0 active: -71 [1735740.719916] retire_capture_urb: usb > > 1-2.2.7: frame 0 active: -71 [1735740.720032] usb 1-2.2-port7: > > disabled by hub (EMI?), re-enabling... [1735740.720036] usb > > 1-2.2.7: USB disconnect, device number 28 [1735740.937500] usb > > 1-2.2.7: new high-speed USB device number 29 using xhci_hcd -- 8< -- > > > > The device does then enumerate and works for a period of time > > before the same error happens again. > > > From logs not clear who initiate disconnect: host or device. More > probably host, after some errors in retire_capture_urb initiate > disconnect. Do you have any idea? > Can't you connect device to host on same platform? > If root cause of disconnect by host is device issue, i.e. not able to > send to host data packets in time then I need device side dmesg log > with debug enabled. USB trace around the disconnect will help to > debug. I remember running a test with a hardware USB analyzer and which showed an isochronous packet with an incorrect length (much larger than it should have been) when the failure occurred. I don't have any logs from that test and I'm out of the office at the moment, but I will capture logs when I'm back in January. Thanks, John