From patchwork Fri Aug 17 12:24:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anurag Kumar Vulisha X-Patchwork-Id: 10568705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 27F5414BD for ; Fri, 17 Aug 2018 12:25:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 159822B019 for ; Fri, 17 Aug 2018 12:25:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07CA42B29B; Fri, 17 Aug 2018 12:25:21 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E5D32B019 for ; Fri, 17 Aug 2018 12:25:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727509AbeHQP2a (ORCPT ); Fri, 17 Aug 2018 11:28:30 -0400 Received: from mail-eopbgr690068.outbound.protection.outlook.com ([40.107.69.68]:37216 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726800AbeHQP22 (ORCPT ); Fri, 17 Aug 2018 11:28:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9oUcBefZZDizQhh5U50j4/ut2w/sXtUKikIytlt+zvk=; b=W8jVO12RELlTcIsiinsALM70Z7ld2VkqrT1sxoWaIi14DJ62CbeIm3jDXY+FhOsW64DJITaxAdN9e91OOf0wPEeALr3yGGCcUJf+o5MkLGamJzi7a9fvFVmYLzgQC6OFJsesYC/McBZM66pBWTclYVXk7DQL8FglIDlSvnkB6WY= Received: from BLUPR0201CA0030.namprd02.prod.outlook.com (2a01:111:e400:52e7::40) by BYAPR02MB4326.namprd02.prod.outlook.com (2603:10b6:a03:56::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.25; Fri, 17 Aug 2018 12:25:07 +0000 Received: from BL2NAM02FT007.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::200) by BLUPR0201CA0030.outlook.office365.com (2a01:111:e400:52e7::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1059.20 via Frontend Transport; Fri, 17 Aug 2018 12:25:06 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT007.mail.protection.outlook.com (10.152.77.46) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1059.14 via Frontend Transport; Fri, 17 Aug 2018 12:25:06 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:42365 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fqdoP-0008VO-HZ; Fri, 17 Aug 2018 05:25:05 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fqdoK-0000U3-HB; Fri, 17 Aug 2018 05:25:00 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w7HCOvRx019091; Fri, 17 Aug 2018 05:24:57 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fqdoH-0000TQ-B4; Fri, 17 Aug 2018 05:24:57 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 6140160508; Fri, 17 Aug 2018 17:54:56 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , Anurag Kumar Vulisha Subject: [PATCH v2 1/8] usb: dwc3: Correct the logic for checking TRB full in __dwc3_prepare_one_trb() Date: Fri, 17 Aug 2018 17:54:48 +0530 Message-ID: <1534508695-12642-2-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1534508695-12642-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1534508695-12642-1-git-send-email-anurag.kumar.vulisha@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(376002)(39850400004)(396003)(346002)(2980300002)(438002)(189003)(199004)(305945005)(6666003)(76176011)(51416003)(186003)(26005)(90966002)(50466002)(48376002)(39060400002)(110136005)(54906003)(103686004)(47776003)(316002)(4326008)(16586007)(106002)(42186006)(36756003)(50226002)(8936002)(15760500003)(106466001)(107886003)(63266004)(6266002)(356003)(478600001)(486006)(476003)(2616005)(126002)(36386004)(52956003)(2906002)(8676002)(336012)(5660300001)(446003)(11346002)(81166006)(426003)(81156014)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR02MB4326;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BL2NAM02FT007;1:CiudDmc2Z/dATSP+1ojfLhQUwHM4t0anuif4Ikd8bHbRkbNLRcE21BHBBkSZVHlOOROOVTo9RwwMiobmbXbhH8NtXivsuQV1ifOQ+Y4uBDiYwsViNfxDk5/llHZMXd// MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 084ef1ed-40e7-46e3-37d8-08d6043c7728 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BYAPR02MB4326; X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4326;3:FsU5/sQuUQhRp5mtD9E/eHAjeDNXuK48sFSSlRDXM+8CFmfHo0SOyU+Gp9sQMauyNMhe1ZU6KY/vILGvubGiRVRDo1XA1utIAgDS0wYANsCN13teq9JvJlz3MdIqQoeRUB8v9Evd4nkN9c35qk348njyFLoLS7HJEuphuS+Hp195u5zyYJrkbsMCVINWQh+g2U7U9JThkRPyFN8vh24IIIPBrwolUTmUHJ7tMxXD393pvfqnWF4WPStDXyks1F1MnvqZ8OriC+3bJWHsWlgqx/jDCSLx8K9zY0FtY2N9hERaHXHVCduDBLIBs4LN+63sQ++oH2TD9u1siEKpFU8zbUy4ZBd0dHu5inlSBOer2lM=;25:ajV6Tc8axJTWktG8bZDk/PeTVg59an3MZVD4wbzPOq/0ssDu+Oh/m/2cMIiSXpBLfud8dA6fxrB8XUc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zJQ X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93004095)(10201501046)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:BYAPR02MB4326;BCL:0;PCL:0;RULEID:;SRVR:BYAPR02MB4326; X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4326;4:3rK/U51LeIaEgz0VSVZeDELTotv0Jb7quLd/Ao2MTc2btglbCfS8prOqNZRm4k54ichTc6XICAIOm5tpDaLkFifCfy+Yc+wm2NJzdxbaXpqwcUkwgu/I2WSIn3lsd0ujP7HFR2LmFMqmXpGzNvpQKhO+TqNMxpNYV/gk8iYov72Ew7ys0+EjSMi1l/McCshT6DqTd9fjjp/GILAJUzxSER+SO9nXVQDYJ2SVfURTeUBB0mmbleTcyoZfXO/NIrKr7tGBfqGY8Mg9t8upg1q5P2o7I3YgLXjr/a2A6pgxEbJFp7Iam+wQuZj9j6xb/cLh X-Forefront-PRVS: 076777155F X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4326;23:f/mjmHBVd4Ez+OO1+x6+sGXVdVTUhsRs4OWEOxjG3W4GUjFITROxtmB/7zLLwo9ZqIKezNB4vx2l+Bo+E0klG0ZMxDZR8yiOuFP/UfbZTpp+X4ODljZy/u3rvBA7ev6K8UF5eElvCT+Vwb/I2UYbvk4sEC2kxPtEOwBG7vznCq8oQHXAGIFGcrVEWpH5HpRIt1a2UKBkqa808+sx+ZKPZO94aU426+1pMwk+MJXBKGVxpCc0lIV7U9LctZd0UYFHx335eu/rTtN5oYQ4/ntQ3oFoutFLhA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o4x9mYzG9PfdB5CjJ4wph6W+0SnsWzGiAw6Sy64Izqa0OKZ1XTpLRBsJR6/jGBqNLaZz7tcBfmC+G9qmsFCF9uJrzI93L/KmYRez+rDfAM+F5JJtE68r6/tSQZA40jN+bTeK SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2018 12:25:06.1302 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 084ef1ed-40e7-46e3-37d8-08d6043c7728 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB4326 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Availability of TRB's are calculated using dwc3_calc_trbs_left(), which determines available TRB's based on the HWO bit set in a TRB. __dwc3_prepare_one_trb() is called with a TRB which needs to be prepared for transfer. This __dwc3_prepare_one_trb() calls dwc3_calc_trbs_left() to determine total available TRBs and set IOC bit if the total available TRBs are zero. Since the present working TRB(which is passed as an argument to __dwc3_prepare_one_trb() ) doesn't have HWO bit already set, there are chances where dwc3_calc_trbs_left() wrongly calculates this present working TRB as free(since the HWO bit is not yet set). This could be a problem. This patch correct this issue by setting HWO bit before calling dwc3_calc_trbs_left() Signed-off-by: Anurag Kumar Vulisha Reviewed-by: Thinh Nguyen --- Changes in v2: 1. Changed the commit message --- drivers/usb/dwc3/gadget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 69bf137..f73d219 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -990,6 +990,8 @@ static void __dwc3_prepare_one_trb(struct dwc3_ep *dep, struct dwc3_trb *trb, trb->ctrl |= DWC3_TRB_CTRL_ISP_IMI; } + trb->ctrl |= DWC3_TRB_CTRL_HWO; + if ((!no_interrupt && !chain) || (dwc3_calc_trbs_left(dep) == 0)) trb->ctrl |= DWC3_TRB_CTRL_IOC; @@ -1000,8 +1002,6 @@ static void __dwc3_prepare_one_trb(struct dwc3_ep *dep, struct dwc3_trb *trb, if (usb_endpoint_xfer_bulk(dep->endpoint.desc) && dep->stream_capable) trb->ctrl |= DWC3_TRB_CTRL_SID_SOFN(stream_id); - trb->ctrl |= DWC3_TRB_CTRL_HWO; - trace_dwc3_prepare_trb(dep, trb); } From patchwork Fri Aug 17 12:24:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anurag Kumar Vulisha X-Patchwork-Id: 10568701 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C53F0109C for ; Fri, 17 Aug 2018 12:25:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B27962AFB5 for ; Fri, 17 Aug 2018 12:25:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5ABA2AFFA; Fri, 17 Aug 2018 12:25:11 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 29CBF2AFB5 for ; Fri, 17 Aug 2018 12:25:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726896AbeHQP2X (ORCPT ); Fri, 17 Aug 2018 11:28:23 -0400 Received: from mail-eopbgr680080.outbound.protection.outlook.com ([40.107.68.80]:58496 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726436AbeHQP2X (ORCPT ); Fri, 17 Aug 2018 11:28:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bCG4c+MPOz6leC/slTpfhVWrPPFm3TM+1o9djtGHrr8=; b=loGz2hn/5p/n1TdmfZ2SMyjiKODaThVUlR/nB+vw93Je5xFUjivx39w68uMzsPVbAo3ea9HkSqjiVcVCLME6x+7clM/TXaksEhesmx+ZecwT7iVG0dDLbGfyBumLM0HDVfO08ipyHLUe31gCNFhwOQkV99nisXrGUJM1aqN6q28= Received: from SN4PR0201CA0038.namprd02.prod.outlook.com (2603:10b6:803:2e::24) by BL0PR02MB4449.namprd02.prod.outlook.com (2603:10b6:208:45::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.19; Fri, 17 Aug 2018 12:25:05 +0000 Received: from SN1NAM02FT036.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::207) by SN4PR0201CA0038.outlook.office365.com (2603:10b6:803:2e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1059.21 via Frontend Transport; Fri, 17 Aug 2018 12:25:05 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by SN1NAM02FT036.mail.protection.outlook.com (10.152.72.149) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1059.14 via Frontend Transport; Fri, 17 Aug 2018 12:25:05 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:42334 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fqdoP-0008VK-4a; Fri, 17 Aug 2018 05:25:05 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fqdoK-0000U3-3h; Fri, 17 Aug 2018 05:25:00 -0700 Received: from xsj-pvapsmtp01 (mailhost.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w7HCOvka024713; Fri, 17 Aug 2018 05:24:57 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fqdoH-0000TS-EH; Fri, 17 Aug 2018 05:24:57 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 89B8C60509; Fri, 17 Aug 2018 17:54:56 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , Anurag Kumar Vulisha Subject: [PATCH v2 2/8] usb: dwc3: update stream id in depcmd Date: Fri, 17 Aug 2018 17:54:49 +0530 Message-ID: <1534508695-12642-3-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1534508695-12642-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1534508695-12642-1-git-send-email-anurag.kumar.vulisha@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(376002)(136003)(39850400004)(346002)(396003)(2980300002)(438002)(199004)(189003)(5660300001)(6666003)(52956003)(426003)(6266002)(186003)(476003)(2616005)(50466002)(336012)(48376002)(107886003)(126002)(36756003)(446003)(486006)(14444005)(103686004)(4326008)(11346002)(36386004)(51416003)(110136005)(42186006)(54906003)(47776003)(316002)(63266004)(2906002)(26005)(39060400002)(478600001)(16586007)(81156014)(8936002)(8676002)(15650500001)(50226002)(81166006)(90966002)(356003)(106466001)(305945005)(76176011)(106002)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BL0PR02MB4449;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;SN1NAM02FT036;1:ux2pGezPFr6/HvaN4HPmJgi1VN5CAebcVJ0Y2Oc/F+lVzP0D6nj3HfOYxpDejQlJtMUY9fazjkI810yWkYwm5zc6J4PXog7FL9/esltNDidQnPBYYnw93T5hVY0QqF1i MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2e5ad8b9-a232-47ac-6d72-08d6043c76e6 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BL0PR02MB4449; X-Microsoft-Exchange-Diagnostics: 1;BL0PR02MB4449;3:IiC7SJ4PnWI41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n8HC1ExGb9cP5aGolcuA9B7a/juAoIaX1aWsxKtWi0bv/vRqsNd0rsRYZ9J7mV0+Q7tT1J6LXuP4yRSvoPSH4Ep1KFJ+P2gjSm/+wpp9n0utnEcjkvgVYzPP7jaWoA2S3OhIDJnxyZybKw9e1xONpbPl4zy+ITV4VwyYxum8iu8Kp6Vg0FDuoMCxuxlfFK/emXtXO28plI6ZZ/idECxPa+IUxAePI5HJraxw5N46aJcgvC2M8n/+Z1AZsdBCs34dQZoela5EoKRZRoAJwGFfbkcXUnOM/uWwOQPCiwLqkSvnnVo1n6OWHGuXxDHbW0jWosKwaetf5QuWE4sU9s8jcJyITj5zUVuE+xwwnMtnKWl/01hgo4R3zeUA0LPamc2zYZYvvRg09/Lt7O/CkqLbCdq/dRnOEz1QQmuHQJuJPHDq5 X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93004095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:BL0PR02MB4449;BCL:0;PCL:0;RULEID:;SRVR:BL0PR02MB4449; X-Microsoft-Exchange-Diagnostics: 1;BL0PR02MB4449;4:HswS9TdHnWO2MN65tj8eF0H6GC1AO3zWOdZZKAEy7jgsI8IXO99vkX3ozMA61KY6DvLAykCmT8gKhSDA5Zut66LCXkYVymFnWkmYB0MM134HfU3zxI1TXGrf2ecMH0J4z5GY4OI1FV2d5rXMkmYfVyBuQ1GVeAJ9yVGV4Xyd1E14DmsEvJ1oWOyy7TDVhYQhtnUunRk1Yt9SuXkAxbjlKRP/cZ64kwL98grFmHQ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5COQFprEoFALsv5U9fcN6uZWXQLZ+iMezgBiKhfZn3pUE/fZM6FDPryalbJhQ83s0A1y6h1pWl/Ujc9NgS4MzDZIYaq/f2EzL7wgXsGwdukQhGus+aY7UOm81QrVdol49e2MSm4la8Ku8RLZ5gphn1uzIVbXU88lYc2EY3YSEZvFJXZT/6BqyNAb365uXC3Qszpvl0HSgPfzNwDw5thCYzSONLUf3ESDVnMzm86HwHvTVHsh16BiO3r5m6316oAb9RQjQHeoSyfNSzYzZbAdEWAi33hlFndQopfCARThX20arvHHufXrMY0h4DrQd8JfUsDI+c= X-Microsoft-Antispam-Message-Info: s/gRceit1dxXbgZePrLDBAU17cbV/mvR3hMfJBQqnslX2JTYtENmbTrHenLt53jHi7emOAnBU7zXhiJCcinm8vyFe33TiwABpUH22G8ZG2KQPE3eidg6/QLiFS84fai3nKLqlK8J3XkaaUcbZ9knVMafnxiBjIwMzx+iZTF3rlTyV1eh+WwrlsJbFmaXBr3UggjxJ4BznQ+a0TiJ95U3eF7YGD/YCvg8q2SEDOXgYiqHgcAfAp+/BSv94QN6vTPWTlepAO8N1Sw3zSifMKN2pDuxBXPX5B4wPk/vEcuJT0JY+cX1diu6UlhguKgASAqNWN50G4GjE3ThWXlcwMXxRNDdAVqfuOHb4DxhifGViFc= X-Microsoft-Exchange-Diagnostics: 1;BL0PR02MB4449;6:tv0/hqRKNeltSYQVsmnSHXMxA05DXrZeJw1DOBP8su8ZsAFj6TiedlxEI/tujOsk7W45fDO/+LR0asfIma6nSDKAHX35RySDdU/HEXaEU3ycqdGZ4bPADZlH8vCsXnLoFz5N9Cfi6KAo3KFuHQB4ibdz+q76JMsKLmom6wcNJq9uBWvV+sHLDiRrBOVOD83Y4RWu/VHyzXaSFseVCovHXvVVKGshgUeB9kPI/qQqlsL50n5inhqeN1q1UZbAzTARe86BjNYUsCdIzAupG6Cr/5xWSR69O35NA82F0hARPHKlIcb1QsRz1Tyz7XBfffJmNWz6z3uSeqMHU8OQ8gauhjLuu11YI0pm7+eonzQgjAxiLilTq7y7mXivhE7gSTwVLPVh6vpzQfw6/cl4jycJVvTpAhm00ZlY99lijSMGIGg+oUp0W5iT7Lj/HVr9vIZPa4+zqsOK9B4wheKmipUgHA==;5:iYT7V8L8Ks5E3/7tnfkwm3tmKfUUrGV/vS3UT7YuHrjbykeyfKGGFh2bNEBzegm2vJVU0Ia2i8TwFCeD9j5sSfQCd4RiXFvscrITYWKjnVHLW2ME2BOwBoPhhAxatwt/RzrJX5sZJ9pdhMeOZE6ActR2k4Fl2vV+oaRI2fT6CI0=;7:Z5Y8rGxAKt7Hxx0FdWkFmtJFKXla6C7sCKiOI5kpNYY9hoI7VZTnEN/R2f/9JiNZJJnsX/oK/ZSyweEmPeGr2Wja9ND6MsGKhc2AoBSV2Ch1z9EaWA7/hpuHEOQEfoJfvGfvhk/P0xltZAfCm89QNBmjduiRsKfedxczrOyf430YVBT+/YNjAygUubwpj3FB6XYTt5xW2S0GvawJlNVQwkj8GylCWipNL/qKoV/oZUU4MbiIb/IKWP6LA898SVwf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2018 12:25:05.6521 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2e5ad8b9-a232-47ac-6d72-08d6043c76e6 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR02MB4449 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For stream capable endpoints, stream id related information needs to be updated into DEPCMD while issuing START TRANSFER. This patch does the same. Signed-off-by: Anurag Kumar Vulisha --- Changes in v2: 1. None --- drivers/usb/dwc3/gadget.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index f73d219..efc6e13 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1224,6 +1224,9 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep) params.param1 = lower_32_bits(req->trb_dma); cmd = DWC3_DEPCMD_STARTTRANSFER; + if (dep->stream_capable) + cmd |= DWC3_DEPCMD_PARAM(req->request.stream_id); + if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) cmd |= DWC3_DEPCMD_PARAM(dep->frame_number); } else { From patchwork Fri Aug 17 12:24:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anurag Kumar Vulisha X-Patchwork-Id: 10568717 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BFE6D109C for ; Fri, 17 Aug 2018 12:25:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE15E2B29B for ; Fri, 17 Aug 2018 12:25:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A21122B4E7; Fri, 17 Aug 2018 12:25:59 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2496A2B29B for ; Fri, 17 Aug 2018 12:25:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727624AbeHQP3M (ORCPT ); Fri, 17 Aug 2018 11:29:12 -0400 Received: from mail-sn1nam02on0043.outbound.protection.outlook.com ([104.47.36.43]:8548 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726544AbeHQP2X (ORCPT ); Fri, 17 Aug 2018 11:28:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BDENqAbDNVofKmdyJzDafRqsk2UMvDhBNU8Dvr76AUY=; b=wTMD0LyTXl097HXArhjFbEVaJWHnHaR8jmjsPavdblxwYxBk8C45WDV1lFKS1OLEGjZzRxHtemt7GsCRwbF+f0ureaoBRhZwtsCPKdYxuMo3bILlHNHgzsDcfexX+EwyiSHvAwhQ6V+bE4ZzYwxhpzDpMoJmKvEMz0vWXHXqzbY= Received: from MWHPR0201CA0016.namprd02.prod.outlook.com (2603:10b6:301:74::29) by BYAPR02MB4328.namprd02.prod.outlook.com (2603:10b6:a03:56::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.25; Fri, 17 Aug 2018 12:25:06 +0000 Received: from SN1NAM02FT060.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::203) by MWHPR0201CA0016.outlook.office365.com (2603:10b6:301:74::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1059.20 via Frontend Transport; Fri, 17 Aug 2018 12:25:06 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by SN1NAM02FT060.mail.protection.outlook.com (10.152.72.192) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1059.14 via Frontend Transport; Fri, 17 Aug 2018 12:25:05 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:42340 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fqdoP-0008VL-7v; Fri, 17 Aug 2018 05:25:05 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fqdoK-0000U3-7P; Fri, 17 Aug 2018 05:25:00 -0700 Received: from xsj-pvapsmtp01 (mailman.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w7HCOwW9024717; Fri, 17 Aug 2018 05:24:58 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fqdoH-0000TU-Nh; Fri, 17 Aug 2018 05:24:57 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id D2E146050A; Fri, 17 Aug 2018 17:54:56 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , Anurag Kumar Vulisha Subject: [PATCH v2 3/8] usb: dwc3: make controller clear transfer resources after complete Date: Fri, 17 Aug 2018 17:54:50 +0530 Message-ID: <1534508695-12642-4-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1534508695-12642-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1534508695-12642-1-git-send-email-anurag.kumar.vulisha@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(346002)(376002)(39860400002)(136003)(2980300002)(438002)(199004)(189003)(6666003)(5660300001)(356003)(81156014)(81166006)(126002)(8676002)(50226002)(8936002)(90966002)(36756003)(426003)(305945005)(316002)(476003)(103686004)(26005)(47776003)(2616005)(11346002)(446003)(110136005)(54906003)(2906002)(6266002)(107886003)(4326008)(48376002)(16586007)(36386004)(39060400002)(106466001)(63266004)(486006)(50466002)(106002)(478600001)(42186006)(186003)(51416003)(52956003)(336012)(76176011)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR02MB4328;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;SN1NAM02FT060;1:yPWjRW5da0etNB+iSf2JacMydpsd+6RviY/77KwPSXw8SvbEeyycT9MzUyEokjmiOTE5/7pFGOBJRfU6BdexkcsQeExSo928jleMyrJhjRVnvU5P3mzQCv5TAbCOoW9W MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1acd8534-02e7-4e0f-2da3-08d6043c76db X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BYAPR02MB4328; X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4328;3:cByNbAJ0IOqgYtp++BfFhrNL/pnzfUCzmcfF1pgeLHCnBiNnC35NG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ROmyyd1wEUY2GUBwoa4vKgUVoe16S51wp2xTwPsWAZLzm7QLYVJe0IUYS7Qvvd0j4cVDDCjx17vihdXXrwUgTr1PMoPr8Dehrb9HIazmjNzsGSPUz+mfzkrHDwbIyJYoRHQeK+UnWgBECB2NZEI3KpKpZtI3ZtjqwFM6jYXCXZChFJgaSdsH5XBfa9zq06MV26guOBOh7CWa8nu8u/OZWwrBY8tUz1QgpdQzmFjawDHMCHaLaA+boHb0Cul9LxtUvJOYd5eziGV643huVG6zLzixR8GEm6MxKic//LM+wjPIsBnSMq0HVQDRkHy6Z5CMu3lex+eRqZZyw3GQg86eEqwL9sHlD+JqL++A9Zlryq8n1zZb8MZLLgnXq9SYQ1DZi1pufVNKj8J X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93004095)(3002001)(10201501046)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(201708071742011)(7699016);SRVR:BYAPR02MB4328;BCL:0;PCL:0;RULEID:;SRVR:BYAPR02MB4328; X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4328;4:DQe0ztSsqwtC0P4m5zYt+2wp0DlodACmEhIiXSWVtYmWqQwPGLcuyWpcrNoPdKBxwRDPW/zBkzcQrOlRPNxbcXWHgQPHiayyxXUM2tPZZuLeZ3cYk/X+tttDDYZVdcUS6nizBzfnQdr/NNTdQC7j3+c+nO5WZR470uSsnYjmNdUpEAq4SkKls/leL+o0P/wVYSgAuGvMcDg5rTSV7znQ36kjct06CrhSVGQ5t8ofWiQCQkE2Qg8HOQhSQB9v5QxRsczBufkt1OcP7v1D8hGOo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ucyHNZLTA0gheipjWEp083JYSNMVkmFhbql9zK6PaC58Ow==;5:Vnra8t4mnZgoU8uSQtFp2eper02lnawjq1OlxPbKRxsXFtAawgTA/98FpLzdZG7eWIhDBzkDdzANWhBK85c9XmCCvYhy611efjzGxI0zVMszonQbo7j2RkIq38KMaJKMC1/GUNV59bkXYcLVqAuuK3mHYuxeUnydxwjMnFpTRUM=;7:r3cbb/Hh2/BbXFiS0RTENEep7RgXrd/5GQ5J8SoirK0uf74Wu410iNJRcwyIpFg4NSyj3ZSJjH+bsYGkbY804TXm0GXlNsc9t6FhuBOtTBG6DxZhu7wEXuIV6ZjeX4Qv5R3UMMVoeLmUN7FTW8tyTF76hiTHU3xRMcfj1KKM0Z01UkxvQSLe+p7/Y09JvOy5lTZyNDT2nJXFY0zE8Bcn44IePGM4gQSNQfjm4gnG/9zA5HBRCPA9XGuzkNcxzz2t SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2018 12:25:05.5784 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1acd8534-02e7-4e0f-2da3-08d6043c76db X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB4328 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To start transfer with another stream id, controller needs to free previously allocated transfer resource. This will be automatically done by the controller at the time of XferComplete Event. This patch updates the code to issue XferComplete event once all transfers are done by setting LST bit in the ctrl field of the last TRB. Signed-off-by: Anurag Kumar Vulisha --- Changes in v2: 1. None --- drivers/usb/dwc3/gadget.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index efc6e13..b3e9e7f 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -571,7 +571,8 @@ static int dwc3_gadget_set_ep_config(struct dwc3_ep *dep, unsigned int action) if (usb_ss_max_streams(comp_desc) && usb_endpoint_xfer_bulk(desc)) { params.param1 |= DWC3_DEPCFG_STREAM_CAPABLE - | DWC3_DEPCFG_STREAM_EVENT_EN; + | DWC3_DEPCFG_STREAM_EVENT_EN + | DWC3_DEPCFG_XFER_COMPLETE_EN; dep->stream_capable = true; } @@ -999,6 +1000,15 @@ static void __dwc3_prepare_one_trb(struct dwc3_ep *dep, struct dwc3_trb *trb, if (chain) trb->ctrl |= DWC3_TRB_CTRL_CHN; + /* + * To issue start transfer on another stream, controller need to free + * previously acquired transfer resource. Setting the LST bit in + * last TRB makes the controller clear transfer resource for that + * endpoint, allowing to start another stream on that endpoint. + */ + else if (dep->stream_capable) + trb->ctrl |= DWC3_TRB_CTRL_LST; + if (usb_endpoint_xfer_bulk(dep->endpoint.desc) && dep->stream_capable) trb->ctrl |= DWC3_TRB_CTRL_SID_SOFN(stream_id); @@ -2268,7 +2278,7 @@ static int dwc3_gadget_ep_reclaim_completed_trb(struct dwc3_ep *dep, if (event->status & DEPEVT_STATUS_SHORT && !chain) return 1; - if (event->status & DEPEVT_STATUS_IOC) + if (event->status & (DEPEVT_STATUS_IOC | DEPEVT_STATUS_LST)) return 1; return 0; @@ -2457,6 +2467,10 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, } switch (event->endpoint_event) { + case DWC3_DEPEVT_XFERCOMPLETE: + if (!dep->stream_capable) + break; + dep->flags &= ~DWC3_EP_TRANSFER_STARTED; case DWC3_DEPEVT_XFERINPROGRESS: dwc3_gadget_endpoint_transfer_in_progress(dep, event); break; @@ -2472,7 +2486,6 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, } break; case DWC3_DEPEVT_STREAMEVT: - case DWC3_DEPEVT_XFERCOMPLETE: case DWC3_DEPEVT_RXTXFIFOEVT: break; } From patchwork Fri Aug 17 12:24:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anurag Kumar Vulisha X-Patchwork-Id: 10568707 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 37BBD14BD for ; Fri, 17 Aug 2018 12:25:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 242D22B020 for ; Fri, 17 Aug 2018 12:25:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17DAA2B400; Fri, 17 Aug 2018 12:25:26 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B2BA2B020 for ; Fri, 17 Aug 2018 12:25:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727484AbeHQP23 (ORCPT ); Fri, 17 Aug 2018 11:28:29 -0400 Received: from mail-eopbgr730078.outbound.protection.outlook.com ([40.107.73.78]:1584 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726795AbeHQP22 (ORCPT ); Fri, 17 Aug 2018 11:28:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kdx9OIFGBN8hg2SN0GaRDQsgf+nUyqA+bZSU7irLA0A=; b=PITN4PNItWuaZGWuxCb3vmAECZnc5FHtDYnKy9Q7asfN7cyWLsMmstb48zbR/CzDNtrVObRUUDoRX3Hwuq7XpBMsCC+pYUDlWWpEtvr2qMGvzWCbjJN2URuoPzp/2s7L3mwRyVpxYFhh8kMSuPcxT2qgo7Bm5B1VXHHfEfozJv8= Received: from BN7PR02CA0016.namprd02.prod.outlook.com (2603:10b6:408:20::29) by DM6PR02MB4460.namprd02.prod.outlook.com (2603:10b6:5:29::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.20; Fri, 17 Aug 2018 12:25:06 +0000 Received: from BL2NAM02FT054.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::207) by BN7PR02CA0016.outlook.office365.com (2603:10b6:408:20::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1059.21 via Frontend Transport; Fri, 17 Aug 2018 12:25:06 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT054.mail.protection.outlook.com (10.152.77.107) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1059.14 via Frontend Transport; Fri, 17 Aug 2018 12:25:05 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:42351 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fqdoP-0008VN-CX; Fri, 17 Aug 2018 05:25:05 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fqdoK-0000U3-Bq; Fri, 17 Aug 2018 05:25:00 -0700 Received: from xsj-pvapsmtp01 (maildrop.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w7HCOwnZ019095; Fri, 17 Aug 2018 05:24:58 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fqdoH-0000TW-Vs; Fri, 17 Aug 2018 05:24:58 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 1A1226050B; Fri, 17 Aug 2018 17:54:57 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , Anurag Kumar Vulisha Subject: [PATCH v2 4/8] usb: dwc3: implement stream transfer timeout Date: Fri, 17 Aug 2018 17:54:51 +0530 Message-ID: <1534508695-12642-5-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1534508695-12642-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1534508695-12642-1-git-send-email-anurag.kumar.vulisha@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(396003)(376002)(346002)(39850400004)(2980300002)(438002)(199004)(189003)(52956003)(8936002)(36386004)(47776003)(2616005)(126002)(486006)(14444005)(336012)(26005)(476003)(81156014)(6266002)(81166006)(36756003)(575784001)(63266004)(186003)(6666003)(8676002)(51416003)(356003)(107886003)(5660300001)(305945005)(110136005)(39060400002)(54906003)(106002)(426003)(2906002)(42186006)(90966002)(103686004)(16586007)(106466001)(50226002)(11346002)(478600001)(446003)(50466002)(316002)(4326008)(76176011)(48376002)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR02MB4460;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BL2NAM02FT054;1:hQa38XuJNznv814CAq+RqmSqDnRIdUzv20S2/kb6N03NNoaaeFqGW8YQdbTO01HqXz+jybgNL66aSKyoERbdQ7r+zWaJD4GXyWb1TKY9Ej+ACf5prZVzcSdc6+pjSXVN MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4e6dc72b-dd1e-4017-28f5-08d6043c7719 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM6PR02MB4460; X-Microsoft-Exchange-Diagnostics: 1;DM6PR02MB4460;3:2DOE4OkZln0LIp+UNF9aRuWF1oU1C08MXYSUICSjgAh3aK4EzuHojFs+wdgPS4UT9fpRc9W/Zg6NhJNR8kMCCKHlcywLn3YjmVWddeIFDPVIYwxsC9z9rqOIM8xxbJOPtnVxE0ngKu5I/+F4jikb2kHOW3n6nHyQ8AprgBw05FFLbwxu4CFb43RX67bozUHorArNilDQ3oQAgy9XZmpPGrE1llp2fx5a3uWkNxyVo4/sAsAAub7PoK8Oef7Yn04+fkZBPw3Od0DPQT9thQuEU06ATzTMOsntxdFx8xB3YDFYjjGBvGcHB4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fuyfjFU0RK2Tid+ab+t3YpAt2JFc3oC/FZxM5B8SFWhRKwz4aEpr38Ltop5KD3O45ocI0XBpq7JTIwC3vaZT8Iz0V6zyxt6LCTLmaiOHJolisrQacXXjccvZVUtSybrMwJ2TDOsH00i2aTrne X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93004095)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(201708071742011)(7699016);SRVR:DM6PR02MB4460;BCL:0;PCL:0;RULEID:;SRVR:DM6PR02MB4460; X-Microsoft-Exchange-Diagnostics: 1;DM6PR02MB4460;4:C5IfWaYyxqQGrdd2Hl7v7z3hVxDWPdJCIklD1JhHs1bnp+LB6eh7F5wZhkD3v1p+Y63NyXzY0dX3rfBf0oyG4mNXmS4XkOp8IwGvMw4xODlZw953C0lIppE5Xk2DyKIk+E3tAOPlyMTfAAJjGPBY1T+Di0NCq5zKl7V5QDIDBcd304KBN5/YEL0rpn1bPuwQYLyJ76VlU82jZIgHdW9qHViczP+2lKcvd/59tnQIbWIORAgvln8BCtaq8e2dT2koF36t3ERYAgKNB/MDUOJzZblkFFJzVQtNxEdRnEtCQ6EiCtJsVPVNkwdM2UG5d/84 X-Forefront-PRVS: 076777155F X-Microsoft-Exchange-Diagnostics: 1;DM6PR02MB4460;23:v7JMbswzyVJ1rQBJil5FXSWSYRfbU5zHG2jak8krJ3CqToKh2f61BU59znw5bP8vAHw6yQv+xMselA5hvbyygz08njKpi+whwChdnx/mGT3pKlBI2oxLmOxV2DH9zGG708eQDppSzFLZ7XJnOQTkzkZTDED/ei3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a/s2+P5FQoOEorJ/vrploJFbuQM=;7:zNrPE5Mbgqd5eBbnxaOm637/55m4w7NyNHcGG8SFGt4a7cjz8znx7ch8fWW5bh5jPcIhm32ukqvebe7gtfybTHC2IlwI3DJJxVnrvwRhz3ZsMDW2BjjXB7lzTzX27VHKjs7XaiZaVe3glYmoeMECrJkTGhfWa+nOpF4Pn6dJwouxPT0TKa954OoxhNUG26iXySNmLh2LPSEMdXhXb0q+6+I2QzlnYhT82qX3ngfX0TraptHobjeCmBcEAW6ftOaF SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2018 12:25:05.9534 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4e6dc72b-dd1e-4017-28f5-08d6043c7719 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB4460 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP According to dwc3 databook when streams are used, it may be possible for the host and device become out of sync, where device may wait for host to issue prime transcation and host may wait for device to issue erdy. To avoid such deadlock, timeout needs to be implemented. After timeout occurs, device will first stop transfer and restart the transfer again. This patch does the same. Signed-off-by: Anurag Kumar Vulisha --- Changes in v2: 1. Changed STREAM_TIMEOUT to STREAM_TIMEOUT_MS as suggested by Andy Shevchenko --- drivers/usb/dwc3/core.h | 7 +++++++ drivers/usb/dwc3/gadget.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 285ce0e..f58640f 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -619,6 +619,11 @@ struct dwc3_event_buffer { #define DWC3_TRB_NUM 256 +/* + * Timeout value in msecs used by stream_timeout_timer when streams are enabled + */ +#define STREAM_TIMEOUT_MS 50 + /** * struct dwc3_ep - device side endpoint representation * @endpoint: usb endpoint @@ -642,6 +647,7 @@ struct dwc3_event_buffer { * @name: a human readable name e.g. ep1out-bulk * @direction: true for TX, false for RX * @stream_capable: true when streams are enabled + * @stream_timeout_timer: timer used to aviod deadlock when streams are used */ struct dwc3_ep { struct usb_ep endpoint; @@ -691,6 +697,7 @@ struct dwc3_ep { unsigned direction:1; unsigned stream_capable:1; + struct timer_list stream_timeout_timer; }; enum dwc3_phy { diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index b3e9e7f..8cef488 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -254,6 +254,7 @@ int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned cmd, u32 param) } static int __dwc3_gadget_wakeup(struct dwc3 *dwc); +static void stream_timeout_function(struct timer_list *arg); /** * dwc3_send_gadget_ep_cmd - issue an endpoint command @@ -574,6 +575,8 @@ static int dwc3_gadget_set_ep_config(struct dwc3_ep *dep, unsigned int action) | DWC3_DEPCFG_STREAM_EVENT_EN | DWC3_DEPCFG_XFER_COMPLETE_EN; dep->stream_capable = true; + timer_setup(&dep->stream_timeout_timer, + stream_timeout_function, 0); } if (!usb_endpoint_xfer_control(desc)) @@ -730,6 +733,9 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep) trace_dwc3_gadget_ep_disable(dep); + if (dep->stream_capable) + del_timer(&dep->stream_timeout_timer); + dwc3_remove_requests(dwc, dep); /* make sure HW endpoint isn't stalled */ @@ -1257,6 +1263,12 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep) return ret; } + if (starting && dep->stream_capable) { + dep->stream_timeout_timer.expires = jiffies + + msecs_to_jiffies(STREAM_TIMEOUT_MS); + add_timer(&dep->stream_timeout_timer); + } + return 0; } @@ -2403,6 +2415,13 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep, stop = true; } + /* + * Delete the timer that was started in __dwc3_gadget_kick_transfer() + * for stream capable endpoints. + */ + if (dep->stream_capable) + del_timer(&dep->stream_timeout_timer); + dwc3_gadget_ep_cleanup_completed_requests(dep, event, status); if (stop) { @@ -2486,6 +2505,14 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, } break; case DWC3_DEPEVT_STREAMEVT: + switch (event->status) { + case DEPEVT_STREAMEVT_FOUND: + del_timer(&dep->stream_timeout_timer); + break; + case DEPEVT_STREAMEVT_NOTFOUND: + default: + dev_err(dwc->dev, "unable to find suitable stream"); + } case DWC3_DEPEVT_RXTXFIFOEVT: break; } @@ -2587,6 +2614,18 @@ static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force) } } +static void stream_timeout_function(struct timer_list *arg) +{ + struct dwc3_ep *dep = from_timer(dep, arg, stream_timeout_timer); + struct dwc3 *dwc = dep->dwc; + unsigned long flags; + + spin_lock_irqsave(&dwc->lock, flags); + dwc3_stop_active_transfer(dep, true); + __dwc3_gadget_kick_transfer(dep); + spin_unlock_irqrestore(&dwc->lock, flags); +} + static void dwc3_clear_stall_all_ep(struct dwc3 *dwc) { u32 epnum; From patchwork Fri Aug 17 12:24:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anurag Kumar Vulisha X-Patchwork-Id: 10568711 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 25DE414BD for ; Fri, 17 Aug 2018 12:25:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 148492B020 for ; Fri, 17 Aug 2018 12:25:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08A9A2B400; Fri, 17 Aug 2018 12:25:41 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BCD82B020 for ; Fri, 17 Aug 2018 12:25:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727412AbeHQP23 (ORCPT ); Fri, 17 Aug 2018 11:28:29 -0400 Received: from mail-eopbgr680054.outbound.protection.outlook.com ([40.107.68.54]:6083 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726710AbeHQP22 (ORCPT ); Fri, 17 Aug 2018 11:28:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/wFOTUFvXsd6q7iyl+68eKqY29wu/E/t49K6bssvGTg=; b=eE4/h0alhnle+AUsQUp1Ibxi8on3PikX+esDN5m6yI2tT7H5Ep+t00g0EJpVJfj7h6nbCBkoDiRSko8qTLto6P/46rMi/zdyGkd2yLzHH3APKmRZCqNuMczr2wjl62f0p3YTShGJnVit7K1PtdnCxJMlMK5SXJEvTZRPJIWc+mc= Received: from CY4PR02CA0041.namprd02.prod.outlook.com (2603:10b6:903:117::27) by BYAPR02MB4325.namprd02.prod.outlook.com (2603:10b6:a03:56::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.25; Fri, 17 Aug 2018 12:25:07 +0000 Received: from BL2NAM02FT030.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::205) by CY4PR02CA0041.outlook.office365.com (2603:10b6:903:117::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1059.19 via Frontend Transport; Fri, 17 Aug 2018 12:25:06 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT030.mail.protection.outlook.com (10.152.77.172) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1059.14 via Frontend Transport; Fri, 17 Aug 2018 12:25:06 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:42394 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fqdoP-0008VP-U4; Fri, 17 Aug 2018 05:25:05 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fqdoK-0000U3-TU; Fri, 17 Aug 2018 05:25:00 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp1.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w7HCOwfE019097; Fri, 17 Aug 2018 05:24:58 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fqdoI-0000Tc-7I; Fri, 17 Aug 2018 05:24:58 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 258A36048F; Fri, 17 Aug 2018 17:54:57 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , Anurag Kumar Vulisha Subject: [PATCH v2 5/8] usb: dwc3: don't issue no-op trb for stream capable endpoints Date: Fri, 17 Aug 2018 17:54:52 +0530 Message-ID: <1534508695-12642-6-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1534508695-12642-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1534508695-12642-1-git-send-email-anurag.kumar.vulisha@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(39850400004)(346002)(136003)(376002)(2980300002)(438002)(189003)(3923003)(199004)(90966002)(6266002)(51416003)(76176011)(16586007)(126002)(316002)(42186006)(14444005)(486006)(106002)(11346002)(186003)(2616005)(476003)(446003)(4326008)(103686004)(305945005)(50226002)(47776003)(50466002)(52956003)(8936002)(48376002)(2906002)(36386004)(8676002)(426003)(81166006)(107886003)(36756003)(81156014)(6666003)(5660300001)(106466001)(54906003)(356003)(336012)(39060400002)(26005)(478600001)(63266004)(110136005)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR02MB4325;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BL2NAM02FT030;1:1hC5Ar00JhWeXtewQ80m9wNWRFzKDae2+VYacx9ji/LlGs8r0sGGqL92iWA7fhM4FQX9AUnNYYh2n3/j1EYydspU1llTGpsEupZWhfDbxGWtuG8ciqiUujF+he3lHAs7 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6b372a06-99f4-4201-45bd-08d6043c775d X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:BYAPR02MB4325; X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4325;3:GJvGoNtcQBrAYyJPLHGpQMVFC1+baR/fzf0XouV0/ofb+rt9uHlp+9ofVpJTd8ICuLnj2YtVIhhjMf3/N08lhmnwoixR4SIZQgeEkC+wQD+zoNMNP1zABVsoewdVDHU+YRdUGntlLyI/p8MRsRXTjciEfG77UBVM8cl225dkLOE0flzi0jTxevASvoQfVVs64mxBQ4JRAYIcuNnCXibg2hAjk387JCCazhSDKDAOHyZy2xzHQG6WaZyEoatQ8zFfaw0iGBmAWqXsQYW7J8wBBe68WGyGd2CpnCUgC69e37mz8fGxosdYu301+aJKifwbehvghVW4vWtBUWbSNmBDyLlKQC4r4skGtpQiMohwglw=;25:tlBODgUjUacDfarevMyfFo4nXwE5p0oOxdycpUB/2B9Uctijntgd57eMxsjMXyl67wyiMTLs4sSbHgfvdCbhMpOOMyQ6yYvG2wUU960i3nhEP0dXFSI8hjGSHxeXSW05hsWUZcugawivN5d9hBj9xXr/dkkvpiOoUsqJqBmUqSaiLA4OPuJ2N6q9vGQYL37WggHFFsqJfQyxEawaVdy/StmSX25t2q9O/pROqI1pqGggeKRmFMVhWYiQlUih6vmpYe84Vvopfo6L79O8Tf8FF25Qu9InjHY+3pFb6++cEymvcOoeJhEho5QKBPjFXWw7aJrbAmVbgtqedSZokgCrwg== X-MS-TrafficTypeDiagnostic: BYAPR02MB4325: X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4325;31:0ZZ9ZeLqWMBZv0Q94FU+eHT2ccEdnyt8543xvpQ96bYA/u8z1a5Fa+15whlzfqMtFFPJpvq9qiBcWJ0ddIMeHzWsiEMW3nTOY74k/HMgQGe1vZWJHbdviY/bgO7nmafCCGdgTiB1imt0pqvZUHB11c8zY0iT4KjNXZiSmhMu/uIYBFrIuVkLSgctBlG3Fw6IW+JY7eD4frw12hnsv6Oe92n3n8IXUj9JjHfkPiFORvE=;20:uwL7GX0C49QGXOPy7fsiSfvI8nqGCqvlHUc6Ob6XpZ7PcxTAKCwjjByTRp0knyDbLQ/NnBJngT/S/tCvTP8zwQERs3d6nBaMAlADnwpAYYW8nI4lB7Gi9jK7Lw32zymAnI2kPG2xOcydRWqIumPAdo8qDxRkarO/whCIWp3QxvKcbpd7qBMyRhtK2bbrMr6/cC0CvjRkK7EpWD8EP7yG5q3daYd4KnCGlLLzSWIC5GaOXaDvogoq7pJy/6MhpO9z1OAEleBYqwOrebEsxmOB6NCt4TYXyXqPttnhnXzl0TGs8NS4OgINEGXONrmjCq6U3EfOpRomQQ+x15bl5Q2aQqmRel5gOFQenj5KLCp+3hSt+A42xXCqpdnwP0yEn1i2H2kItM82VPcwCMnoxDMJwT7g3vtlHpdcSOS8tT6rmWSmrZhsRCFIoyDX4tIkjgjPPxeWcXerSE6Z8/IOU+FUiY7hpO2IZg+qTmmViK3wppfZnTr8dgEXyQSRdXYuKzaT X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(10201501046)(93006095)(93004095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(20161123560045)(201708071742011)(7699016);SRVR:BYAPR02MB4325;BCL:0;PCL:0;RULEID:;SRVR:BYAPR02MB4325; X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4325;4:Ghpb3m+sk7mNrwtded4GqOlhJ0IteddsOSF5grhXpfs3x1bddAzqajzPbg4U2bSS0wze/i4HC0pnG0AxAc85eeRc8x/pmtaXFLufxaYk6qN2qhQoTO6V/2PnpKwf5oQUv7dZWclzZ1lueFAsWr4+BE+2lD0wTbYgbvISI7DOBGIC+ZnaP1cZzZiuUTi5eT6+Ddhi2MHxgmi3W+4zZWfEcnLORBiGoMXDP9g4liyoeUNe7PbmwpxpaI8bEfEg2QdIrCfGPKl2+ziTzcdsfqsR9xZ8IMRb2yqIsg1YS14ZYGy89vRobonbcNN3ICRAoWaC X-Forefront-PRVS: 076777155F X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4325;23:mT6cb5cANq3MY7H4RqTmPidMtIx6sb/d04+2nz/Wg418ABlgdJWMt+1D5Bel+uPGxSfdcJkf3AqKebAn8sjtRdTCUM94og0mN2mlpx+xmpmRc+KPZmVh2JiWmZX2EAMvy4OwvAU7HMG8ARp+gjid0eKtQDGSLjCOyLx6BxyOx7elb55qrVQc8otjV+K57iO7WnAj1jVNDqOALNVPRCoyuV6U4TjeXdh2/xCEAKxyz3qZl0aP689J7cfzhuay33TX5AFfzw4KrvPPFfwUql+7MkymnnWpB5CBqPWR7qT1ZNeKRmuxwNgnsorW1t/Avw+p8GiSXEcgtIwrjYnEHdXJgAx41/Ar/HZsidhvJQAP8g8BIjmJ3cDwaa6E/OvyGzIcY9IaRcy4HULFaSRW2R1dGUBcw52ske/5M+jheoZhXHj1ABc1IkM37RPWQ0Yl2oR0MPCEVyJ+vJT1tvBUlbn6Gq+0yfq7LDr6i47EvHgAn12fXXUQsorjrg5f84P6arrAjKryyan8b9Hc0yaIduLifntNaB4oREXNIcBXSBIoGQx4VNWMpb0F/3heSeKPNVJN22dTD4apfZLTL8Z4kPfft3URpR6kt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:brUP8JY6kdLGA43SbXTG+HiNr9WsIIDdmWMbAZEwRpvhP7tvYDXb0/zpgmpIBT83aYrlU6zeMgXtbDd5I40o9KpEkrSQT4FH+ASYk3+gcp16eVs+KLX1qn9VKPFTJWvaZtcMRJ4CVwtDe/n0JkzDD6QLafk38C6L6/fYhW+dr4XRQRSW2q5Vre/VIxTMG5uAPAR3Vj9yHpVoheCOTVH3V0Ayi4WLVkaMZ147JXr1j2wZPVuyqZUj3y3kIZiWoZlEqyrXwjzcPFZOdfcceGVDCXxwGZiNipWuAQKk6vqUPEH5A2BNIgtEtrNj5UvpHPoOqJDw+kJ0dIfUryNo/ao7slzKD3B0lVE3AhfUFrhN/t6eZmauntiHXCM4DcKdhFOlJs7bNSYgzLUYHGoNDCbvRJDLvlurNuqc+KAI/qrGL2fMiltdKVlRZj47Iauj/QSxhjr1lfTJH86eT6qYgIIpeg==;5:tOO1TYXN8w7NLo9PBaHDvpT5ude7mnUQjm6npY85R/T4GlXCIT6bzFg7GupLxGBnM3DPWEiibseKu0F/FMPwfnxTMdRGlVkEcweQ/0/VP4SQaFeuZMh7QgmSEfT1OuTnI77NeMC4ZuMca5xC/2eK3IH9FCQyZwcRdrM65r6/aSk=;7:2LoJAKEl9C7wpVVrMQNWZmR6Io7esDstmpe0FIUQd+hBCk3lS9yf9+Vo5bQL3/iNTgbfiAB5/qXrSsnyd8z681sQYHlTRSZFu7kAtNLDO8epc42moLyy1RC0c1YjL88lcdTrhaC4RHbb8o3W0O18eHMSkHAjZBEKAuaR23eIdlI5U1S4jONMvXptGG1xbgBkcOKi7x643RU4H0O+8DMRzleqIbeIQ5CkFXfgM+5E5n25IuHjdn6wXwxmGtji8vd2 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2018 12:25:06.4779 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6b372a06-99f4-4201-45bd-08d6043c775d X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB4325 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The stream capable endpoints require stream id to be given when issuing START TRANSFER. While issuing no-op trb the stream id is not yet known, so don't issue no-op trb's on stream capable endpoints. Signed-off-by: Anurag Kumar Vulisha --- Changes in v2: 1. None --- drivers/usb/dwc3/gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 8cef488..260f10f 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -668,7 +668,7 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep, unsigned int action) * Issue StartTransfer here with no-op TRB so we can always rely on No * Response Update Transfer command. */ - if (usb_endpoint_xfer_bulk(desc) || + if ((usb_endpoint_xfer_bulk(desc) && !dep->stream_capable) || usb_endpoint_xfer_int(desc)) { struct dwc3_gadget_ep_cmd_params params; struct dwc3_trb *trb; From patchwork Fri Aug 17 12:24:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anurag Kumar Vulisha X-Patchwork-Id: 10568713 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9A83714BD for ; Fri, 17 Aug 2018 12:25:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 888102B020 for ; Fri, 17 Aug 2018 12:25:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B2882B400; Fri, 17 Aug 2018 12:25:47 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DDDB2B020 for ; Fri, 17 Aug 2018 12:25:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727247AbeHQP2X (ORCPT ); Fri, 17 Aug 2018 11:28:23 -0400 Received: from mail-sn1nam02on0076.outbound.protection.outlook.com ([104.47.36.76]:40480 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726685AbeHQP2X (ORCPT ); Fri, 17 Aug 2018 11:28:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=At+WIRAdFd5BdQ9QOsJTqlBefuOKmCOtiVL0faHCGmg=; b=CGXtPGwFWL2xQCipB/Alj8SsmhfW1pMCxLcK9rdqGAY/dVWrkRTeUK+Y6DiuedFGfylQSR9L2k0M27TsdfnqhlUZCUGOnElp7+oX2D9XcYbyUrHzSUmkVd2m6vBkMrCkYZOS7S4PMh+vtEmvued5S9JG1LBWU9YQLn3ibzrappU= Received: from BN7PR02CA0022.namprd02.prod.outlook.com (2603:10b6:408:20::35) by DM6PR02MB4459.namprd02.prod.outlook.com (2603:10b6:5:29::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.21; Fri, 17 Aug 2018 12:25:06 +0000 Received: from BL2NAM02FT017.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::206) by BN7PR02CA0022.outlook.office365.com (2603:10b6:408:20::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1059.20 via Frontend Transport; Fri, 17 Aug 2018 12:25:06 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT017.mail.protection.outlook.com (10.152.77.174) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1059.14 via Frontend Transport; Fri, 17 Aug 2018 12:25:05 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1fqdoP-00030v-AF; Fri, 17 Aug 2018 05:25:05 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fqdoK-0000U3-8s; Fri, 17 Aug 2018 05:25:00 -0700 Received: from xsj-pvapsmtp01 (maildrop.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w7HCOw2v019099; Fri, 17 Aug 2018 05:24:58 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fqdoI-0000Tb-7J; Fri, 17 Aug 2018 05:24:58 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 4B2A06050D; Fri, 17 Aug 2018 17:54:57 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , Anurag Kumar Vulisha Subject: [PATCH v2 6/8] usb: dwc3: check for requests in started list for stream capable endpoints Date: Fri, 17 Aug 2018 17:54:53 +0530 Message-ID: <1534508695-12642-7-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1534508695-12642-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1534508695-12642-1-git-send-email-anurag.kumar.vulisha@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(346002)(136003)(396003)(376002)(2980300002)(438002)(189003)(199004)(14444005)(356003)(8676002)(51416003)(305945005)(76176011)(81166006)(42186006)(47776003)(36386004)(36756003)(446003)(16586007)(106002)(110136005)(52956003)(426003)(81156014)(54906003)(316002)(107886003)(126002)(50226002)(8936002)(90966002)(103686004)(6266002)(11346002)(336012)(2616005)(486006)(476003)(4326008)(39060400002)(5660300001)(478600001)(6666003)(26005)(186003)(106466001)(63266004)(48376002)(50466002)(2906002)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR02MB4459;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BL2NAM02FT017;1:4ke7zDdFWiybjRbcfjvZDSCDZgzM68+3v0RomgERACrVkH8r156LZKblTEYSoZcUpNVKYTZd6hTLsr5zSdnHs96iY283xRucMookMqdKry9CJNgIGmbpeevpEbjWHO3j MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1cf6636a-b0cc-40a2-1d11-08d6043c7705 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM6PR02MB4459; X-Microsoft-Exchange-Diagnostics: 1;DM6PR02MB4459;3:2GUrBKfKO5mB3HRCXt5r80UVEDjXjWb0XxEM3KVCkcVs588FkRuxO2YRyDmCHjVq5a3LrDBEkBdbDd9x1CREN+T5r9QIQNmJNHbGwMRgsLcislBr/7K1ik61/D5vWcNIgyQqVkHXGxktg4PldZ45uUTBgW3Bfl4o7OF+wlUHcnIpFaXiIca6zAOdXhNzjnlszxlJLaCzps39Pl//5aDzowfc33kgUcuMaLiZCXydf6KvxvTpcWDMYl8sU0MPoc86n9SssFBOD89RujETMJS4ycp3mSDcwVpMqgewcpiNNK4wR/DI8kFjxKtAFSypLgM3jcFmfE5h7mO9zjuqwrNVqeYbCVirAPLaS99Bm5FGJBE=;25:QrUIQN7mpmVA9ioBz31daFzodQ1L6epnoUzsbp/D4Payv7CYG1NfTAvoCagwBCOWkXCAOq6FhaybTJKvPzMf3vUpnAisir7mbsCXecWvLGiBkkVttW1ThsfMkchvJp5MBf2bwcoTNL4LO+wPKpKOnhag1d5vacikVKZY1uSH0d+xbjemaJyCiF0WeUIdp2zcrvgqwZE8EQFhFTdrVbxwQ/hvsA2e1Tvb2otZCoBq/j09j3jRl6q6PTvyY1l2uaJLSLlsImhhpcRo+QBp6XBTZ/9G31FcJvYm9TSJHnJ8qwSRk2SFkhcUgGHHkkozUWi/ocphRhHmdYTaUQyR3fJpnw== X-MS-TrafficTypeDiagnostic: DM6PR02MB4459: X-Microsoft-Exchange-Diagnostics: 1;DM6PR02MB4459;31:UD/3y1lzMnrSditvmaum+FhhmES2WJ6TT8zhWS3ULN6EXKQwjPTrGYVb57OL8jT6kECnSRi1TuRdYlfOxfv7DOAhrL344xdnxJ2KcxiaIWLBVN2f1YAiGFsqVrd+wOPjLaR04i49WpApYyY+Cu9+4g6CBWxlY7Hn3QsLwzsCrfzpPWW/qTHVLFNVmT2rIq79uAwJUft5gGRqX4Sxc/V/fIqMcBVynD8ORjYGUB2qeOA=;20:uSYY6wCgGs3Ozr55EdCV7C94nxG4iGTuO83nJ8NotuEwc9CxHGb0Ogvzr5We9Q5LUca4ZbtI26ym/9Rs0AkJ43dCl4iuJAkdo1ZR6bIk67kTm8hX56rradBd+yikB7jWxeNttYmx5xahUij2bVJM3P9fJ3394sZ9MLAn6Ej6HLq5iEwbotsMYfK8GmQClLHilJ8ACMX5ak5l5JgMRkhd3OWpzsOlIkfVKwrmHU6EESAC6DLpINSGHbtMboZ8KmOCTK2+4n2jdUeM1DDYxUjFuH/nFcoJPNmuD0pKdF8PHlXq7FSuUGwwkD/0M7JJRbPWqURsiyUIHuD+qJrFHNiuDyHsViyIK2se+tYU8tgVErGN7ZIKaus04PKWB2fm2og3UaGAqqHcngvUVfv2MtBeVtLB61rwvO0raKscwykT3YpsQSaIorxMtLjoe2U3cJ/W+MqjTXxgwcyeXeqw8zEpRLrYRwcN7sfO6CzQGZ3jsADHMlXgO6rF/peA+EEzKg7W X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231311)(944501410)(52105095)(10201501046)(93006095)(93004095)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699016);SRVR:DM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PD3RsjIbrL3KEb+kjxl7gdIL6kyxgyM417cUs4hs/OF8gceUEQou2N/VpmlAMDaG4nww+Ajaj6IScvzTYxQWxT1EH1+d/Ihr9evx9tmGzodcNXDVHNTCrHrhtdtYQ5uRqwyZmt3nE1IoHL651Rlu4njtayWsDoLz2ha6Y26T3zxKb2ZmLIjzaiOa7uadUt1wb8l+veCYHkmOZJHBucgnR2Qh/xoks5kcr1Jrtiedf04aBu4Zr2BbzsqSGkXfOBrWf47rVV7J/eKr2hsxow+atR6zb67SWotCEPCkX7ULP/15V5jbbFr2aG+Kr8I0zPMr0XeZ0GZI29bYpNlEm+x+jIdg30oR6NtOAbZGsxEwiK+8qbiH6Gq96f7XIjNNLE2ivCfaXxfGznpe+8/3vyDFwNvw==;5:a7T6GnPHDPjNgC0OR2lo42YE8gnsmv2gKcOkFv6Vtj4LUoHPbI0ifyldyQMXFCnSwrnVWhe4Rsw1alGyDEp+UWDtP+N8FgbopU77pW2CUrbIQZvyy1m14Vvooy1hH4oKqRaLQ8dJosGsqgoHpSV9Wkgo68FZtXT/p8wYbMzevVI=;7:YJbXG1gMVLZWRsJID0qReLOC7dELuV0Q+1M+3ILXW3o2kRyJZQ6v8bYM+JTeJqqp+ou3KbIMgZRUTNhTc88iWfSEE5m6Qe1fxGX+o/Y4Fc67sgthNCkaNDDG0ksoD5MiLkS1x3vQN8grrUwWKsSD6garJnvrH4jxvuHXQ3/B6oy+4if0rbiia7OTu9K8DMGvkErizMiZ073fPSNIGFvS/tXJxR6EOwWI5HAe3ociRprf9e0iAYmW5BkfXpxnpPII SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2018 12:25:05.9001 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1cf6636a-b0cc-40a2-1d11-08d6043c7705 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB4459 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For stream capable endpoints, uas layer can queue mulpile requests on single ep with different stream ids. So, there can be multiple pending requests waiting to be transferred. This patch changes the code to check for any pending requests waiting to be transferred on ep started_list and calls __dwc3_gadget_kick_transfer() if any. Signed-off-by: Anurag Kumar Vulisha --- Changes in v2: 1. None --- drivers/usb/dwc3/gadget.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 260f10f..3af55f8 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2424,6 +2424,9 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep, dwc3_gadget_ep_cleanup_completed_requests(dep, event, status); + if (dep->stream_capable && !list_empty(&dep->started_list)) + __dwc3_gadget_kick_transfer(dep); + if (stop) { dwc3_stop_active_transfer(dep, true); dep->flags = DWC3_EP_ENABLED; From patchwork Fri Aug 17 12:24:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anurag Kumar Vulisha X-Patchwork-Id: 10568703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 237FB109C for ; Fri, 17 Aug 2018 12:25:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 119D62B019 for ; Fri, 17 Aug 2018 12:25:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05C502B29B; Fri, 17 Aug 2018 12:25:20 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EDCD2B019 for ; Fri, 17 Aug 2018 12:25:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727406AbeHQP2Z (ORCPT ); Fri, 17 Aug 2018 11:28:25 -0400 Received: from mail-by2nam01on0045.outbound.protection.outlook.com ([104.47.34.45]:58000 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726709AbeHQP2Y (ORCPT ); Fri, 17 Aug 2018 11:28:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=alzi/6RqxMXV4t1Cn6T7Irm1qFDo6iMcjEDH8ueVO/M=; b=RtnMdrOjpGuvtyqsZDVebKGmSs2SlYzkOwdGPu1TWFGCCTSISfib0khle+e9NlrKwzkgMsLCehTyeZGkc2Ey+0F/vGmMtEhx/l4EUzq+zXQ5OcplX/wfa9RDFY9TYwEHXOaT3/0PP3DwGFZIGE4bFKEj3sK8w94KlRw3knvKqqg= Received: from MWHPR0201CA0079.namprd02.prod.outlook.com (2603:10b6:301:75::20) by CY4PR0201MB3506.namprd02.prod.outlook.com (2603:10b6:910:95::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.22; Fri, 17 Aug 2018 12:25:06 +0000 Received: from SN1NAM02FT038.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::201) by MWHPR0201CA0079.outlook.office365.com (2603:10b6:301:75::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1059.19 via Frontend Transport; Fri, 17 Aug 2018 12:25:06 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT038.mail.protection.outlook.com (10.152.72.69) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1059.14 via Frontend Transport; Fri, 17 Aug 2018 12:25:05 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1fqdoP-000311-JK; Fri, 17 Aug 2018 05:25:05 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fqdoK-0000U3-Ik; Fri, 17 Aug 2018 05:25:00 -0700 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w7HCOwFQ019101; Fri, 17 Aug 2018 05:24:58 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fqdoI-0000Tf-FP; Fri, 17 Aug 2018 05:24:58 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 802B96050E; Fri, 17 Aug 2018 17:54:57 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , Anurag Kumar Vulisha Subject: [PATCH v2 7/8] usb: dwc3: Check for IOC/LST bit in both event->status and TRB->ctrl fields Date: Fri, 17 Aug 2018 17:54:54 +0530 Message-ID: <1534508695-12642-8-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1534508695-12642-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1534508695-12642-1-git-send-email-anurag.kumar.vulisha@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39850400004)(136003)(346002)(376002)(396003)(2980300002)(438002)(189003)(199004)(8676002)(47776003)(90966002)(81166006)(81156014)(6666003)(5660300001)(478600001)(52956003)(2906002)(336012)(486006)(446003)(316002)(26005)(42186006)(11346002)(16586007)(106002)(36386004)(63266004)(8936002)(48376002)(76176011)(426003)(36756003)(51416003)(103686004)(356003)(186003)(4326008)(107886003)(6266002)(39060400002)(2616005)(110136005)(54906003)(106466001)(305945005)(126002)(50226002)(14444005)(50466002)(476003)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR0201MB3506;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;SN1NAM02FT038;1:4apezvDJHQiE2pEDBkYCjVEGYZaniO9vIXS3YSQ6C15NaBI+hq66K5mhpu9gvYNMm4vTz3bLHVTau/xate3BiJRs8ptxdlBvNYLm1X8Yo7iiQWhbpJDECUGyuDKbEVlC MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 24830aaa-8f5a-4967-9e7d-08d6043c771b X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);SRVR:CY4PR0201MB3506; X-Microsoft-Exchange-Diagnostics: 1;CY4PR0201MB3506;3:YKiC6Gnxz3LWXJ5lj3FG/1mdEA6boDgXxicaxwqjrS559vnczGuMwj6f13VFKpu6aMKP/zsXIrHZ+SFyT8T9h6bl632YwA3KlpvK/AxYOcQbh3bPTdhsPiXJzOupqbgenMGNSXQV2Wth6pKYiLmOPsK7sewUL95vWS60Ck3qNO+nW/9JmLmmjKh28YJNKuJD8mhWdVOhut8u7TSCLUIN8r76+ZymlNHmP9ebku4tt8Ym5vteNX/KpJbWduWOo8ngId/kpEFjG0FhoGvTMo0uxUlyU0lZDShan7YYL2e10/TPXKuQnlT3ndeC95D93jBPCKW7jgJxSSsQivyT9qdMquv2fQXxYQ21Y3KSfrTZnWE=;25:rqNhlcT7EUjzzeUHYM1rsWh8KdJ78b/kG7l61vyUt+kA7qJ0+NDajf7PN95sDnkmFhRVxjjK/Ifwamo0ooZM5mdl0RFMYQFflrxJJHUI/4ezNhGxeNgbanCfxdBnJGbnAl1nnUlWi/IJLroWyD69gDqz3hOvUWs7ZKOnG+8pQkyOxo2dTLhKdPQK6uwSySuo0Nq12sEGudTZ1c0cget5qZYDEOT5PVuIZkjJm2JX/enLohg8Eaq1Hjmml4qrSRb3AQ86EMoVHOe4ReaMMVnX5rry3w1tAz38fgWArv19QfPlB3mBHux9Qq3Th7YKeObGaGjd4EhdWgJ0bjRcGLK4Xw== X-MS-TrafficTypeDiagnostic: CY4PR0201MB3506: X-Microsoft-Exchange-Diagnostics: 1;CY4PR0201MB3506;31:hXat68axDN+ZSmHipHL2mSOgXvf7a8RIGQJE9F7ynEyBcmEs/D2OiAq5/LcoT0t68tz6hst44sHIkKKVCcowTV9PUHqD4QLW0U5W0LaCe2Ibw7xNiycwvs/ppaHdydbvv9vvIAlkVLh52q1CD59OKIdBbmtQMOk7lmr2YqiQ1WYmwdrGK0Js0iNPgLA9VD0fqkccb/s9KmHg8LzHuMfBAEAZVtSkOVyYkq/TQg2Yzcw=;20:rBWc2UgKa4GSEhvRtf78ZQKxaQv40UPzoAXZApc0/xEGz+vP3odeSYE2ecU487suWbh/ydsldiKWGopKG8xS9lgfoKQk78NdZkMdyMneV4LiWR1yVF2H+odFZ8pqCZk+UMDdVtnyiDL8k87nFZJPtNOuAmdo1DELLuwc0yVpxdD93I7+xnkGxxvUdWd/lWx1Ua7vrmVyyqbTVrRcssCa13pOcPCn0Jsxvj9SekGYkrWc9ACsykvXMNSYwhOT9vE5tewhgKRkgd+0+vUymhvuGh2gu+vRXgBMgbannnj45mNgqL2T34zA0KSGHHGzcbsCMrbyMaie8rpj20VSNxs2NxBk+tlcDvzAquoJs6EfN5cDuuCXqj2ZngjY9VXHM8H0cafiFn0jXDjFqCOyVzvbonCmSmoYU8p7g8tYFnpRhHbsLMQtYC3oMLwOUG9bprjZfbbp1VZdKI1eY0GJhTVp66u9XGZiWx171718y7hNSQlq253ezQfqtXvxade69eZy X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231311)(944501410)(52105095)(3002001)(93006095)(93004095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201708071742011)(7699016);SRVR:CY4PR0201MB3506;BCL:0;PCL:0;RULEID:;SRVR:CY4PR0201MB3506; X-Microsoft-Exchange-Diagnostics: 1;CY4PR0201MB3506;4:cJs+Ed/+lzkXm4bi1+Xce5d5kYXJ6X+BNafmv9VoArj7cYj9YUPwG4P4DYaT2jWDbhuGT4R9MicifcpeHjgySX7AL+GeUXXCsgppAualOPRe6up1SK3u1KjXROwxK0W+XEBo4SCJCbxr0n+ui+l5reAbKLWDyuyFuy8nfVvKjv7bdmH3RYoZfxpmqm5rY7TGYSZK229tIOYBrWQefZquYtdqmyAValN/c586tabL+qhl5YvMaJW6T1vKqyV8JlcLUtwz7cwwIOapdvjcs0an0q8vqmKdGpu7SffSKkvKOmmR0v5PnMHr/BfSlf2u/0cr X-Forefront-PRVS: 076777155F X-Microsoft-Exchange-Diagnostics: 1;CY4PR0201MB3506;23:oKSWlHnMQKggHEwpmbmcDFGbpx4i9giCMDB517DGEekJGJ6VIw6EgdkE6BAtGc2RFVTxK4lLH6EGLfMe0uFCR2hEDPrTCpI4eNsFy8tLnPUAJC4pRE9ICs35qGyyPuTeoLcjxmUTYbX0H4iRBZ6Mb9Zo37fX+zwmZw5ALiMNQrPh8uzXPieedED7l5TmUUVIiH0Kg2VDn8A/jtmeW8W8toF0ElZfepxMzxwO0wmSzPDdAvAOEwOmq4PVZk+i5y0bns9O90FFOs8PuA1TXHJIU60dZNIOlxUuqJItgVRcfVsChZmUTUOy9ePmxfaYCbGnJaU4qC9E7jbXiBYoAsWShYQUTlSAqbhbE80iqtvmqREvMOprzqw/FdXZJoww5EmbDbCtGYS1VaTuHeX2xlTEQmkp9fF1RUlyko/xlJvya/H6l0CDwLX7Tti1GmLrfULKanb+ID2WhC+9xVdzCAt9zCc7g8fAdPnoXFSrbM5ppNVc0UNo0Op9cMSsKLvv2CZL+L1at4lsPlX/QUslKi6IpXcjZQPAFBAe2aiNZG+U5uCLVKmkjB1sil92wLnSKexhg3HwuOSu+WrgzBGa3Ho3mmJKkOWoB/1VENOlINnWCSrK30N7HC6oCPGSxjnxDjLX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XrLw6LrWwg8dsyOH8lzCN5ehKTS6EGaOF+/wc2Gqm+WicJ2NaLc4TAuXtZMVFL6PhizIxG1nCPL/yc7Gh23U9W4x/ZKGm5SaVOXd//1xFKrqcY5r1NcNU/TByDQIQTl8bi5vGR4671TbrFCQXaPUfQGX0qtNqYgWZeZu0K3JoY7ZS4/iPvRT4ZtLvaTP6U+FW8R4Z/zbV6cqm0/Fep8mFZvod/jGJljK0hVbm6vbn6aRMX4efXql3xwGyPOu4XXqHwxUiOoULOmhIgLQNOO33fh/bwu/W1kQoeQp3YwxmmgdXtznBfvaSlpJ6baALUzRKGq9k43oyZeZOiIWYDBMRcN7Sgu+NsoDxurnw0ioVrSQ/muBwj3IdCP8uX7WOXrGkukkkA==;5:48UqUTEL2yn+B/j3XvqoXrIKo05yXjeJ5rOKWWvQjhfi4jQoK/FyJm3Vrj7xIUWuqqN1HR5ULWUGtTMSsJ7v9LUfb6AIsHhQFjtUCsd3PAIhdWArP93fG75YWeeiVS9yYyUCYaa3XmAkAbIhtlx8DNA73O4y8t9hnG7O7gYYubA=;7:YkOOimwUgkeBooFNs8wW0stoG8WHHBwqJyTASyln12ZoyKDoLMcKqtdUIFGkFnhEdMqAhJu85goXXQfjckzUdnbIkR0aBcSf02AIoluls8zIia662ucf8oFCLzHDPPbLmwa7X6MlK/SAeLkcQ8+/vxMGYw1qmo6HeL9POA8zgZAcGQeEB7zs5v88RT34THaWjoa7sm9gctDK2poooCnKIB5QSdfkcC317/jkL8jakXa/1pAmup2a61l6zkzvGXn5 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2018 12:25:05.9851 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 24830aaa-8f5a-4967-9e7d-08d6043c771b X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0201MB3506 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The present code in dwc3_gadget_ep_reclaim_completed_trb() will check for IOC/LST bit in the event->status and returns if IOC/LST bit is set. This logic doesn't work if multiple TRBs are queued per request and the IOC/LST bit is set on the last TRB of that request. Consider an example where a queued request has multiple queued TRBs and IOC/LST bit is set only for the last TRB. In this case, the Core generates XferComplete/XferInProgress events only for the last TRB (since IOC/LST are set only for the last TRB). As per the logic in dwc3_gadget_ep_reclaim_completed_trb() event->status is checked for IOC/LST bit and returns on the first TRB. This makes the remaining TRBs left unhandled. To aviod this, changed the code to check for IOC/LST bits in both event->status & TRB->ctrl. This patch does the same. Signed-off-by: Anurag Kumar Vulisha --- Changes in v2: 1. None --- drivers/usb/dwc3/gadget.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 3af55f8..1b1bc14 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2290,7 +2290,12 @@ static int dwc3_gadget_ep_reclaim_completed_trb(struct dwc3_ep *dep, if (event->status & DEPEVT_STATUS_SHORT && !chain) return 1; - if (event->status & (DEPEVT_STATUS_IOC | DEPEVT_STATUS_LST)) + if ((event->status & DEPEVT_STATUS_IOC) && + (trb->ctrl & DWC3_TRB_CTRL_IOC)) + return 1; + + if ((event->status & DEPEVT_STATUS_LST) && + (trb->ctrl & DWC3_TRB_CTRL_LST)) return 1; return 0; From patchwork Fri Aug 17 12:24:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anurag Kumar Vulisha X-Patchwork-Id: 10568715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 03C1B109C for ; Fri, 17 Aug 2018 12:25:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E443D2B29B for ; Fri, 17 Aug 2018 12:25:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8C602B4E7; Fri, 17 Aug 2018 12:25:53 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 641BC2B29B for ; Fri, 17 Aug 2018 12:25:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727562AbeHQP3B (ORCPT ); Fri, 17 Aug 2018 11:29:01 -0400 Received: from mail-eopbgr730078.outbound.protection.outlook.com ([40.107.73.78]:37312 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726376AbeHQP2X (ORCPT ); Fri, 17 Aug 2018 11:28:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/70A7vEtcvWJF0usoMkKpzmi6ixFyA7R4CLqBIkp1L4=; b=KwwKwjfzt5fo7Kuao7+10cWGyMRONiXdIkA37IWNE2/4U11PO+H0/zgUjzFtX9wqrfPd52CXD4xKLpvQYQGtQ+YC3NZLuYuzDnGcFqnS+jAfP9i/gAnJcIVBbSO00qZnYExZMXM7JIitPLcW+Udt5SYMSszA8sa183mUMTHgDJo= Received: from SN6PR02CA0013.namprd02.prod.outlook.com (2603:10b6:805:a2::26) by DM5PR0201MB3510.namprd02.prod.outlook.com (2603:10b6:4:77::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.25; Fri, 17 Aug 2018 12:25:06 +0000 Received: from SN1NAM02FT059.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::204) by SN6PR02CA0013.outlook.office365.com (2603:10b6:805:a2::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1059.21 via Frontend Transport; Fri, 17 Aug 2018 12:25:05 +0000 Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT059.mail.protection.outlook.com (10.152.72.177) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1059.14 via Frontend Transport; Fri, 17 Aug 2018 12:25:05 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1fqdoP-00030u-7F; Fri, 17 Aug 2018 05:25:05 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fqdoK-0000U3-5s; Fri, 17 Aug 2018 05:25:00 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp1.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w7HCOwdQ019103; Fri, 17 Aug 2018 05:24:59 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fqdoI-0000Th-IW; Fri, 17 Aug 2018 05:24:58 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id A35DA60508; Fri, 17 Aug 2018 17:54:57 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , Anurag Kumar Vulisha Subject: [PATCH v2 8/8] usb: dwc3: Check MISSED ISOC bit only for ISOC endpoints Date: Fri, 17 Aug 2018 17:54:55 +0530 Message-ID: <1534508695-12642-9-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1534508695-12642-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1534508695-12642-1-git-send-email-anurag.kumar.vulisha@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(346002)(39850400004)(396003)(376002)(136003)(2980300002)(438002)(189003)(199004)(217873002)(36386004)(4326008)(52956003)(48376002)(36756003)(103686004)(186003)(26005)(14444005)(6346003)(5660300001)(336012)(8936002)(50226002)(47776003)(107886003)(6266002)(486006)(446003)(476003)(126002)(426003)(11346002)(2616005)(39060400002)(50466002)(106466001)(356003)(478600001)(90966002)(8676002)(81166006)(81156014)(305945005)(63266004)(2906002)(51416003)(76176011)(110136005)(106002)(54906003)(42186006)(316002)(16586007)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR0201MB3510;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;SN1NAM02FT059;1:Rdiw3XiCpRjNdxSTipyVVbTPoS8u2yh+XwLTHzpHNP6LC4txVqEqrbJRtY8GSotvkrgb7Q11ROfOc4auRP7i0xKhlnMgRrIVaRUZW8njqRNGzKKAAt/vBxckclpAA3yE MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f2cdfc4a-1651-4d5a-32cd-08d6043c76d2 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM5PR0201MB3510; X-Microsoft-Exchange-Diagnostics: 1;DM5PR0201MB3510;3:BzhiixSl1liDYeJxXYGPTKpWgLFGZFiRqJDPxmVDpBeQPZct8o8P44+6/4eSqcR/CVKSSOGRm3yjK68bEVJmUifg2LB9WtdcrApmP86vI+6CHCAIjjM75uZ7lY5tIxpGeQLill5m1OdrqiLediN2a4L+K+g18x534qbEuw53Tlos2P6tu7caKFdK44cnDke31fKyaY2XOfuM5c6f64BPQ6BXrCnB9RFgqLyYM2UEAl4HKF/zzcYC/iBPjg4eMY6AejOds4AA4dGE5ZyhIOjSWWT+l7/dwZsMFUYz7tP++GoH/ybe+hgfZHy4ocW6RCJ16Mwf6bMjlOr2t3rDYPy2mkC2bArlGekj0lXVtRDxOwE=;25:ajbaCNz4wBInBodMrTWiqZPynM+DP6f+0u107Nh07TeOpbMh68O0IJLmIFBcfGdvhVCvPLuwQNflqBqelRNvzuJzxd78/mEtTbcmeVtY7XfE+o9fqp04likXhl/SfKHFqfh8g0YBhFmwNb2p6WUrLCLna1SZkVk8c0vCUN3ykY4ZZwNgECqdfZkBup8OqfYhuUmvZqNpdAZ52rXx2ASvXrz6iYl9SwGWMkPJPyLBDwenC0tTD+ddiRRLLZnbx8fcDy2B227xWahAlaKujXB47/OJlcOCOLAnxWFxL11Awq/rHKMjBliY5CPfal3SwCnm/YS0DJWw2yVIIHZ7ZOBoTQ== X-MS-TrafficTypeDiagnostic: DM5PR0201MB3510: X-Microsoft-Exchange-Diagnostics: 1;DM5PR0201MB3510;31:4Y9be3eMGEP0xom/oQPksFYeKyf6gfZA8PMCgGKHsB2ziFURgwhElNlm/hdUHyDzGF/JFRwQj6NFmwfaXhVj3B6ACfSLRDCz0L7TxW0j8hV6uhTW2mcW/zy8ZkpnN6SB0wvuZrAeOBCwE28CZbupazI/RtVn1dBmgx+D/wr6WpfKgRQCWo2NZywQ01jml6x0Dz880t+Q3+uCTP2FgbYPyFZjIlPvVF54x42/TdU/Hv0=;20:qbJ5iQfgNkcwubXzDE4sNHIbcX/kgPqFQl+/34lDIDyVtsLbAiCacsHSdiL7x1i3zPg08dWMS3PoK4Q18db3N7/1OP7VnIHtcO6bjiaf+fmOsWmg0q7XZcZ8v0hLXrmTYJP5YK+ivqgS3sSkRbp4ssDPEYW7PJl83OQYPZpC997SUv44sojaAVCf9hPijttFEnttMJkr33UFryrKBG5HSKZVAvyMjzzUxToFG8VkJT2fz5ohefIrqXiO3ut/hnLyY8Pr6Oa595r3UXy/fy6Xlatal59ia9KpkT9nubp4f3BY8P1W9s4/CVQZmGV4tM2Ud6IJdi6GuKNk69nnd2a04PSSsuYGyPpfZwCAIwbmIvRIH4pmNkwEwglGM/1eyQ4lELr67XcW9tRe2muxq5Ly46HFeNkQ278P3hYVWyUWd/HKpdTFgwfU0dU1dgSWvURemnTjktZ1cxQKqr1oP5cYQ1Rqb/pBsFREDbapBrDqJrrr1DQAj4pAUnAkzYyXjFWb X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93004095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016);SRVR:DM5PR0201MB3510;BCL:0;PCL:0;RULEID:;SRVR:DM5PR0201MB3510; X-Microsoft-Exchange-Diagnostics: 1;DM5PR0201MB3510;4:xLjrNlmGiNT3xEcmW603Oe+Ng+gERkrsfPotgzt4IYeIjoq60M+efknrIy8GnPc6BEZpNNZ3UggvNwoSPiTn2tSmV35W5KUFDwjUWSGSZcUi1kkcWxbNScXhofVTjJjhoSQWUSYUZ1Uspa1tUrwWHO5sEP0zeLw+bkOqp5Nuo5/+DskeUO+/APaCUsdBJVqQy7Kg0mVG+DzgLvcjdq++8IvsC/q+65GmT7MkyWF77jYuNDzdheH3WdoA3uJLiNbQhJlFbBjeAZHRNge9siQcBAAK7pkaIapx+xPs/dOR+pqtOzy/P0X6MVNSBTuRa2N6 X-Forefront-PRVS: 076777155F X-Microsoft-Exchange-Diagnostics: 1;DM5PR0201MB3510;23:+sC9C4NGnzi+6mDI4GFuBc7nHeMik8PfPWoaE9kKUR2zxNI6FqaukgSlBfK+j6wGMROmomSBySHVnQnrVvd+stI3Wflj/YaFyaAgNT+Pt/aIWAG+c8fGy6kDhi2a1keLwpEh1nazmQ09cid4VyJf78J8xBvqdKa0GAkbnmh/FBR7c9ahvaJaHKyZaGczs071JkLwbXV2lUNnC9MKLKItcBG7FSTu8aS7HHe0d23lKgia3uF6d/c8A/KzqUGe3SxtPT/2ix1hoxVv7JwBuM5Vb+X+JlJ8Dr0XcGTXhg0a6TTzq9KGfBkvSy2JoJE2iRL3BkUAp6KYaTf2JHkhRgj/aerPOcqk9GHe3si9lgkjjAMBNJa5sRtnUMNZS+jX+Ld1krsFgG77hPGs8DekDwS4Ux/ULeT2hxebO/i4RWs6tG+kWKQxq/eEDweRGEKYV2WdlqC6yVwk8vljzeNO607y5ayvRuip844mU7u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o2yjDVdAF7FgXUaERo674yixmAKmJp551XL5WbvI8VdyCoqA6DgeLY= X-Microsoft-Exchange-Diagnostics: 1;DM5PR0201MB3510;6:yL+lpofGiIrdA91FWCRiz+LFqeBUYNWaQEuGYIWMBA5alEbOopRKZoNClDFYeCpy61qBihqjvWYISwdeTBQGUMgpKQKRe2ITVCcwQu+Y+4mRBBYoyXzMOBAYTZqr1/vds0Mcu7WLkJFr8UsRfwb1MvkEHNNSDb1HzwFofRjCPxJbym8Mb74z31kRfhW6E8wZmTke/OLe487QsmGItQf92o/vqwiWl99wmfB86eB/hz8MBd0TTfeQ5y5pPBK8KYsDPv2M6JZkmoytv/b3lKI/3fhz/A+2/US9gknxgeOf4ccAROleZLoKC2tbkXo+W2aSyzNyRKlxGGyFgCBZ3utGyV5BqxCRrQ+1K9HbHr00i4YhlhKWmRxL3wVnT9KOGvzolAzNaHRlrqxYvPmhA2HiSoTlFQUIiL02F1PIXuiU9vGF7N7jYLnygX1wChD7XqQA5n4P/zn+IwTnzcjN/aitgw==;5:y/ciefo/rcX6pi3Ka/wvNCUhtRp3oFDHGoD90CWqpETtDK3tJ5BC2hHZ4JpgH6j8avcIWSP0dUygCUoj6+TrEMRzAHOARcowiEF5pcSW0Y9VVCcJK6ZK2vkvIb2ydEaAv13KAzKD0WltxqK/zaI4/x3eWRWbwQNPJY6n2MAYc0I=;7:20mMS1ehaKK1a/A+jN6uzbIcO+TXoz7u6dkOL29SLCPbCH3xlrUe4soK8jKCaAv2FZeE9YQ8DwLe7Ksoc4x4x2qgxqOjPc0udK607Yixc2+rl9/8L/oktd26rg6gfrgC9GsrUVZLGVZndqynMAK33VymTbJ6udxcpVSQkB1KmRClF0+0iuTcfMGOiau1DaMkQWrnuq2g+IBrZNPetZlerfPWTtWhCyqgCWMkUAnnC8V0elm15D1WkSvl1rlWHJ4r SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2018 12:25:05.5508 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f2cdfc4a-1651-4d5a-32cd-08d6043c76d2 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0201MB3510 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When streaming is enabled on BULK endpoints and LST bit is set observed MISSED ISOC bit set in event->status for BULK ep. Since this bit is only valid for isocronous endpoints, changed the code to check for isocrnous endpoints when MISSED ISOC bit is set. Signed-off-by: Anurag Kumar Vulisha --- Changes in v2: 1. None --- drivers/usb/dwc3/gadget.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 1b1bc14..188b043 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2413,7 +2413,8 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep, if (event->status & DEPEVT_STATUS_BUSERR) status = -ECONNRESET; - if (event->status & DEPEVT_STATUS_MISSED_ISOC) { + if ((event->status & DEPEVT_STATUS_MISSED_ISOC) && + usb_endpoint_xfer_isoc(dep->endpoint.desc)) { status = -EXDEV; if (list_empty(&dep->started_list))