From patchwork Fri Sep 7 13:13:42 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: 10592201 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 6C32C14E0 for ; Fri, 7 Sep 2018 13:15:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5EC2F2A93A for ; Fri, 7 Sep 2018 13:15:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52A752B1AE; Fri, 7 Sep 2018 13:15:18 +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 CC47F2A93A for ; Fri, 7 Sep 2018 13:15:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728881AbeIGR4K (ORCPT ); Fri, 7 Sep 2018 13:56:10 -0400 Received: from mail-eopbgr720060.outbound.protection.outlook.com ([40.107.72.60]:52718 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728940AbeIGRzV (ORCPT ); Fri, 7 Sep 2018 13:55:21 -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=13WXSV5LKrEa24mZuJGWiqdLNayhKK9pvhY8M8UxAf0=; b=HEAYgCYD9Lpm+nvUQ57fL1llVVZQiN24LF1obyv9k4QAqKVre3Knc/jphvP4d7mUnnA5DPr0rTXNaFVHl5ocJmMyZGcq4XbCHthRNNhVjFGByZawO3DujgW5VgvUTvyT5NXnM8ahkXI0ZpgqjsDDeTSIIai8zqBpAKiSm4MlcqU= Received: from MWHPR0201CA0050.namprd02.prod.outlook.com (2603:10b6:301:73::27) by MWHPR02MB2688.namprd02.prod.outlook.com (2603:10b6:300:106::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Fri, 7 Sep 2018 13:14:20 +0000 Received: from CY1NAM02FT018.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::201) by MWHPR0201CA0050.outlook.office365.com (2603:10b6:301:73::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1122.15 via Frontend Transport; Fri, 7 Sep 2018 13:14:20 +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 CY1NAM02FT018.mail.protection.outlook.com (10.152.75.183) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1122.15 via Frontend Transport; Fri, 7 Sep 2018 13:14:20 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:46036 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fyGaZ-0000Wg-LR; Fri, 07 Sep 2018 06:14:19 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fyGaU-0005mb-HQ; Fri, 07 Sep 2018 06:14:14 -0700 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w87DE5uK019320; Fri, 7 Sep 2018 06:14:05 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fyGaK-0005lA-Rh; Fri, 07 Sep 2018 06:14:05 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 01A4E604DB; Fri, 7 Sep 2018 18:44:04 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , Anurag Kumar Vulisha Subject: [PATCH v3 1/8] usb: dwc3: Correct the logic for checking TRB full in __dwc3_prepare_one_trb() Date: Fri, 7 Sep 2018 18:43:42 +0530 Message-ID: <1536326029-16327-2-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1536326029-16327-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1536326029-16327-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)(346002)(39860400002)(396003)(2980300002)(438002)(199004)(189003)(36386004)(4326008)(103686004)(81156014)(81166006)(8936002)(50226002)(5660300001)(106466001)(6666003)(107886003)(63266004)(6266002)(48376002)(36756003)(50466002)(47776003)(39060400002)(52956003)(15760500003)(110136005)(42186006)(316002)(76176011)(2616005)(476003)(478600001)(16586007)(54906003)(486006)(51416003)(126002)(305945005)(356003)(8676002)(26005)(336012)(186003)(11346002)(106002)(2906002)(446003)(90966002)(426003)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR02MB2688;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;CY1NAM02FT018;1:TtLWgrDz4Ly96pEnQ3mnQ6VaWQuefBsLUmYn1dDUecIBJrFM63cjOJzmWyQmicwPYa6zzIdeXAs60E/rRTwujmMl+G/GGX8QsdSumVhSkamfO1GeSJ/tZKFd9LBiVpv3 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cecfd47e-0fa2-4989-4d5c-08d614c3d2a5 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:MWHPR02MB2688; X-Microsoft-Exchange-Diagnostics: 1;MWHPR02MB2688;3:mti6ajZXtMBAV8Qc0Ul1GFZOb0N3O68oQWWC4tHIn+nNEbceh7wTvjVML2TjjOUQzs0qVxqmNkgVSjdLDj+FIFcmG3NPbecxsI4rj1SpkcrBDEjpAjwKR4ZWvJjvuvaWcGknK+5fjSIrg+BdfiD3E5jHKB8RAIpkTcEIOwvO2HG8hFGTqZtCxCawBzoh8NAirqEYoNV8c5oBXUJrlDdiX//dCYdB/R6R5wwcL2cDLWPKRo+/2LdNqa1MmnSgMinup3uVrjkOCNvAYCc3cAwWC4KyFMEoAwQg97WkZr+qiM9aIep5lio1nMdiMZLhXjzH8W2VBm6iTsTsGJQc0UauBusEsek8I8s27e9QskjHN5o=;25:iQ6MOUyDbhGyAMPc8NArXMNCl7UTZKXbvtgDZsxEFB90Tp+g5Fw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lRywbQCYmgBjXNaym3wudVgnCAfmBcl6NQpui2JD 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)(10201501046)(93006095)(93004095)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201708071742011)(7699050);SRVR:MWHPR02MB2688;BCL:0;PCL:0;RULEID:;SRVR:MWHPR02MB2688; X-Microsoft-Exchange-Diagnostics: 1;MWHPR02MB2688;4:a+ih6hYXQn9OPF9Ilnx4eyZbRarYnwTE3tHny6GrlNmeFG/glrl5m8xtnzbWiSqh4lRM8BFWOOm6DK1/8pCJrvL6GCuCVwXKgeywJM3wQBRFDUUHjWk9F0MnRPP/C4jGGoXEvd0jcS51GdDpIFMMPuEaa1TonY5cKbmgSl+mdI4+YJz3zExR8ceEVe3iQ897WU4dRcGChMvPGDngzMpLLcGnpURGZ/wYkvnjy9rPCFIy0XmfPB1li1EpHfXDBvwEnnkLbLYvtnZhntq0hth4CIBBrayha4oaHSllbsVcrZEZpKWHbX2vFsJb7b4GCFZ/ X-Forefront-PRVS: 07880C4932 X-Microsoft-Exchange-Diagnostics: 1;MWHPR02MB2688;23:6+HjbUxEmEQ7tmZndTww+KhdJPc1dfAgXfw5s14wGKpHLEIC4rAfbkZmJIdiq1B4p69WVkMcBIO+QBRAl9ltNx5FkapY+ufQMawo86S2LLKTujU/LnV8xkwZLuK/6nZe8hPZnof1H2k3j50xwRdaNbyrNXo9A/neUuzhOSX30oIsr3SrOap4Yq+22qJCJIPdW3A1pD3fan9EZNNQVIwyiEq070NTAg06CI04XP+6hFVDTay2M2EZ424lDuZu2VSfLiBd84r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k/2cmJtwdx895FpsTfPsdAwDRosZJIzUlPM9I2+baVpUUaKyMnizH8K5o3y9msXV7Lhup4WgWIKvfJJWL2RAXbH8XcqSgJamvXPwC89eols01N31oRw41x7XfnyThjln1e SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2018 13:14:20.0980 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cecfd47e-0fa2-4989-4d5c-08d614c3d2a5 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: MWHPR02MB2688 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 v3: 1. Corrected the logic for setting HWO bit as suggested by "Thinh Nguyen" Changes in v2: 1. Changed the commit message --- drivers/usb/dwc3/gadget.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 032ea7d..8a1622b 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -911,8 +911,6 @@ static void __dwc3_prepare_one_trb(struct dwc3_ep *dep, struct dwc3_trb *trb, struct usb_gadget *gadget = &dwc->gadget; enum usb_device_speed speed = gadget->speed; - dwc3_ep_inc_enq(dep); - trb->size = DWC3_TRB_SIZE_LENGTH(length); trb->bpl = lower_32_bits(dma); trb->bph = upper_32_bits(dma); @@ -991,7 +989,7 @@ static void __dwc3_prepare_one_trb(struct dwc3_ep *dep, struct dwc3_trb *trb, } if ((!no_interrupt && !chain) || - (dwc3_calc_trbs_left(dep) == 0)) + (dwc3_calc_trbs_left(dep) == 1)) trb->ctrl |= DWC3_TRB_CTRL_IOC; if (chain) @@ -1002,6 +1000,8 @@ static void __dwc3_prepare_one_trb(struct dwc3_ep *dep, struct dwc3_trb *trb, trb->ctrl |= DWC3_TRB_CTRL_HWO; + dwc3_ep_inc_enq(dep); + trace_dwc3_prepare_trb(dep, trb); } From patchwork Fri Sep 7 13:13:43 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: 10592189 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 A57801669 for ; Fri, 7 Sep 2018 13:14:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 976E02A93A for ; Fri, 7 Sep 2018 13:14:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BC9A2B1AE; Fri, 7 Sep 2018 13:14:50 +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 1AFB32A93A for ; Fri, 7 Sep 2018 13:14:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727872AbeIGRzh (ORCPT ); Fri, 7 Sep 2018 13:55:37 -0400 Received: from mail-eopbgr720062.outbound.protection.outlook.com ([40.107.72.62]:63312 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728906AbeIGRzg (ORCPT ); Fri, 7 Sep 2018 13:55:36 -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=yNMZer2qQ5E8Qc9LeUO9yPA5W4FIAWgHotzQ95m1rIc=; b=fQrM68YBy4usdoBRnZrzq4tRHqaiXwCPfyphdpYLS54ijrSJdoSfE/FL1vTqJ55cLFRmrpd7/E/UQcatSKjqg3qaQ5iSUZipxXpZEIoGdLbWH102XHABJa+ethCZhJMmPB+YQwnovYzTcZjKYIYAuJs0RHscHYv31lV9gc/0j4A= Received: from SN6PR02CA0008.namprd02.prod.outlook.com (2603:10b6:805:a2::21) by SN6PR02MB4942.namprd02.prod.outlook.com (2603:10b6:805:99::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.15; Fri, 7 Sep 2018 13:14:24 +0000 Received: from SN1NAM02FT043.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::205) by SN6PR02CA0008.outlook.office365.com (2603:10b6:805:a2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16 via Frontend Transport; Fri, 7 Sep 2018 13:14:24 +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 SN1NAM02FT043.mail.protection.outlook.com (10.152.72.184) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1122.15 via Frontend Transport; Fri, 7 Sep 2018 13:14:24 +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 1fyGaZ-0000KV-VD; Fri, 07 Sep 2018 06:14:19 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fyGaU-0005mb-RM; Fri, 07 Sep 2018 06:14:14 -0700 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w87DE596019587; Fri, 7 Sep 2018 06:14:05 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fyGaL-0005lN-Fx; Fri, 07 Sep 2018 06:14:05 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 928BC60493; Fri, 7 Sep 2018 18:44:04 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , Anurag Kumar Vulisha Subject: [PATCH v3 2/8] usb: dwc3: update stream id in depcmd Date: Fri, 7 Sep 2018 18:43:43 +0530 Message-ID: <1536326029-16327-3-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1536326029-16327-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1536326029-16327-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)(136003)(376002)(346002)(396003)(39860400002)(2980300002)(438002)(189003)(199004)(106002)(2616005)(52956003)(8676002)(48376002)(486006)(50466002)(36386004)(81156014)(76176011)(81166006)(54906003)(51416003)(356003)(26005)(186003)(478600001)(16586007)(316002)(2906002)(90966002)(446003)(476003)(126002)(42186006)(103686004)(106466001)(15650500001)(63266004)(336012)(110136005)(39060400002)(107886003)(47776003)(6266002)(5660300001)(14444005)(6666003)(305945005)(36756003)(11346002)(4326008)(8936002)(426003)(50226002)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR02MB4942;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;SN1NAM02FT043;1:/MkEyhfZg3r8+ERobvqnze7CwCNH0e5v6cSkAGGHGvFaVki0sW8ATEL0zlqOxJdNR50cbboyxIR+0fmxzOdrEtdlpUQWNpec3y1w96UdTevDpAKVKzsqwGm1Ufcv547W MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3a95280e-d9ea-480b-d87b-08d614c3d514 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:SN6PR02MB4942; X-Microsoft-Exchange-Diagnostics: 1;SN6PR02MB4942;3:z45GBrAh8DR7szXH4lJ82ZtgnIqOirhz50ELSOC4CE8f98VmdUNqqpH/xwFlTnzeNJyBCzuU74ouBds92UqCaZHLTsWEE0E4wjcLTG0xS6y7vn8J9pYYqZXCPBzM/P6gLsOpnLNvpKdE6XG1n/1K9QH5du73quvoSuwvRI6THGs/dAByABZinDJrhJl/rxi2R9Z6LUqSD4Oo7u3Y2gcnky3jF575edDqfVLC6gQocsOyxg0jyt8fsXKDm/VL7RO566ONeSm9tUCi3u+zJJOR/+yfxdpufSlaXjdNHUFmP9siACQ6IDC5zM4W6ZT3+6J9HteZ7DNanYXCDaRTVxvWILeP9MnFdTNhmh0BA5teGtA=;25:MTiKo48mytLRiSXH3BQLpPin26ooyL2gxyOsDiZPZzxS7m0QGV9CNym5Qom3jv92aq44HKhpj3B8FaKxa07HrwNC0L9OSFiYQWvL5T8gEJQuy/0QolYx8UZO0dqJJ9Xtg26Ne3Vn91tlsd/7GenHl+r1eLzJ7quzM74b54FD9KYjrfQbJKW0NQnsBYAdAFo+/hrQSe+2/O9G7OmdG55jayaBO5XR1SuHF2SESwzZrvQLKVptjLo04f0hISLJM2I7Rko9Q27NTI9FisXVoeSNw0RvM0bRXUqySL3qaNn30/Uw1Z/00P5SqqmPH8KD152pSOCgSEwr0IaCskBK8FLfjA== X-MS-TrafficTypeDiagnostic: SN6PR02MB4942: X-Microsoft-Exchange-Diagnostics: 1;SN6PR02MB4942;31:wOAtiYpPL23fammXs4KKE3zqdBOHJNZvKyyld5Fb5m2wMUdWRrts8ezx5DPYpEN0ey9ifvQDCbN0PEE+hIRBRrTR4CfnSA4DJVBAeJIhLuUBcws/wvBuRHs4uLxEm4WoXX2+E71ilozpnKQ3T9X1fQARH1iJCq89taBh1k6v3ulxATsTL8rc8uaAdl7EUJj/tF7t8E/geieyWtKhIf9pMf43Rn1XcnDXfHdNqPqjoAI=;20:pX+d4txZYDofnDBJQjoYKLx/5AYc3X6z3KzkAlVcRwk5iKGO12QzpTVtvr0mc9qC93aoEHg3ihIBMlaAji0vPcS72KTiLyu6/0RTgeo5fSKx9HxiUGpIZtmt3uuejMDw7AVwsWbAEOXp1Pew17OdH1olFxGAXP3KwLgqC981hQvSXHOJeX79CCdWkq+9m+nQf+5rtgUUDFxS+E7bhP0fYB2s8YwvI5UzU4BP/EmuPVgFk/euHTO7MKlWpFXW61Njx7tgrLFkG2Wlel/hCVNPc8l9XMnLLUSmBBT/yT+xafrOmUQjufikpXIMMLQYKW2pjqyqOngE7wmkGYRghsES1ysJQLZ6bOkocjX3YVO66ja02cjk19Koe1BtWQgOL/psH+d+LjciG7HX2pMJl0eX8AQ5+VGDfO8tp726F7F00Vc9qFskvXBbQAVkl6zr4A7kbtanLczqUngjiJ/xTi9iYv9RuJYwLZq7z+LbsDl6aEadvxiql7UXP6liL6F3e2Iy 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)(10201501046)(3231311)(944501410)(52105095)(93006095)(93004095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050);SRVR:SN6PR02MB4942;BCL:0;PCL:0;RULEID:;SRVR:SN6PR02MB4942; X-Microsoft-Exchange-Diagnostics: 1;SN6PR02MB4942;4:izMRI/BljFd9eXB7eBX7vKBUe50khdA+wEh2CcSkVik5yzk8Miq3u0fY8ATQ47aYyNoGld2YFYKrPJLtiNmxbd8ePg0mNe8yKyYDoFgDbHn2d4CDkjKCf4InuwFWo6Vc2jNHpTkXT/+xmFl11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rNcCAdhlKFMpl7CVDoPIbX2zm/nz+eAoM+H9Ty2UMeof1T4/RaH85QcDHwoWCM4xk3DWJQbjaS/Q4QtGLppJ3OrLgt+/0SRiU0S17eXqUYMpKL4kUUBex9TRA258dmxZt5N2v2TiyG9YLg2b82mHX8Ot2EL1TY/9M/zXOh1oKsFrz1tMhBwX9YHaEw6HtzrbogE7VqsVmHg==;5:9UtHbEHQ1zC95owkQIaihVmj1/dR0rKj/4+760hD1vPZpxPB7bLnnnlyE+vKo4iKqzlUGcykYYHFDiR1jLuuVvjJNEset1oJt5eGLR4WaRFfBERyG7RoYctMUfVEYymcRdicu6aZxxPFuG9LG+EiG2iYr46oQ23GKhad3NeYZ3o=;7:ld/GtQgY8918MmDoukhZcj1xi7vgwVNV7mT0vCqYa4dvThYSgBk85P5SOaCaccYejzif4UN/2470IfvWcoW9TRpFNrEpIvzJGOb7z/xW8E0nNF0DNXshmZTQjcV9wKr0HdRwo/YEXgtV/3xCiVWFVM8QmFiBsZxQYYCgb8pMMWJI+K9NZPIrWu0kiv3BuWNY2dbTPQ9/JWqJ9BqBZ+Cqu5USsSrxV1U8nkOFyicE8qIprxrS2xgZlekk66r6Vy94 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2018 13:14:24.2782 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3a95280e-d9ea-480b-d87b-08d614c3d514 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: SN6PR02MB4942 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 Reviewed-by: Thinh Nguyen --- Changes in v3: 1. None 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 8a1622b..43d63a8 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 Sep 7 13:13:44 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: 10592185 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 1B74B5A4 for ; Fri, 7 Sep 2018 13:14:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C2DB2A93A for ; Fri, 7 Sep 2018 13:14:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F30EF2B1AE; Fri, 7 Sep 2018 13:14:32 +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 6527E2A93A for ; Fri, 7 Sep 2018 13:14:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729284AbeIGRzV (ORCPT ); Fri, 7 Sep 2018 13:55:21 -0400 Received: from mail-eopbgr720060.outbound.protection.outlook.com ([40.107.72.60]:52718 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726591AbeIGRzV (ORCPT ); Fri, 7 Sep 2018 13:55:21 -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=JxoM+j/QHkbOejOL/iePc1KEanbhZFqTUMpNXdJCgd0=; b=3ZBrdjZBu0MBDDRSXeHhx7e7sRcO/1LSh1AV7or5bijd7X3105CQD68KERBuaVKvJ6fwteUItdr4z9yvoMj7x+ukBe+lpDGQ0Fie7Ts8PEB3DgJsTsLWHyvOBysTCgtqVX9LHlV1KBEgBzg24wcxLva/Kn2TFUi9+bfu85n3LJ8= Received: from CY4PR02CA0008.namprd02.prod.outlook.com (2603:10b6:903:18::18) by MWHPR02MB2688.namprd02.prod.outlook.com (2603:10b6:300:106::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Fri, 7 Sep 2018 13:14:21 +0000 Received: from SN1NAM02FT014.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::207) by CY4PR02CA0008.outlook.office365.com (2603:10b6:903:18::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.15 via Frontend Transport; Fri, 7 Sep 2018 13:14:21 +0000 Authentication-Results: spf=temperror (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=temperror action=none header.from=xilinx.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of xilinx.com: DNS Timeout) Received: from xsj-pvapsmtpgw02 (149.199.60.100) by SN1NAM02FT014.mail.protection.outlook.com (10.152.72.106) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1122.15 via Frontend Transport; Fri, 7 Sep 2018 13:14:19 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:46024 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fyGaZ-0000We-Gl; Fri, 07 Sep 2018 06:14:19 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fyGaU-0005mb-Ch; Fri, 07 Sep 2018 06:14:14 -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 w87DE6UZ019593; Fri, 7 Sep 2018 06:14:06 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fyGaM-0005lV-1p; Fri, 07 Sep 2018 06:14:06 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 3DC5760508; Fri, 7 Sep 2018 18:44:05 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , Anurag Kumar Vulisha Subject: [PATCH v3 3/8] usb: dwc3: make controller clear transfer resources after complete Date: Fri, 7 Sep 2018 18:43:44 +0530 Message-ID: <1536326029-16327-4-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1536326029-16327-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1536326029-16327-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)(346002)(39860400002)(396003)(2970300002)(199004)(189003)(36386004)(4326008)(103686004)(81156014)(81166006)(8936002)(50226002)(5660300001)(106466001)(6666003)(107886003)(63266004)(6266002)(48376002)(36756003)(50466002)(47776003)(39060400002)(52956003)(110136005)(42186006)(316002)(76176011)(2616005)(476003)(478600001)(16586007)(54906003)(486006)(51416003)(126002)(305945005)(356003)(8676002)(26005)(336012)(186003)(11346002)(63350400001)(63370400001)(106002)(2906002)(446003)(90966002)(426003)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR02MB2688;H:xsj-pvapsmtpgw02;FPR:;SPF:TempError;LANG:en;PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com;A:1;MX:3; X-Microsoft-Exchange-Diagnostics: 1;SN1NAM02FT014;1:z8PC5XV+Uyzysp+q49uZHDpfs/ZK5TKkQCJl0F6yXYRC7/JfQQA7QZwrxc9SRaDde8PqQVjxLICFimHp8vgwNUI1rPEOqkTXBcinhsD3K+T0AUbAQrhWvRqQOqjOEBi6 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: da0fac17-fc43-4bd3-ec59-08d614c3d27f X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060);SRVR:MWHPR02MB2688; X-Microsoft-Exchange-Di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XOfvEkL2kxQpI4CAr58mIEEjLbb0QrzAXYakMiGQog1FQnplw/Y9MzWr0PdVEPLI0OnHq4OvIXTy8YczEuRdyZPvrs72ktlDSuTKBoUZCVkkErCsp8lTje4AfJArRzIPx1AiO6Vsbb0AhK2u9iSCiGGkzcV8/nSzoH52Ibc22G5B99xPSCFORQqUcHO63aUlf/yb+l9NUrXlYW+B7jmBUa9edRpVbn3JsrBlsFMn6BXdUbRtq5cfh64zHDnsowP2LWG8WZ7jazM9mti2n6KzmezZXRWeleCPvffI7Hdmcg+oSH69RPf1t+jxvqoM8ehM7hu4dBa+mdM0XHQObfpOwgipcrirTgGmME62Blfq7CksxGjBWHxix9dpSWKTJ+hT4Rn2Q7hKbnRhmXzg3vYxCwu6KPYmOogj8fRrrgh87ZLABvocmIEn57gshSkFyZWg/1XGTUWFG3ysm/QvW9G3z4IgQF 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)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201708071742011)(7699050);SRVR:MWHPR02MB2688;BCL:0;PCL:0;RULEID:;SRVR:MWHPR02MB2688; X-Microsoft-Exchange-Diagnostics: 1;MWHPR02MB2688;4:uyD58j51Ge4k/waedYHthbrBZ3vpcNuIQoiVZxYCmKLboTi90FFzIUWdEliIWGsDySFktnfNXmFzyL7Vm9OPnJBbFu+ibu3d1vKWqVARK9slQfAvum1/Ny77rcG0f8smez4H2JcpeyJ8HrHje13WEdrWBEy+htZdd+iODuGDFBuY40eCBcl4JZYHKgOHNsBxIa02hjblE3dO46uPSBael82u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L5CZnDAZYqnV+LooeLH5Ut8lJVoiYnBhalpm6LMsowsIftxkPJgzitSWTm+1VVyYvhwwGm+JmrlkshF1xUD++vYeVnUjjPaEnSFPOjVnCDDxmWof7+O7yZzsNrHre+jLerIQ==;5:/AwXFnv+808b7hvGwLVYYYlWHeZo286qWlrqpaq8EmPV/X51+g+KqZDL0vumo+QecJS0p/gWs9Azp37raJ/ZDOhcDRz1W/dEBe0WvtVStM+JdpLRShByDeL/1IflxMMQ1EhBfKIcXYv+bAZqavU9MEgwpcA/kJPivO5cYMj8AvA=;7:5JWnEdGvl5fEuGc2r2jMLkVNFKMlg5oJpcR6aXRwu5bWX289NUX7MRUSMWLNMJcjMdV1R3i6y7XiitJrILfYzvtrmj3d7bwCLypsieaGnqnxvSfWrQfRNuv2h6pIP6OU0K3BrXnRyDjFvCTCgrvL8K9wDaXPWpgtjXE0iEt04Uu7Yqs22wyEpC0EU24VsoAJG/RLuCSriLgfuoIipjPcG5KJbhqlb2uvpNm7eAXDWxhP+kvKMJgbCgS1kDIQyKwU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2018 13:14:19.8999 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: da0fac17-fc43-4bd3-ec59-08d614c3d27f 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: MWHPR02MB2688 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 Reviewed-by: Thinh Nguyen --- Changes in v3: 1. Added the changes suggested by "Thinh Nguyen" Changes in v2: 1. None --- drivers/usb/dwc3/gadget.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 43d63a8..13ea282 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; } @@ -995,6 +996,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,11 @@ 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; + /* Fall Through */ case DWC3_DEPEVT_XFERINPROGRESS: dwc3_gadget_endpoint_transfer_in_progress(dep, event); break; @@ -2472,7 +2487,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 Sep 7 13:13:45 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: 10592187 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 6B22C1669 for ; Fri, 7 Sep 2018 13:14:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DFDC2A93A for ; Fri, 7 Sep 2018 13:14:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5197C2B1AE; Fri, 7 Sep 2018 13:14: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 B16192A93A for ; Fri, 7 Sep 2018 13:14:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729402AbeIGRzZ (ORCPT ); Fri, 7 Sep 2018 13:55:25 -0400 Received: from mail-eopbgr720063.outbound.protection.outlook.com ([40.107.72.63]:27072 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728322AbeIGRzY (ORCPT ); Fri, 7 Sep 2018 13:55: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=yunVzcyw+srTsSotZNAFuedem7YsFjztCVDhgC/jEFg=; b=5Y0Nd+JDf41yXxHMNk6gGObWDk1wnGFPvq1yfWRHOOrZ7n6mQwmev59QN8VKqgCNQTbjA9Theglw1MZm4qCKgHVSwTmudFE4Vg7Y6OBazvyLxWiXq+l96u5PPVH7rPM52tm8bWJvyq17G5w/vNOL33I4WS4LmsvhTNxifi37nkk= Received: from BYAPR02CA0057.namprd02.prod.outlook.com (2603:10b6:a03:54::34) by SN6PR02MB4943.namprd02.prod.outlook.com (2603:10b6:805:99::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.17; Fri, 7 Sep 2018 13:14:22 +0000 Received: from BL2NAM02FT062.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::208) by BYAPR02CA0057.outlook.office365.com (2603:10b6:a03:54::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1122.16 via Frontend Transport; Fri, 7 Sep 2018 13:14:22 +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 BL2NAM02FT062.mail.protection.outlook.com (10.152.77.57) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1122.15 via Frontend Transport; Fri, 7 Sep 2018 13:14:20 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:46050 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fyGaZ-0000Wh-Ql; Fri, 07 Sep 2018 06:14:19 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fyGaU-0005mb-MU; Fri, 07 Sep 2018 06:14:14 -0700 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w87DE7ux019599; Fri, 7 Sep 2018 06:14:07 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fyGaM-0005le-JK; Fri, 07 Sep 2018 06:14:07 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id C3A0F604DB; Fri, 7 Sep 2018 18:44:05 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , Anurag Kumar Vulisha Subject: [PATCH v3 4/8] usb: dwc3: implement stream transfer timeout Date: Fri, 7 Sep 2018 18:43:45 +0530 Message-ID: <1536326029-16327-5-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1536326029-16327-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1536326029-16327-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)(346002)(376002)(39860400002)(396003)(2980300002)(438002)(199004)(189003)(107886003)(90966002)(39060400002)(426003)(6266002)(106466001)(47776003)(50466002)(316002)(36386004)(486006)(48376002)(5660300001)(446003)(76176011)(2616005)(51416003)(476003)(478600001)(11346002)(54906003)(42186006)(110136005)(2906002)(16586007)(103686004)(8936002)(50226002)(106002)(97736004)(81166006)(356003)(26005)(186003)(81156014)(8676002)(126002)(63266004)(53936002)(6666003)(336012)(52956003)(14444005)(305945005)(36756003)(4326008)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR02MB4943;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:ErrorRetry;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BL2NAM02FT062;1:GUj5A/NvYwSunMZXgPXrLVAUCKCbUbHacpFvwyu8pSxbKSIIm/nfEQHC0B/idvjHCyQ5c6+XXkMGWW8RhLawYTC7EWba1daBJOqvnKsTSlXNzuPUr3/a5qkcPGLvwOmp MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ff7fedbe-3dea-4de7-b862-08d614c3d2c6 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:SN6PR02MB4943; X-Microsoft-Exchange-Diagnostics: 1;SN6PR02MB4943;3:WLgM98oYauNtGvjRcdBp5CfSpOM/+8O8lrrb3lghDTc2AEjr4WGAAtbpGS4mEhkES3cflsYsJBLukKceQfO6zFhohtY+BbtEBaBXsYPunqsYFdYDpbW/8+BG5j238eyTgJ4RWPT0IWBtKUJaKIUCuvRCxhzMRc/iBx+FFUgPsp68/XRXsrRs/7T5FgRU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JY4zkKs/MDCxA1sH/xc1u5Rq8HJYi1oOO02y85tk6YC+6F4MruNNvgMPUyGQk7ZMoZl+EF8Z+r0QA+MokMLV1D7so3tdxMDz6EnDMlc4kTHEG7F8P4ANzzhmZmNStFWTeiC56P/7WJFvASj0pE6xslq3KJe1JeO7rXVbeIZe5TrEgT9CpJfQl1har1RCdD2xQ343pXiFuZ4NqpIheCnUoMxQ+sDdWc0jrattjSMWvub2Y+6tnfMaXejZVDAkkS0HKs 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)(93006095)(93004095)(3231311)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699050);SRVR:SN6PR02MB4943;BCL:0;PCL:0;RULEID:;SRVR:SN6PR02MB4943; X-Microsoft-Exchange-Diagnostics: 1;SN6PR02MB4943;4:Ww0vtOsz6mG7euHmb3HRc7Lr84kwKu4vMfviVMepwIT/gjIWtkn87zpXPPo2aUv9Y74EPUQaLWxm4S0S9Z5tIcwqJ8eq9QbWSBhcnFQUJMJFOPLAjwPOi1XuHVNeZcgu06ixo79ypgfk6X2psjv6hegPurQj/m/R2x9XfoyIPxox2gkLaGTs3ZB1S5gajjTjNfJ/Fh3kZdZW6JUc72qDwap94tVqeC4c6rMRj1B5v+lj23bEebbkY2r3L5kid9b8XyYfJ2OwjAHCdaOPB9i/mapB3Z/SLfPkzixjBnIPjqfvTi8CxNHcwwASeiV/NvY5 X-Forefront-PRVS: 07880C4932 X-Microsoft-Exchange-Diagnostics: 1;SN6PR02MB4943;23:4FKDSMXXBGAYMGv3Rc5zhzK2UOQwb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Le67hI4/IhMz5txEgESCd3kVJPOB/WcL0AwL4PsTZ5uS0Ru9ZAME3xwIsio8Q/X7AnMaZll5Mnw/DT2a+0Uk4Bn0B+BvNm+ZTsGuaBGnvSYBKZv0RFRVe/E4Mjk2QfrpzC1gcNA=;7:+AmxzE4JA+DyGwXSVbb+QrmFDYxsulrbLpRLz4mAYZfz+6uwLMMp+FyTLgyBpkr99HGSTwchhNUcKwAuYgI/XYEai/qVLJvLKKQ6wdSuH759H+tWcuEyGX9AdickOCioDsos5RnKyFGJVcijC4Dx88uxnbqJMP1aQVfKmlFvUZEwp9Cw5gugG7D0UUVYHfw/CDy/XcQRXq28YbjZWY+pQzbHoJUJgN1nKAUaKOS8KvDQNfI6iH7pKJX4Fkkkd7Xs SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2018 13:14:20.4420 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ff7fedbe-3dea-4de7-b862-08d614c3d2c6 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: SN6PR02MB4943 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 Reviewed-by: Thinh Nguyen --- Changes in v3: 1. Added the changes suggested by "Thinh Nguyen" 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 | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 5bfb625..0b255e97 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -633,6 +633,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 @@ -656,6 +661,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; @@ -705,6 +711,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 13ea282..98e5f39 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) { @@ -2487,6 +2506,11 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, } break; case DWC3_DEPEVT_STREAMEVT: + if (event->status == DEPEVT_STREAMEVT_FOUND) + del_timer(&dep->stream_timeout_timer); + else + dev_dbg(dwc->dev, "unable to find suitable stream"); + break; case DWC3_DEPEVT_RXTXFIFOEVT: break; } @@ -2588,6 +2612,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 Sep 7 13:13:46 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: 10592193 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 64B6B5A4 for ; Fri, 7 Sep 2018 13:14:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 591DA2A93A for ; Fri, 7 Sep 2018 13:14:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C7DB2B2DC; Fri, 7 Sep 2018 13:14: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 C3E2D2A93A for ; Fri, 7 Sep 2018 13:14:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729387AbeIGRzZ (ORCPT ); Fri, 7 Sep 2018 13:55:25 -0400 Received: from mail-bl2nam02on0047.outbound.protection.outlook.com ([104.47.38.47]:5216 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729310AbeIGRzY (ORCPT ); Fri, 7 Sep 2018 13:55: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=z5Q9cau0y2Rjs9+j4B0MckVojd91G3BKlk3vIiI/Wv8=; b=kBrgwwlDOV50lCgBVMpz/CgRt/MIfTDNd9Yz6tdhR7G5iw5KkwATAbSbmhuwIfmlVKkuSjuK40BV1D0aYCRjU7ppg3lpEwydvgBxByE+Q5GSUc62xwmX/AGrV1UqebZPcqTgYyj4m+mlzaXJQcm94LQBvk+m8y38wiaA11ghP0w= Received: from BL0PR02CA0043.namprd02.prod.outlook.com (2603:10b6:207:3d::20) by DM6PR02MB4937.namprd02.prod.outlook.com (2603:10b6:5:11::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.17; Fri, 7 Sep 2018 13:14:22 +0000 Received: from BL2NAM02FT027.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::206) by BL0PR02CA0043.outlook.office365.com (2603:10b6:207:3d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1122.16 via Frontend Transport; Fri, 7 Sep 2018 13:14:22 +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 BL2NAM02FT027.mail.protection.outlook.com (10.152.77.160) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1122.15 via Frontend Transport; Fri, 7 Sep 2018 13:14:20 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:46032 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fyGaZ-0000Wf-K8; Fri, 07 Sep 2018 06:14:19 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fyGaU-0005mb-Fr; Fri, 07 Sep 2018 06:14:14 -0700 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w87DE63d019326; Fri, 7 Sep 2018 06:14:07 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fyGaM-0005lN-LV; Fri, 07 Sep 2018 06:14:06 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 5262D60493; Fri, 7 Sep 2018 18:44:06 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , Anurag Kumar Vulisha Subject: [PATCH v3 5/8] usb: dwc3: don't issue no-op trb for stream capable endpoints Date: Fri, 7 Sep 2018 18:43:46 +0530 Message-ID: <1536326029-16327-6-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1536326029-16327-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1536326029-16327-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)(346002)(39860400002)(376002)(396003)(2970300002)(438002)(3923003)(199004)(189003)(81166006)(48376002)(478600001)(50226002)(8936002)(6666003)(5660300001)(305945005)(106466001)(63266004)(356003)(8676002)(81156014)(2906002)(36386004)(14444005)(186003)(106002)(51416003)(76176011)(39060400002)(90966002)(6266002)(26005)(107886003)(476003)(486006)(2616005)(336012)(446003)(11346002)(36756003)(126002)(110136005)(52956003)(426003)(42186006)(316002)(16586007)(54906003)(103686004)(50466002)(47776003)(4326008)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR02MB4937;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com;A:1;MX:3; X-Microsoft-Exchange-Diagnostics: 1;BL2NAM02FT027;1:5ALN1DI+O67MVdasPTmscTHtntvIPtt/YWtEMp8hQDZReis6+WWplN2avktBXo7EjBS5h45fOBTo0ythoezfavIfrrxmFKSASKmxVLxr0qumhs4Kn90lohR2q5WjvUhn MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4d12565d-be26-4c92-8e4f-08d614c3d27f X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM6PR02MB4937; X-Microsoft-Exchange-Diagnostics: 1;DM6PR02MB4937;3:4P9nri/IhmGu4hU5bUlwIfIVZHzYtprvr15mLBlGIc41kUMrpXoiSAqLXWNKveDgDnUZA716h3U0xMmjLAVBgbkizmEByVBD/fYPcM0zJSmSCnAKOBFqBCA9niFEyZhEJ+CylJnBro4nv4/BDeeTozVH2GVRJv2+aKiagEkyWLE2/cuFJEWV2E93tlTMPWP9mLd4Z4F7uoW2C34cyvHOokE3ARosbkwO1k8L6Mkjb/aAsVSsX3XY7FgiOwKgDfPOGYzGJ6tTIBDnERyKr2oDgzTxijnMvZjG5o3IMQif4Jp3wrQgRS14be4sufh/4P6ODFaM2wO3dFil3PbnahQ+neK2xPt3hnlotW+QYNnzJ5I=;25:CVN9TlMBBV0+7yLHm8bb+ncluOGYBGiKpWFaCRR+4oPYKrKrrilRdHn1goAqrEFJF7umI6KyVQK5MN6n9Y1i/5x4kRE1fL+bwJYymlQrem/OL/wH8iPZCOZxt88dP1jYeXTGYdJ5HyIhZ8keJ/emxmHQVwzmDW9un77mRfgb2jf839q08Z92AWDgewNPgK95Pgd3lrgJ2KVkDjqFgDcZXEBJG/MqRcQ7ouaCwOWaoycKg6mrt5Lc7pWFS3qw4IFqZmk0PzjVAP8uUjnqgvjiy/F4FKxOAhOdj8g8xZziltJyMcZ6OLQAz1aV1w09BQOChn12UuHdljm3d4a++0mfhQ== X-MS-TrafficTypeDiagnostic: DM6PR02MB4937: X-Microsoft-Exchange-Diagnostics: 1;DM6PR02MB4937;31:dr7wPbssMSwdFDWAddsnV1wgM1PiyVpqdyjHznuB2GxF7SQJIoPHg2GW83qYqmzxig/XNcKuHZgHDQXfBF2/RrLVSN+QVU+I7ukUlxFsrll+Jf9zc08Ej2oqA3pEe1QyxwdRUH6nGjlY1LXBCOJyoL6uoXLrIfL5+0T/3cOF305WZ+TTmm/0cBIN2gHK4Jswqz0HsT1HCWPjucD0IEaKmvMLdf3AlTaXJCgGDXsmpus=;20:yY2giLiRD0DaVHnIhcSGZ4bNGOumdfNhkDKhixv552hoRTszzWcOl0F2QfVjHwxQJ5gdCbwhg0KxhptSjwMhb7P53oj18ahuMq3A8+5z2OTG0QoOgFtvmhjqrJ5vZ+lm3HmCsCsBwOwjKMoNZuzNEAP0a2u6zNlPDy7VvObrbVUftA5krOKayGtN2Cz7FIxnb22Wjc2uztNdoGSG0bnJ4T7YK2FTQ470CZRVWT2IU37fqFYCP0WfY3OpgMm934Lhpd4Gq8ke/xTlGZWjLlmSP05hPel9ufNA7w4yRVRRQ7iYekPdlO9RMVu08/loDsM9UCcIAJiGSlre1M9H7VxkJtmF/m3cHtD96QU24LP9LhWjwYONXD3qa38tSPQGm7T9OAMjiH/wPLdesjJZDnLrbwcybd7Cv6EF/1ZiJAr/6RfsDsZG9H0YrJL7CN3rYCehbyBsdbaCHWecLYUTceHVwOfUiVc5uzwQeWi4CMtdmSE7YeBIPmHDbSlz+Mn8DMjY 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)(3231311)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699050);SRVR:DM6PR02MB4937;BCL:0;PCL:0;RULEID:;SRVR:DM6PR02MB4937; X-Microsoft-Exchange-Diagnostics: 1;DM6PR02MB4937;4:7vnxxXAf5lERcihCgJrODFmz6VTriiiN3Fgo1WyT75oTHYbK2vvpKedVmGR046Xm8E3VowPbk6P96JT0RqyYRn84F0+7RtdH9sJ+uR30J7DFahR7WoK6jfX7ROUkacSdO9GpLQUnQleAVn9C/4Gts2atqxo283ewYMTwxzEG4wtkdoz+wfWWqZlcA9dY8QB2lw4vzt9o+8VbUVExHNe6KlNAKlY+AFvG1Ytr/AVhdbFTPlpzAgmZurzez1UPggX/lgG+yeULwkA4jxxxRTupfXtXhdJXcCOE65jqRRInELZts8JEDhOTglEnmsGDKOsT X-Forefront-PRVS: 07880C4932 X-Microsoft-Exchange-Diagnostics: 1;DM6PR02MB4937;23:2KVchzXK7zHBsw3NOOjHbWFek22dORgiNHvf0sdkAQTKsIMQbHpU5h1IGGfjzSdt6IVDtUxVNpfVzDcinB62z+0ZrlrsvDbn2teNR+8AEBaGbasEPWmOY99mP97f8MFs85iqroJL1mvKyFKIDpxUnlrWwYi/yeAPgE9qt1veiCi0usNmS/QI+xOb2QZAckLAqfmgZnSQJivv5s1URcae4gXUWK/TgjpnofPMVDbFtePBei4uHu8j/8Q3iBIb7S4QPLY1k32n3wTnYijNkYOdyDJh+kY5BTP2ijg7zn5FpUjqwCuSs/h/PjeY/srGOVRXlnaBtgb+iQAQDNQE39k7bx9nRdmPahy6pUlI23hnEzrvNR8MUwXW8r2N6XAmGJw9/IfNpdD0x1wM8Oa44JCaYFvu/T2rnrT38OiKvsHzmBCp0+/lwU9LLr57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SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2018 13:14:20.0381 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4d12565d-be26-4c92-8e4f-08d614c3d27f 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: DM6PR02MB4937 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 Reviewed-by: Thinh Nguyen --- Changes in v3: 1. None 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 98e5f39..6936adf 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 Sep 7 13:13:47 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: 10592197 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 87E815A4 for ; Fri, 7 Sep 2018 13:15:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A5BB2A93A for ; Fri, 7 Sep 2018 13:15:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E7312B1AE; Fri, 7 Sep 2018 13:15:10 +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 E613D2A93A for ; Fri, 7 Sep 2018 13:15:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729341AbeIGRzW (ORCPT ); Fri, 7 Sep 2018 13:55:22 -0400 Received: from mail-eopbgr680053.outbound.protection.outlook.com ([40.107.68.53]:55808 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728906AbeIGRzV (ORCPT ); Fri, 7 Sep 2018 13:55:21 -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=4VivjJ8eR/tMk5x1HOhKpeEGXvTa9y0P/UaFqCcVCyM=; b=WOd83gQinFE0XwvFakw6ialzefXS4rXYiGy0pMmx9TA84MXfHq5Ooocx0tc5lSJ0nSczO9wzCibvcBvffG+7s7365VqzFS8LiIfDrmsGqncBRLKFlSBK/j7afyOIMhUOEBTSpX4wLttdp+7raCnvb3KGBflNP2xnear3EEu+HZw= Received: from BL0PR02CA0106.namprd02.prod.outlook.com (2603:10b6:208:51::47) by BYAPR02MB4934.namprd02.prod.outlook.com (2603:10b6:a03:47::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.15; Fri, 7 Sep 2018 13:14:23 +0000 Received: from CY1NAM02FT043.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::209) by BL0PR02CA0106.outlook.office365.com (2603:10b6:208:51::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1122.15 via Frontend Transport; Fri, 7 Sep 2018 13:14:22 +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 CY1NAM02FT043.mail.protection.outlook.com (10.152.74.182) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1122.15 via Frontend Transport; Fri, 7 Sep 2018 13:14:20 +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 1fyGaZ-0000KU-Oi; Fri, 07 Sep 2018 06:14:19 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fyGaU-0005mb-Kk; Fri, 07 Sep 2018 06:14:14 -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 w87DE7Mm019328; Fri, 7 Sep 2018 06:14:07 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fyGaN-0005lV-3L; Fri, 07 Sep 2018 06:14:07 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id BA39460508; Fri, 7 Sep 2018 18:44:06 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , Anurag Kumar Vulisha Subject: [PATCH v3 6/8] usb: dwc3: check for requests in started list for stream capable endpoints Date: Fri, 7 Sep 2018 18:43:47 +0530 Message-ID: <1536326029-16327-7-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1536326029-16327-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1536326029-16327-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)(39860400002)(136003)(396003)(376002)(2980300002)(438002)(199004)(189003)(51416003)(110136005)(90966002)(54906003)(97736004)(316002)(76176011)(42186006)(16586007)(5660300001)(106002)(53936002)(8676002)(356003)(47776003)(63266004)(478600001)(106466001)(39060400002)(6266002)(36386004)(186003)(446003)(50226002)(8936002)(11346002)(2616005)(476003)(126002)(426003)(81166006)(81156014)(336012)(305945005)(48376002)(50466002)(486006)(6666003)(14444005)(4326008)(107886003)(26005)(103686004)(36756003)(2906002)(52956003)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR02MB4934;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:ErrorRetry;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CY1NAM02FT043;1:kQAUhAZ12Z4lgl4uBP/qG8VD1uVVIkSPV30LGBtQQ6PNvIa3In+KOaF3z6Vhh33WZaLjVnn5OZQFvA0Q6T2os4rkWbhp802zb6fSQTcjojC3GMbtb9xKUk5eOKvJZH06 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 62851096-91ce-4032-19be-08d614c3d2b8 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BYAPR02MB4934; X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4934;3:vZTH/CEzdAYYqNEB84cZcfXJkKA3a05o5FWE/mJS9XZUo1U7CcfNyM+5VY1BSOGdw6oy1FBd88j6q+cNzL8Qc37kzXGe5znkw5VMR3CQHfZ84+cnxK8C3RRVxE6gHFuvw3uynu5Sqq6EY891OGqrUV2g9ACcWvoNzmsD/jh//kWI/y0HSCrQCFSUXxstf41of8rRrXCiMlEzQVQqhtvBYp9tVQDQDKvgWxudyq+XWVTIfYyAshYOgZzhOATGGxo1pzEeV7CQ2ACzSS+YbZouvkOPVLYs62lbD7U3BunsKPRslOEOZZuNa5daMdKeXlkoUtw3FdMJBqdguSqYN/myRThWofwq2wf6sTRwjMdA87A=;25:hX1jGTjRNLUiRmP1k69Ac31mf123cY6HoWNacNdVBziaOfWCgebp7dBb7uwgf9H065glx+6a2p0JZDpMcYARmjkKR9LGL1iotLvLhlWwivNUqOXxdgGVdpD7btUsPMeezo2SKssd082K+cfhZcYhLUHs4id1YYg77Bv/dLj879e0v6lWdLX/TN5i4OfGVFQlTIm5LeTHCeU47bt0weSX+IbM9MIwi1VswiXFd2ew2QtCNOi4zm9HFnOm4bgyzSLAQRgD8m58I1vvhbQr+vL4tIicpiRq/JhxmaRxl1Xbl0n7ClIxar2gaZpjiTA4YGgqVQiq3AW1QwbL3IT0j7Vn8A== X-MS-TrafficTypeDiagnostic: BYAPR02MB4934: X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4934;31:Y02qbQBnzepyixvjDaNSkNsw5nRNDu3mT1aXjMZJoG+PTLY9SYqAQX4zKVpsug9WWaWoKZeczAxZayUk38cG6BjHLgOJLTle2661BBlJNlnTH2fVQhdCS8tgNToB8K3PNr6JKmo5MirXCNLxR7Rj2yg+53kJBmhCBJ0sPfsDQFZY39lL7VvBKKj9mciaH/kYT8RXODjf/MQT3xtVvA0EzF4zo41bQu1bL7Wj5shO2Ok=;20:qrSSrnN00ySesxGUd9ZJqfMXLzWS+SUn8VvaD1E+vSNvHkEwFX0sCfqgH52duV7Pcd4+9zcnsHvWZCBVD8nkHb8a3vF1Jg9PpXegkOjniM6L1lnRgXU502q1DvXLfLmnYnteh078Uo/cI6zv77ffICvC40ZmXW00yt/YfuHIQggSQnUngb9uw2pT9ubM/WvnlHm0KL0ojPSTdygrUtkugWWleN2DX6EYyt+lHwO2oZKRpNKw4uvpGhoPcGcO9jyjJpUAfGzaz1quLl+v4poTZzjasITKxf/R8KMG+SvYtcDO6YfQzepFahNHEIn1PTa479Z3Ay9reUfbfl4woUh15jeK5cqVYBkuCxOknHC7yFTaUZWEMKJTi0W12CJdbY2SQyWwRqo15D/eGOE/OotvbVtF4v2tmShIsQHhH/N1Ca3CcHEfluDPblcE/tRJpsKx50zFFNY35wLz1jjZmYJD9wnghzQ2unZAt7mW42g/LponPKrPxJj4EO2fjichYvwm 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)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699050);SRVR:BYAPR02MB4934;BCL:0;PCL:0;RULEID:;SRVR:BYAPR02MB4934; X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4934;4:qs84AsEzwyAwsbfJtr9MU6exZfRITwgf05+DnL+HS4T9bWDMx53AIU+efVSRtDnvHSuMhu6MU9ieMNUnn/VCZw47DqUwgFSpsJVy+6miiFKVPnCdEhuZX+lBbPZ40F8FcU9tBbsBXvzbrUiMT3m5HE6c1/l3AQhPrJ3BGTxNv91RCtkK4ck5XnXuYVLey6Rn5XxrXQv3OZw80B0S0GFUCyu1+eWpGg+ijqN3BeveohiQhTltOLHWJoyCkIVAzM8gqXupR00D3uhNAJuUS+5Vh/cpG3QC3FaZk1lUxvSJL0ZDMsg6E53AErYH73mTz7PP X-Forefront-PRVS: 07880C4932 X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4934;23:8Awvga6eZOeRLUawFHYHwRy0MK37Kgl091KvsMzgjW9pEB8TApqkK+uuzvTzdNddR6NBaUFsHha8LHaKI/uMn6Rugql40s53PoUtKZ4pd5RDEVFrxs7UQ9PsYkhBgwSwcbUUNkOHwyQsW8lXAvdmwmCalDEf8XyIBr19gEyS81YNaI8SmzaZyOvcubK72aO8mG9J7qXjf8ShJg9huODBL+2C98FwLL/pCO+DyImg03tC+hGvWV4UAvMfXUAPORMb4B6nCkCYzW3aViMZ3c0EidxxiqOlo7y19Rqf72TWhVRl2IvZUFDGjRQKdZwUSzCcsQXoSWI3F+p22fx9GgmsMmshZcsa0FIsnukItwqU2Z0ekHhMiHzUSUtktzigigiXBPFP8z3BKHN6gOPloESM9Ggr5hqZgzUqAcJnpjSt724JQHtzcBGnHs5oRZ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osticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2018 13:14:20.2212 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 62851096-91ce-4032-19be-08d614c3d2b8 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: BYAPR02MB4934 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 Reviewed-by: Thinh Nguyen --- Changes in v3: 1. None 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 6936adf..e9901cc 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 Sep 7 13:13: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: 10592199 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 2BDD614E0 for ; Fri, 7 Sep 2018 13:15:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F0832A93A for ; Fri, 7 Sep 2018 13:15:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 128CB2B320; Fri, 7 Sep 2018 13:15:16 +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 7CEDE2A93A for ; Fri, 7 Sep 2018 13:15:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729307AbeIGRzV (ORCPT ); Fri, 7 Sep 2018 13:55:21 -0400 Received: from mail-eopbgr730068.outbound.protection.outlook.com ([40.107.73.68]:10891 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728877AbeIGRzV (ORCPT ); Fri, 7 Sep 2018 13:55:21 -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=pBtCD7fkGJJfNNQWAD6IhYGopGxy91bnTlFOSq32qUo=; b=z2VF0qrx4LTGUfLKXDoK0LlhqH+a7prbLtUb/lftXAkQYYonIdrIOisT9Vh9Q2+SfEjMVijb5TT9OjMdSMK8Loj47GFsThVE6m0qNZjJfXQfonJTVJq0ugdlLnu+VRP5191cNbdEeM+r1JRApC+g7CfppAJa1NlYrUlX5jYzU38= Received: from BN6PR02CA0079.namprd02.prod.outlook.com (2603:10b6:405:60::20) by DM5PR02MB2682.namprd02.prod.outlook.com (2603:10b6:3:106::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.18; Fri, 7 Sep 2018 13:14:22 +0000 Received: from SN1NAM02FT024.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::205) by BN6PR02CA0079.outlook.office365.com (2603:10b6:405:60::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16 via Frontend Transport; Fri, 7 Sep 2018 13:14:22 +0000 Received-SPF: TempError (protection.outlook.com: error in processing during lookup of xilinx.com: DNS Timeout) Received: from xsj-pvapsmtpgw02 (149.199.60.100) by SN1NAM02FT024.mail.protection.outlook.com (10.152.72.127) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1122.15 via Frontend Transport; Fri, 7 Sep 2018 13:14:20 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:46069 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fyGaa-0000Wi-4W; Fri, 07 Sep 2018 06:14:20 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fyGaV-0005mb-0E; Fri, 07 Sep 2018 06:14:15 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w87DE7Ne019603; Fri, 7 Sep 2018 06:14:08 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fyGaN-0005lN-KF; Fri, 07 Sep 2018 06:14:07 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 417F360493; Fri, 7 Sep 2018 18:44:07 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , Anurag Kumar Vulisha Subject: [PATCH v3 7/8] usb: dwc3: Check for IOC/LST bit in both event->status and TRB->ctrl fields Date: Fri, 7 Sep 2018 18:43:48 +0530 Message-ID: <1536326029-16327-8-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1536326029-16327-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1536326029-16327-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)(396003)(39860400002)(346002)(2980300002)(189003)(199004)(110136005)(39060400002)(42186006)(54906003)(107886003)(6266002)(103686004)(8676002)(186003)(426003)(6666003)(486006)(305945005)(316002)(76176011)(51416003)(16586007)(47776003)(356003)(478600001)(14444005)(50226002)(4326008)(8936002)(90966002)(52956003)(63266004)(36756003)(11346002)(36386004)(126002)(106466001)(336012)(446003)(81156014)(2616005)(81166006)(26005)(6346003)(5660300001)(48376002)(2906002)(50466002)(476003)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR02MB2682;H:xsj-pvapsmtpgw02;FPR:;SPF:TempError;LANG:en;PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;SN1NAM02FT024;1:VWbVB6MbUR8E71oj/kYP5bCred5ZjR/54tcMw+56Y0+eRZpQ+3XNPTc2DVC3gO+U/ED+A6TSJHL2IL+UiozVDA+eqmF84jdf04SyggzyT90OsZNSLCIoMonDsjbigCP0 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b4d6a228-c952-4b09-3c34-08d614c3d2d8 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060);SRVR:DM5PR02MB2682; X-Microsoft-Exchange-Diagnostics: 1;DM5PR02MB2682;3:1J24N+CZVAhvGPUM5WKZAl5xERkPFglWnplkwrkIibXaPrQkxu93V3ohYpidcK409/D+OdHyXOeGUV0MFkuUZ+PCAQZhbYz9zQZmpwDhRg2gSCKEQl8seBj8zqCf8h9IqbZSuuF2g0nRGz2r6Enb8KBZadJr9tr3s8GROaqSQzNCgOlapY4IbZV+lJPF/rCGVzh4qHI1sLpevOwWFboZVZD1r5WyAJsVyWQWVGds98HPw82YibyzghvpmXpiBblckMxWCDYG5b8PiLmNJ8qXc5qeLneRXS9nhSnFc+bSYWoD93x1xTTehq6XEkHGok9kUyLZIRzaUMK0NdBPk3Yn8pBDf41lL8Ub3e1HbSwv6OI=;25:2QYm6Nz6I9/Q1D3R95N/ePcv2UQ3jf8AcwjwfTLUXQJCyBhVG+He4nDHh78YPJdgnsZyzmFFCuRKoETfDdACwsVQn7ToxfXKXv48Aq+Q2F5Y1fnjZAIQYRudmou32r2mKDtIDBcEwqCA5TX8U4yx2vqesfTSz47uPKNICNWf1QHrdb0Xwr/rETU1naZ+lJMOluPHSVwQjoZduDzsIMdZDC0mazsNSbxC/5lSQx6satGGJSTz6fdyrNF27XKNdLQ01zYDkX7s7yNxTmyTy8yAn6qSZE+P3hmVzKlU2Ul02T7xKAoCHm5qEH7B3m9YpuamklYJayKr6W+TagKnwQlPdA== X-MS-TrafficTypeDiagnostic: DM5PR02MB2682: X-Microsoft-Exchange-Diagnostics: 1;DM5PR02MB2682;31:lys27gHiuPy5D4CQ0LgaueLBFhpT7w4s1pJKez+JY6SbqGck36UEIYAkL9n+Fy0qhzLf8DTs7a5e+r1zskTBlYh7ZB5WcrkmmDqyguLy9ZNcJEFQFr5/gfn66H66n1jtsRlhq2k7MI529iQZ5Klm35rx+/O3S65mrz6a5utiDTSXOQxTeuhMogBhdNYEui2lT72izLX7EJxYMYRnY70yPR2ppyCwTm+UNQED9voqgDs=;20:dYLxpdUb0pEueWyArxzlTF7fmmjfGsuEXCmT2eafDjFsrRU+En4BClqVzkctwXymAoYY4ajO4IcMOwJgOiBcjXtsIytV4ucRVzCjlfBIYZ8LuxPSFm3vJ6Jq85/t0FNIJ1qIO/CH6Gt8SGBWqAkiplvEa0BcSEpkq20T0RsmuZY3gCJiJeTtwoFfTlCmjprAX9UNUUu0hEnUaUyDXKDcpQ8y8TlgrHr9SSKMZydyO4Nsp9lGQ9Ln+y0UmDiAtEmvj7/OOlamew01xDcJTtrhplSbY/3f+HgY7ZbhY8vlY3/HcAKc2qDbzWZmcDDIcq9FLGDYYLsQ7IeHxEkqks3yZiuTnlpTNCnkth9V4WkXYBUi2gZkSICibqQBmbhuW5luttkFVmnlnUswGwdruZDFaOXO6eXBjZSa/oY0SkBzNS/hDJ7Ta21buhgNpUM1JfPfSH8inNVYvJAofwNyqjuEG+BPA84AqRMdvZRcAlDZZHbxjoC8PF+rABsvU3ZzDyMs 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)(3231344)(944501410)(52105095)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699050);SRVR:DM5PR02MB2682;BCL:0;PCL:0;RULEID:;SRVR:DM5PR02MB2682; X-Microsoft-Exchange-Diagnostics: 1;DM5PR02MB2682;4:Xk+yZxWYMotQxQA/VX+m80XdU3AloW0Mmu8Dtsc8P71ZWk5daA2sLBV/PWToUHCOx0E89cTLeNEoxdmub8pyihCq67Ys4esi2HMSQCtjE3af+LDFtdB3CxwqHMhDl3Ppz6b38n0Z/j+qHTEOUc93/yAYRT1kmxCTGUC7YyhAhR1ctGK6qzoz51eBqSlN4tfT0CO7BcRD2dqwLzh92B7URNFN0Wy6TKlXEItawU2CYrnFKnfpYGOlcP+nIumJ038ccgRSvcAxQmppE1w+354VV/OIH4KfRnonXNDug0d0ERh3kzcaTzt0ytNnXfZUaBJG X-Forefront-PRVS: 07880C4932 X-Microsoft-Exchange-Diagnostics: 1;DM5PR02MB2682;23:GfOo3Dc27faj+UfsaSV9lwoZwhfhE+BOwrbAoF4lzo49HY6LJK14IePUNYNFS/evhFJtxbCSWz7foLsC8O0M4jQYKFiu72mZG5ENbakkON9nE2qOxoO9q+b7JuTDnvxklWfWn0kgVoGJ5TKRuUjCOJtAEmkcznJJ4yKGQIlTSNZGboFq4i+3kuwc2iH6jL7Fpy9Tajh/Zb+XTsBXexZ2Q1vKxxAINfM8m6Y41yCu7Tk493+fJqwfK5h8e2NAGj7xWIkun31raiC2KlPlbIZQD6AhyINLe9+5W9CGFlUcBrg+wuOIsyn+NHslFLISRIJ+3ZKHI02oNFCek1ff+3bLU8oetlr7m4viP2NVq7sV4nLf75ojkufz65/nZmF/MYsYc+uX9y/4+T4V1ioypieQ7Ui8XLdrS/4dAUjaznw3Rj3bTnZzblliU80L22zXRMA+rzy2h22+873z0RssE9JbMZaBgfFAphC9mvYdrhOz8qZGx62U2QzXuEGrN5xfQNXYbFVD8VOBjYUlh8h0ct8mnlykkTto4Q07Uu2RH94RrKysV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Y1DnyH1CNyAdepaFfFuajLRUbu6BseiCPdcxcgJAUr1tTs0yvWrk4tH+39GRoqo5Fbyy14jEmpTUYyhbJUZoqJFBzv2/vme+r9Y81NHYgIrSooqTmeifvUl1LcHZ9B35fkk0oaX5I1KDLEamrcyAARpwcRXIsRE55C3oDOrDnProcnrZPNH23+ZOiLrXi779GELJdXe9OdAVs59eUCUL4MFyV33fz30nSBpX1PDM0CKJv40AO4AjkFooDlWb8QevE8ZXbzD0FyhUgv82fCa58hTOph94Y+v6AiLTX+aiALLNRG/ZAvfpV0D0Md60Yx82FtyPMmDaY8EZKdaHlZHs+gI92OYPWKloGtATn/IzyJQVU4LOXy6fDx+elZnqODLeSMuTdxC9a6bG0ePU6K/Q09CL/gt1XuiAkl27R3QbDzDcgsVgIs1xd2ZSaS/V3ZvYclRl26/Mb+xcJjJRw==;5:T6aCz5yyy6BL/fyO3RwBJyDUprZmbte8nplRkAVzpvcODqDmLBecU5dZrqiHxpOzjthvq8dC7esFC+Lfl98nloqMhQuRPrMldzT/5j7V0qmQN0x41C+8PQuUsby5zof8dUkXNXxW1hAXYjfPmc78bA2VdP7wWqix2xoqUjKDmpY=;7:ZeH8KCiGQP/lEwwShcZb4pUhDd9J+xQNub/RkunHupgOIOkUfd+UVsCxSsKZ0DLUK3aBSpnPFH90fFXl9H5sHAhylsIyoJImrVkZYeBMmXizifkR6O23YJXSbL1Oq8q/jiLCsUU01ks8P+G3+Nep3bKUCKMvNSdqHj6K1wfVV43T2QyfF7YKE+AyW4eMhtFQ3cT62r2QoUBNsQ5F12Qs4akD8QM8q7LlHiYtYpSy4o2q4DtbBBuWRVxQF1Voso0I SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2018 13:14:20.5256 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b4d6a228-c952-4b09-3c34-08d614c3d2d8 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: DM5PR02MB2682 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 Reviewed-by: Thinh Nguyen --- Changes in v3: 1. None 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 e9901cc..e1d4b73 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 Sep 7 13:13: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: 10592191 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 D84F45A4 for ; Fri, 7 Sep 2018 13:14:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C999C2A93A for ; Fri, 7 Sep 2018 13:14:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BDCED2B1AE; Fri, 7 Sep 2018 13:14:55 +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 4B3782A93A for ; Fri, 7 Sep 2018 13:14:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729414AbeIGRzg (ORCPT ); Fri, 7 Sep 2018 13:55:36 -0400 Received: from mail-sn1nam02on0075.outbound.protection.outlook.com ([104.47.36.75]:24208 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727872AbeIGRzf (ORCPT ); Fri, 7 Sep 2018 13:55:35 -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=rU5EDjVjI/Vujq1G6zcObL6PV8DHkUwAO8rxO6V+a58=; b=VSV0QomjvXSBDc/QZ9BEq2QMPvBSbfNmnRSkDTR0qlsgFjiSHMwB0x+VF/dt4pXi/YmOgpsmYN1Pp9j5AtQf/Mi8JfkA1W6gU1gl2pNwPZYn7ie4pzPlpw2B9dche3xkdRJgg1MKXSxFBTfVwlMhLv1xb3rJ63zFOyVn6WUAuJc= Received: from BL0PR02CA0037.namprd02.prod.outlook.com (2603:10b6:207:3d::14) by BL0PR02MB4929.namprd02.prod.outlook.com (2603:10b6:208:53::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.13; Fri, 7 Sep 2018 13:14:20 +0000 Received: from CY1NAM02FT008.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::203) by BL0PR02CA0037.outlook.office365.com (2603:10b6:207:3d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1122.16 via Frontend Transport; Fri, 7 Sep 2018 13:14:20 +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 CY1NAM02FT008.mail.protection.outlook.com (10.152.75.59) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1122.15 via Frontend Transport; Fri, 7 Sep 2018 13:14:19 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:46002 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fyGaZ-0000Wd-8s; Fri, 07 Sep 2018 06:14:19 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fyGaU-0005mb-59; Fri, 07 Sep 2018 06:14:14 -0700 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w87DE8of019605; Fri, 7 Sep 2018 06:14:08 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fyGaO-0005le-1T; Fri, 07 Sep 2018 06:14:08 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id A7CEB604DB; Fri, 7 Sep 2018 18:44:07 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , Anurag Kumar Vulisha Subject: [PATCH v3 8/8] usb: dwc3: Check MISSED ISOC bit only for ISOC endpoints Date: Fri, 7 Sep 2018 18:43:49 +0530 Message-ID: <1536326029-16327-9-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1536326029-16327-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1536326029-16327-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)(346002)(376002)(39860400002)(2980300002)(438002)(199004)(189003)(63266004)(52956003)(36756003)(14444005)(54906003)(8936002)(4326008)(90966002)(26005)(106466001)(42186006)(316002)(478600001)(106002)(305945005)(110136005)(5660300001)(486006)(217873002)(16586007)(476003)(126002)(50466002)(8676002)(103686004)(48376002)(2616005)(76176011)(11346002)(446003)(6666003)(47776003)(336012)(51416003)(2906002)(426003)(36386004)(356003)(81156014)(6266002)(107886003)(50226002)(186003)(81166006)(39060400002)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BL0PR02MB4929;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CY1NAM02FT008;1:MpTIdaLj+2D/xRc1Ad+/+RwbGiXJW23anwNV6C67KSJ/olsDhafSQ6kPGtuQGH50+VdV3pr6BBcYjvPeLPRR74kAqt4ouGIsSD/9MgbyE2H+idT1OT3KlIqOgSav0scE MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 705badfd-0f27-4ba5-913e-08d614c3d270 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BL0PR02MB4929; X-Microsoft-Exchange-Diagnostics: 1;BL0PR02MB4929;3:+Fou3kMX11LSQ3yKm+aEevxAQsk5tNAPA3uLAqD5BSVAsWqFSntGXgUWwPC6k4heE2vFR/LptY12x/HTkDlyBbb3UxHJVJeVPPG3hk6YMX0I4XD0pR99T7OUiqCgQgMCJSPjrWMVGIBpcSerXPzy+8bbY2Rl4tHsvowPMnARLi5XO2NhlFLfKhSs4O0DPp43YxIwMAqmwa25+ZgqbkyJ72FUGrGI6mcUI3UsQ7Uy0PWpz0tYEa2ugpUiKDb767fF+fOvD0owbCInIpRqZtfLyIlDTabHTxpOsPX+8Rtvrjtgjl6vAzk4A2gUF8Z78zf0Bony4Gh2fbaOrnANsG06rRknfKDL7dsrLHxyx1pCXJM=;25:7JgEjnxut60Tul4h2rIwntBFqjD77Y1zQP2Ac46wXiitNM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S6tGvDB4GsGn+NQz0QT3HVg12f2WsD0NjjHtzVXTorUswR 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)(93006095)(93004095)(10201501046)(3002001)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699050);SRVR:BL0PR02MB4929;BCL:0;PCL:0;RULEID:;SRVR:BL0PR02MB4929; X-Microsoft-Exchange-Diagnostics: 1;BL0PR02MB4929;4:Dq6R/k+/n1lx7yYn9C3qSus2RE7sITvpt02Jt7L6GCT7TBKExsHslyUWENAh2cL33WGoE6oZyqWDSfPT4ffELUn98M1xGOGDfcl2zKD6UTYzAcr71wWkRmRklV+04E59jH1PyEMQ8I20euMAiu6mfiQIB7D+vbitxBPs9j+LmYYn17aD2PCwh4PUvDxuH1t0v6PmFneXo9hWqLpQjmQhabWtE8Agb09/Ba/tUUliC8nRC6pPVviiYh0G/MiIg11wWvmfC/7spBllup9dE99QWmKkVd6LPwEYyTx/iBPwZhJs7IZNBEn3EcKeg8ehPD8G X-Forefront-PRVS: 07880C4932 X-Microsoft-Exchange-Diagnostics: 1;BL0PR02MB4929;23:oK5xEqb04YAmfoSUk6rqaNTYlrlH8f78bSullVwFsmjmWOMUwRGksol6OcYhuO/OGyEOfQKfbLbap4adY+sy21vGPlCNhAboQTP309Q+f+aDMkTm9J56nkySKa6/gpYcHcW8Y+hBCIjBNCUvpO8BlY8Oq+xkI/vg0JcfEg4o28Ok/3pYxoP8eLPlLs9PK4/XpXJjmU+Ot7to9KPv47P0rxQRcaZydHyfUanKumM/s0ZPpHWg+OqMgcczVPBFPAsVhIWVO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4RWINmoDcbmu8cjDfv0PYs9a0nu7nnvyepe/8Kt8kyOQaJSlJY7fEoMoH51lRHQvPpyfT9ibyQcQrJP2zWQOVEGXJtxrKHSlDAKIYeGta9HjahVsLJMoelapKCLCDKKddqTwYRBO53f1wxC11QVvWkXmSvc6Hicw SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2018 13:14:19.7524 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 705badfd-0f27-4ba5-913e-08d614c3d270 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: BL0PR02MB4929 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 Reviewed-by: Thinh Nguyen --- Changes in v3: 1. None 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 e1d4b73..a4ead33 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))