Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp708956imm; Fri, 17 Aug 2018 05:28:26 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzSsl86C3+tkEaUCMzq2Jq8L3GiEbHFTBNOgB8lQV+hTLQT+569TPmFiBATtAsVA38G7o1Y X-Received: by 2002:a62:1815:: with SMTP id 21-v6mr36497806pfy.227.1534508906434; Fri, 17 Aug 2018 05:28:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534508906; cv=none; d=google.com; s=arc-20160816; b=YjmdywtBDqynG86+gs/03Dvr5A3Y57Dyc/GlxUo7bB52pLaX6aBhkva6S5NiLKOYfp B4LcjibeMpxnV//o5UPlWXmjBQ+fz1OGvfBibiL0OGmBhtt5QPzR6p65omf0mk4ORLK3 upjtCoJ9GeHMzOLqW8mB10NVaTv3ESNIuX7BebWNvsRQRtqMGQeFNWsjumzw4xssK7MV SUDG8NDBOa2vj1Y/ashmg31kJIlOG9oEip9DG2uuX00cFmLFgHBRHzpTiOPdpL09eCHC UPnyL2NXegcq+tstLrvL7LUrDR8Dk8TlyB4wLbjXg+CwOCeOlp+iKvnTeB19yf7iUO7q SoOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=BDENqAbDNVofKmdyJzDafRqsk2UMvDhBNU8Dvr76AUY=; b=X6/Bor65KguQ2/Zd1sShz7ljMqatfAdxdrRHDAvkD+lJBNOZ7BgcJF+/3+xrc136Pg VIiGU86G3hXDuIvohxxMPPb6/5q5frxRizdsyKtS1RRsZkz/TfwJAwQpY5w1HwhILq+F JRAwnpoQyVjm6WdyhglBwG3XifABy2NJUZO6wgrAOVvDnHfjoL9n0VypEaKqrsSOJ5bV R9j2sNDI0sV8kDnM5eLOIZJkcxrboVEoIgv5nQWWN/iNHM9acl84ZHPrYAPOMMMbq90t 2UcX2/lnnxkXh9cBiY5vsyoK1qTrYF1YZshlcFnc3H5JB2P625rWeR1EAAWL68gdxicd r8Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-com header.b=wTMD0LyT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3-v6si2074503pld.501.2018.08.17.05.28.11; Fri, 17 Aug 2018 05:28:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-com header.b=wTMD0LyT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727613AbeHQP3M (ORCPT + 99 others); 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 Content-Type: text/plain 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/pnzfUCzmcfF1pgeLHCnBiNnC35NGzEJXHfG5Swr9HBCb/iZEM3HySOyMzq9T3lmtQfUtzNtkxkove96AcFvAkcBpOTuYbRgBU5Gz68Ic/+fvcn4Aj/CCU45DBQ58Lin5owzn2WOw/ndG5giFW7HqraxYnl589kSdqI2hK9LoBLk5XQcZVzKPSGXBMwu8QpoPm1PM/TPKcWjxrdw7hUZDMd6HESiwuz/w/jykcqaY7s+YOjmuftzIpSl4yyGoXxGV7GcwGT38L39Prk3YenCXul2nLvV+yd57NX8wBs4Zo7bnqYmkYlrIXCkC3tfzDIgSRHtitBb+I//jYAnVp0=;25:0iNEmLOGvjnSWYzlaclHrjMQXyBtd+MEfaQxbyZX8KkUYUEKoEp9eST4Nbdz0wEsTNVdqC4Xjr+WTs2j46JpSWDOyl4lfrCsPEhgtQlctUAQp9L3iZTBSheI2U1PXBl//JOiciRmraYExJ7viW+yQGxVzHm/BiYUSxFnz4sTivk30RBDa+WA0+cQFtxWP7fIPMGZ92yd09cQxqsfDl/jXF38Z0J7H3xcXALxagnc2aSQXc5obKm/2mWfqRY/ucpizeOzjsMmc+H9x3QYpAYJzATQIX+6+Pi/PVBkrINxRcPp4UjK4ncB38bGF8GKI5qL19Ug6U0eSsJHecRdrYUbdQ== X-MS-TrafficTypeDiagnostic: BYAPR02MB4328: X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4328;31:KTWpnQ36ZOrySZvab7zaWrz7zso4SZWUdBadxUBModPU0WMogikRPT8wdMrYK7sT9bnCqEMg/aX8DEex3/TTa7VGpg0/63iy+pt9IWr0IPNpdaV+fb3ErgURsCt+9sfwrJ+Le0ev9gNZANmtbNWA3lGM6yQTxZ0+huCrP/oeqCjAtdZLz99E51IkBBW/uas145WgxxEPfsHaKD57dQSjTkQwjxlZBAWWSO2aE9sTJV4=;20:6nJGQ/SnOtAkSOIPontzNSnKuG+zMk617hzoEQNmsGQd/taTaM6lGCua80oF8j0uFFFMfnNf8e5OciRG3cBZOFGaYKVmfLfPRK0bcjRfjbvAOeQGW01Y2ROmyyd1wEUY2GUBwoa4vKgUVoe16S51wp2xTwPsWAZLzm7QLYVJe0IUYS7Qvvd0j4cVDDCjx17vihdXXrwUgTr1PMoPr8Dehrb9HIazmjNzsGSPUz+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/wVYSgAuGvMcDg5rTSV7znQ36kjct06CrhSVGQ5t8ofWiQCQkE2Qg8HOQhSQB9v5QxRsczBufkt1OcP7v1D8hGOoBus2dYym2ntEYetht5xUS+lQdEZv8pvoIz4UVyyCubO X-Forefront-PRVS: 076777155F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BYAPR02MB4328;23:lDon+Em+BF9wendBrtSB3FT9YKmC8iEZplwkWc/ug?= =?us-ascii?Q?/GBdyfrKnPhKI6fXyDsCPvuxkidHnoMb5fmFBbtkGbo0Mreu1M+1UMRX69s1?= =?us-ascii?Q?L9dz2fp5OsOx79QvulpMcVhGz+0oYObdA7FfQ6BjIXFoYEtQTLuPa+f9JWPl?= =?us-ascii?Q?NexrJBv/3kWkr7jjE3kyrOiktHZrPCVAjPmURCohZmOEdQI5gBuaqv9l139T?= =?us-ascii?Q?rg9QR7Xj2jVG9iy/aQMUmc6owrlpCXJVWqQbS53GODp3BcQmcSeIr0EvG9wW?= =?us-ascii?Q?5m1MBPdXqjpLPuqkXy7qCMxDqf4qId+RaqXn05sU7B/BBl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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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.1.1