Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5317197imu; Wed, 19 Dec 2018 09:05:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/WEmfAesN9kWeZJfNtZNqKKR6ROa4kGaYAcs1Faw4UccUqYacjdYnH64MoGzapmVwNAg+H+ X-Received: by 2002:a17:902:6bc7:: with SMTP id m7mr21418620plt.106.1545239123756; Wed, 19 Dec 2018 09:05:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545239123; cv=none; d=google.com; s=arc-20160816; b=MD9I076vBmZEfCSOoDp7ngrxq8E+XHTl0deNV+kMSmqvXV/034U0G2EM4g66aXJFVx NoETXzWhmKg1+ATfYuOHL4FQE8t0NPlYXPGkmvW0a9q0rZtzWB/xwcXgXvsCHx7KBRl6 qjosx7HnKayjmAGh4gKYLVGOJ6o5mt9jBuL4PnoNTyYb0Tu9VWNmG6I287PEwO8I9cMU /gcUTw64dEDweK70a7l4Ng2F2k0h/gYyhzGdvEBM1FNsjtg2W2flOZoE02zqHNBhS7wv TfYmMiokGlzwQiVwlT86p8c33P19Pw7k7T4HDtJk6cBmmJZipJompUY//4AskM56Vkt5 QmvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=T5wJgfHvG9YNVvk1+FWmXoVfCsZ6xuw7cp1vthwDmik=; b=inEo1e5HMNBx3UUPvPHRuIiNyvMkiiGZHDWqKx5/ix8kC/rqg1wZs4m55DcHItFAIq 0MVKWkAZFk0F9J/YHCJJOXb4yIcGuLa+bqovMrrM+i1Nk2hnwBZW5hD/DmVQfOdp6Vs9 37cuwOaLfKV87Aw1pb5e/IiXcSCJZZBXuW9Zvsi3CEdrMAuYADxV4c3ozLCHE39XVyvN LKvKMyECq5WNQceEtMyc1HJYmcpb3hU/vQVjGZP+YQtC0uHGQWdCnalgm2+Cla+lj0Au f1+aNyD47QInuIqeO+kQ8JaMps+IN+Gw7uQT0KnAVysjpEzClR6y86tyYzzGg/sjExSR g04g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=E8P374Oj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 90si14316284plb.17.2018.12.19.09.04.59; Wed, 19 Dec 2018 09:05:23 -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=pass header.i=@synopsys.com header.s=mail header.b=E8P374Oj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729235AbeLSOJG (ORCPT + 99 others); Wed, 19 Dec 2018 09:09:06 -0500 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:35892 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727479AbeLSOJG (ORCPT ); Wed, 19 Dec 2018 09:09:06 -0500 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id C4E0310C1DAC; Wed, 19 Dec 2018 06:09:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1545228545; bh=hrTJgRe397WXOBAxP2xVwYt/F/ApHu2Uagh6uu56ww8=; h=From:To:CC:Subject:Date:References:From; b=E8P374Oj/WYuVHZfP20L5CtF/XtM3oLM2JnQGh+jABgtv29f2/ZIO/53N95mlghSD bgCdwlOYP6qqPikYfUMYFNPmAIQ+o6s9JWOszI5zH42jU4LrqzSii7101GhO83K0yC 225/ZDwpQ/ExpxAwOgC722Zf/FsJEp/90rN+Wf9Y3P2ux7VqquNbdSYMvbWPsBCy0E vxy3TWeldIrvfFIba4GsK4I5nHmKwjyDLCZYqxQ6gta4lEtU6HO8EZeZuNjOokM26e DidACynsbNqaIbVdeiWzx2s0GB8RnS/BB2ifkNrIX709t4NcnCFOs7T7DbqaJS4YHw dfHbdSolb9SoA== Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) by mailhost.synopsys.com (Postfix) with ESMTP id 26D3223B5; Wed, 19 Dec 2018 06:09:05 -0800 (PST) Received: from AM04WEHTCB.internal.synopsys.com (10.116.16.192) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 19 Dec 2018 06:09:05 -0800 Received: from AM04WEMBXA.internal.synopsys.com ([fe80::79c3:55f2:1f20:5bf4]) by am04wehtcb.internal.synopsys.com ([::1]) with mapi id 14.03.0415.000; Wed, 19 Dec 2018 18:09:02 +0400 From: Minas Harutyunyan To: John Keeping , 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 Thread-Topic: [PATCH] usb: dwc2: gadget: fix ISOC frame overflow handling Thread-Index: AQHUatZW7CBOg1jSlEOevZqXY6bG3Q== Date: Wed, 19 Dec 2018 14:09:01 +0000 Message-ID: <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> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.116.70.132] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi John,=0A= =0A= On 12/18/2018 6:35 PM, John Keeping wrote:=0A= > Hi Minas,=0A= > =0A= > On Fri, 14 Dec 2018 09:00:08 +0000=0A= > Minas Harutyunyan wrote:=0A= >> First of all, sorry for delayed answer.=0A= >> Looks like similar issue seen by Andrzej Pietrasiewicz=0A= >> : "dwc2 isochronous transfers issues". Same=0A= >> feedback provided to Andrzej.=0A= >>=0A= >> I run tests on 4.20.0-rc4 in DDMA. By default IN ISOC traffic failed=0A= >> because of BNA interrupts. It's happen because UAC2 requests count=0A= >> set by default to 2. Our core and driver can't work in DDMA with=0A= >> descriptor list length equal to 2. It's not possible on time prepare=0A= >> next descriptors to avoid BNA interrupt.=0A= >>=0A= >> By changing UAC2_DEF_REQ_NUM to 4 all audio gadget tests passed=0A= >> smoothly. Could you please apply this patch and run tests in DDMA=0A= >> mode:=0A= >>=0A= >> diff --git a/drivers/usb/gadget/function/u_uac2.h=0A= >> b/drivers/usb/gadget/function/u_uac2.h=0A= >> index 8362ee572e1e..5e649259ab76 100644=0A= >> --- a/drivers/usb/gadget/function/u_uac2.h=0A= >> +++ b/drivers/usb/gadget/function/u_uac2.h=0A= >> @@ -21,7 +21,7 @@=0A= >> #define UAC2_DEF_CCHMASK 0x3=0A= >> #define UAC2_DEF_CSRATE 64000=0A= >> #define UAC2_DEF_CSSIZE 2=0A= >> -#define UAC2_DEF_REQ_NUM 2=0A= >> +#define UAC2_DEF_REQ_NUM 4=0A= >>=0A= >> struct f_uac2_opts {=0A= >> struct usb_function_instance func_inst;=0A= >>=0A= >>=0A= >> If it will OK on your side also then will switch to BDMA mode and=0A= >> debug.=0A= > =0A= > With DDMA enabled, I see the following error after the stream has been=0A= > running for a while (anything from a few seconds to a few minutes):=0A= > =0A= > -- >8 --=0A= > [ 1798.836322] dwc2 ff580000.usb: dwc2_hsotg_ep_disable: called for ep0= =0A= > [ 1798.836329] dwc2 ff580000.usb: dwc2_hsotg_ep_disable: called for ep0= =0A= > [ 1798.851092] dwc2 ff580000.usb: new device is high-speed=0A= > [ 1798.924461] dwc2 ff580000.usb: new device is high-speed=0A= > [ 1798.982887] dwc2 ff580000.usb: new address 25=0A= > [ 1799.002463] configfs-gadget gadget: high-speed config #1: config=0A= > -- 8< --=0A= > =0A= > On the host side (Linux 4.18.16 Intel xHCI), I see this logged at the=0A= > same time:=0A= > =0A= > -- >8 --=0A= > [1735740.716242] retire_capture_urb: usb 1-2.2.7: frame 0 active: -71=0A= > [1735740.716990] retire_capture_urb: usb 1-2.2.7: frame 0 active: -71=0A= > [1735740.717906] retire_capture_urb: usb 1-2.2.7: frame 0 active: -71=0A= > [1735740.718905] retire_capture_urb: usb 1-2.2.7: frame 0 active: -71=0A= > [1735740.719916] retire_capture_urb: usb 1-2.2.7: frame 0 active: -71=0A= > [1735740.720032] usb 1-2.2-port7: disabled by hub (EMI?), re-enabling...= =0A= > [1735740.720036] usb 1-2.2.7: USB disconnect, device number 28=0A= > [1735740.937500] usb 1-2.2.7: new high-speed USB device number 29 using x= hci_hcd=0A= > -- 8< --=0A= > =0A= > The device does then enumerate and works for a period of time before the= =0A= > same error happens again.=0A= > =0A= From logs not clear who initiate disconnect: host or device. More =0A= probably host, after some errors in retire_capture_urb initiate =0A= disconnect. Do you have any idea?=0A= Can't you connect device to host on same platform?=0A= If root cause of disconnect by host is device issue, i.e. not able to =0A= send to host data packets in time then I need device side dmesg log with = =0A= debug enabled. USB trace around the disconnect will help to debug.=0A= =0A= Thanks,=0A= Minas=0A= =0A= > =0A= > Regards,=0A= > John=0A= > =0A= =0A=