Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4797229imu; Sat, 1 Dec 2018 03:16:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/UIMLykPDuXjgb7IuVJlGc19LqiPtgjNAU1fHOZO7ZcA4bbI70Xu1V1U2+MlpRwhfa1jF7x X-Received: by 2002:a63:4745:: with SMTP id w5mr7760064pgk.377.1543662976559; Sat, 01 Dec 2018 03:16:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543662976; cv=none; d=google.com; s=arc-20160816; b=kwRKcKj9FcvQXht/s2eOrpFVBWUN8GW/P4XRyDiXdZvkOTo+Pq5BnhQKu36mDJPsD4 J6i+LYs8IiwlPjxDwvobOSYxuMWUY9FnHzaA19eph04gg3RnbkwPHQQ9BRFHk6vuIhMJ 62nHLKG6dewKZEkrKYG7mgI8Hob33yTp3VZffmBU+M4sQ5OAIlbtm3vDOtV+nuMQCemh b2ODoDNoPN9sl1QLcYWdjMdIVXpjygngTr1dV5fqLhma1nTNSCV/hC9sCjR+YVR8/Ar0 6LmbH5qMQBUKYGlfwIoCEc0YUausbH0ktfQdfbo7x0nc1DOXNOgBU793PYOOLNIOe8fj iC9Q== 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; bh=PAZZpPBI2xYJtIm+BYQ4xb3vKCMWGQ/krb84ZoSfsDE=; b=J95XGiRjEVjMgRbtqZtDBM47C1HcrDXHQfDLghZwkmB+O3rt4Qp7cUEZ5VKmU8cTq3 UYWqoQwvFNn6lPu23rVPVUULwL3isbx6k8jjlqeRz3956J29bXe705Lq+A0VOEb0q+ir KS5cMT1uqk4DI+kFBfst4M1sUNvWyLCWEHnDL7/f38mSbFhFQpvsltQggafdwvsAT3M7 WlwkvUkiwZ25WAW/Pf3paM4HIUMjJ7uufxwxF8RvyLp1rLzYNgadyWwWl7j+K9rtzia3 PBxzcOESebMxbPE5KLz55YSO7hAcEuUsN5UN0JUag+chzBXCU6m6atpmHIn/Mq4mJj6M 9SYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-com header.b=RFCEFmq3; 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 c6si7906725plr.414.2018.12.01.03.16.01; Sat, 01 Dec 2018 03:16:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-com header.b=RFCEFmq3; 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 S1727047AbeLAW1B (ORCPT + 99 others); Sat, 1 Dec 2018 17:27:01 -0500 Received: from mail-eopbgr700084.outbound.protection.outlook.com ([40.107.70.84]:64747 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726684AbeLAW0J (ORCPT ); Sat, 1 Dec 2018 17:26:09 -0500 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=PAZZpPBI2xYJtIm+BYQ4xb3vKCMWGQ/krb84ZoSfsDE=; b=RFCEFmq3cCWbVAg8uWH3ByYFBcaFmWuljRHoQcOU55Yk8+rDPNI5axZTgz3MGx7L0ZbG9U6aBN+odOPSw2mmc30PL2XdE/1lfcaO/lAAbjZEWKLasLGhSqc18L0nPAmPTdVc4agh23nHuGG+GQuR2iWK4q9BMss05hifUGoTaes= Received: from MWHPR0201CA0026.namprd02.prod.outlook.com (2603:10b6:301:74::39) by BL0PR02MB4324.namprd02.prod.outlook.com (2603:10b6:208:40::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1382.21; Sat, 1 Dec 2018 11:13:46 +0000 Received: from CY1NAM02FT043.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::205) by MWHPR0201CA0026.outlook.office365.com (2603:10b6:301:74::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1382.18 via Frontend Transport; Sat, 1 Dec 2018 11:13:45 +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 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.1382.18 via Frontend Transport; Sat, 1 Dec 2018 11:13:44 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:46492 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1gT3DU-0005oG-8u; Sat, 01 Dec 2018 03:13:44 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1gT3DP-0001kp-46; Sat, 01 Dec 2018 03:13:39 -0800 Received: from xsj-pvapsmtp01 (maildrop.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id wB1BDY02015263; Sat, 1 Dec 2018 03:13:35 -0800 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1gT3DK-0001jr-FK; Sat, 01 Dec 2018 03:13:34 -0800 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 9403C6050D; Sat, 1 Dec 2018 16:43:33 +0530 (IST) From: Anurag Kumar Vulisha To: Felipe Balbi , Greg Kroah-Hartman , Shuah Khan , Alan Stern , Johan Hovold , Jaejoong Kim , Benjamin Herrenschmidt , Roger Quadros , Manu Gautam , , Bart Van Assche , Mike Christie , Matthew Wilcox , Colin Ian King CC: , , , Thinh Nguyen , Tejas Joglekar , Ajay Yugalkishore Pandey , Anurag Kumar Vulisha Subject: [PATCH v7 05/10] usb: dwc3: make controller clear transfer resources after complete Date: Sat, 1 Dec 2018 16:43:26 +0530 Message-ID: <1543662811-5194-6-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1543662811-5194-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1543662811-5194-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)(1496009)(396003)(136003)(346002)(39860400002)(376002)(2980300002)(199004)(189003)(186003)(50226002)(8676002)(81156014)(106466001)(8936002)(81166006)(575784001)(110136005)(54906003)(336012)(5660300001)(76176011)(42186006)(316002)(26005)(16586007)(356004)(478600001)(6666004)(305945005)(90966002)(106002)(36386004)(51416003)(63266004)(7416002)(486006)(103686004)(476003)(126002)(2616005)(426003)(11346002)(446003)(2171002)(6266002)(107886003)(39060400002)(4326008)(48376002)(2906002)(50466002)(47776003)(52956003)(36756003)(107986001)(921003)(83996005)(5001870100001)(2101003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:BL0PR02MB4324;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;CY1NAM02FT043;1:i0H1tIxGY0uBe6syQOiP24+s7xP6o/f3Q74NRIkrolYh/p1bZphrL65mD3loaoEuaE+5KRizEvN+fqziqKne3a3HaKP5rDRBYLHbdUAW6kmFbSmbcktVSnVGBTCyOscW MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eb2d18d2-50a4-4c00-b4a6-08d6577e0f8d X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4608076)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060);SRVR:BL0PR02MB4324; X-Microsoft-Exchange-Diagnostics: 1;BL0PR02MB4324;3:bfBoIYcdk+iShPwQnEM77jmCgH6xV1vAdEJfF5OMXg/Yl2i0vfihRVndUNmDF9obCQFJ/ra20SX7p8+wRGy5I3IhPy9vFdKwXBGKktIjNYnn5aXN11iFI5qrl0+82b0FZjBZEj7kYh5rWMnjV9PEW264fYYwFttwaCTpzDrnFLKQb4PmoCzGSS9F8S4sqn5bwybP+x9glR2jvG5q9Tnc2bKKIw/QsjdVjc6zT+4qYRgHPSMBl1Izn2Plfn3rn+mAPt4aHbbRArUmHQvNPPQysHAfA9mMM7ISy7OqkyIH83hX10ygoKUjbHgPeML4dAwdhHqNa5CK5dDeMQpFz2SaUXnmpniDvm05BvJeF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22zQtcS2pxMFl9sqJ0wwM2ua/NC4VNWGP8TlCANYcHp1nxAnyaa5AkE9+CGjfMQbbFAlwROpOvrHoYcBMyxZ32w8LAif5Twp9Zp+OlERJ X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93004095)(3231454)(999002)(944501475)(52105112)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(201708071742011)(7699051)(76991095);SRVR:BL0PR02MB4324;BCL:0;PCL:0;RULEID:;SRVR:BL0PR02MB4324; X-Microsoft-Exchange-Diagnostics: 1;BL0PR02MB4324;4:BCJ1kJ+jnpgXZbfyhICYUUcrFOVaB5Wz80J5szYvZ8ZX9dy2Zqei9h+rouDO3Fy8mYZi8yUIXIqAKcyTSn/x6BWUjuxkLBHtS9aEWqcEOzMNoLJCnNwlCFQ+FbVb7PNDWorzvMvK4wuwIli3ZgWCBihj0ElXL6KbB0Q/4ownCmelwpI8RdzXGKIOC9dWSAErvLMV8gquF7SfVpQNB5FoULuoLpY7B6xUWfbaA+ChtqVhDHCfQIm553dlSwjux8c7kq0P8sTB+gYO0jNbppn/MA== X-Forefront-PRVS: 087396016C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BL0PR02MB4324;23:HH91psHoY3P/as9Szmqc4D16ulh6fBdcZnq2q+EMP?= =?us-ascii?Q?1fLFq20PdfnGq/nXMt/npDAlUVzQDKSGHx29QLQBgd2EAmFL8rvNOUWcihl0?= =?us-ascii?Q?ssKQnuvjwn1PbewwNulBGSzO0SINtBNCWKA96VaPN3O50otuQL9ncfi2NZ+v?= =?us-ascii?Q?f6xGNLHc14WN3Lm2dIcp8R7h6xaZpivDCj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7EfhR4i1hRBDv1V6LhgbfOmSFX3h/EMNan446/t9dbMzP20y0goq6SErQ1XIb7eOmQm6JFG6CQWsbjpQtMqOhKBHTbAUga9D3BgEoWhxeS3JiR7JRkJmcfF/2haeqScLifq+DkVNtQH6nBZky1v8aZM5lJC3ySyTwH77s/U6PYC4823cTUw08MGA4jvgkg==;5:gw4Vha8+CDRu3BO7TlHVuzdI2ghmiqgTypbt/EnCgvYknR7pa6H2JlBgrE0couwkGwllA9KfEpTtViT84VM0E0zr+Ld3Dh1lraX2Io+xg/P79O7fIKtFBOeBa2fTTXhMz4cT6kQspV9wEPxsdiTc7cBVheDRoLqTZj9ZK1Sro64=;7:6VQ3r/mKIoc+2VI3QLkcfcqSh72wwVFSTYq9VwKZyk2H4BLDgYH0w4mcAeThbbeY17e5+J0G4+lFs9/DZc/GkeFEIo48QaB4v9CXarhcyBUgpUYeL2sp8MZgrbRvUU0qGmaJ355g218otj6q9XnB8w== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2018 11:13:44.7475 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eb2d18d2-50a4-4c00-b4a6-08d6577e0f8d 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: BL0PR02MB4324 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 v7: 1. Reverted to dep->stream_capable from dep->endpoint.stream_capable Changes in v6: 1. Used dep->endpoint.stream_capable instead of dep->stream_capable flag Changes in v5: 1. None Changes in v4: 1. None 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 3171c24..3edfc0b 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -579,7 +579,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; } @@ -1005,6 +1006,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); @@ -2276,7 +2286,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; @@ -2487,6 +2497,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; @@ -2505,7 +2520,6 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, if (event->status == DEPEVT_STREAMEVT_FOUND) dwc3_endpoint_stream_event(dwc, event); - case DWC3_DEPEVT_XFERCOMPLETE: case DWC3_DEPEVT_RXTXFIFOEVT: break; } -- 2.1.1