From patchwork Sat Sep 8 15:02:59 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: 10593113 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 7E58314E0 for ; Sat, 8 Sep 2018 15:03:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E9F12A775 for ; Sat, 8 Sep 2018 15:03:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62C9F2A77A; Sat, 8 Sep 2018 15:03:48 +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 C71852A773 for ; Sat, 8 Sep 2018 15:03:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727739AbeIHTtf (ORCPT ); Sat, 8 Sep 2018 15:49:35 -0400 Received: from mail-cys01nam02on0047.outbound.protection.outlook.com ([104.47.37.47]:37011 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727597AbeIHTtd (ORCPT ); Sat, 8 Sep 2018 15:49:33 -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=f8Rmto3np0PwQo6UOw94PVHma2VQgH+8iDl0TvajCQI=; b=DR+fgtwNbLf0UuIkzZ3cYK6FqcAUVO4k7u/LLBVtXwWwh1Wd2BBYniAGlKwy8rrmi48Dd9j7ShmC/mJzOVXbS/adqJnp43MKvKEO1wMgUZyy7axSt4Ou2mY6ptNSTi+G7052sT70yWKXgKv4vqmGDgxWLsiudiy3ci6ibWWZvvE= Received: from BL0PR02CA0028.namprd02.prod.outlook.com (2603:10b6:207:3c::41) by CY4PR02MB2680.namprd02.prod.outlook.com (2603:10b6:903:11a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.18; Sat, 8 Sep 2018 15:03:21 +0000 Received: from BL2NAM02FT022.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::207) by BL0PR02CA0028.outlook.office365.com (2603:10b6:207:3c::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.16 via Frontend Transport; Sat, 8 Sep 2018 15:03:21 +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 BL2NAM02FT022.mail.protection.outlook.com (10.152.77.153) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1122.15 via Frontend Transport; Sat, 8 Sep 2018 15:03:20 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:54059 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fyelc-00020x-6s; Sat, 08 Sep 2018 08:03:20 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fyelX-0004pQ-3U; Sat, 08 Sep 2018 08:03:15 -0700 Received: from xsj-pvapsmtp01 (mailman.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w88F38Mo027664; Sat, 8 Sep 2018 08:03:08 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fyelP-0004oS-S9; Sat, 08 Sep 2018 08:03:08 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 11B0160498; Sat, 8 Sep 2018 20:33:07 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , Anurag Kumar Vulisha Subject: [PATCH v4 1/8] usb: dwc3: Correct the logic for checking TRB full in __dwc3_prepare_one_trb() Date: Sat, 8 Sep 2018 20:32:59 +0530 Message-ID: <1536418986-16609-2-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1536418986-16609-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1536418986-16609-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)(39860400002)(346002)(396003)(136003)(376002)(2980300002)(438002)(189003)(199004)(48376002)(106466001)(8676002)(5660300001)(90966002)(356003)(50466002)(36386004)(42186006)(15760500003)(8936002)(63266004)(305945005)(54906003)(110136005)(50226002)(316002)(486006)(336012)(106002)(103686004)(11346002)(446003)(126002)(52956003)(4326008)(107886003)(6666003)(478600001)(81156014)(16586007)(47776003)(39060400002)(476003)(426003)(51416003)(2616005)(81166006)(76176011)(6266002)(36756003)(26005)(186003)(2906002)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR02MB2680;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BL2NAM02FT022;1:H63LRSFLtBg4TLluou2Nek/YD6upG//T23sAYLrusoFyOV7Y/9sBbLTpY2bzoL173a67D3X7BW4tuMgnHrnPtTg92cGMeeHRVQysR6fIRZdKkndr31ufwGRI7v7pk5bm MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 29e66b46-d16c-4a91-ff25-08d6159c378a X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:CY4PR02MB2680; X-Microsoft-Exchange-Diagnostics: 1;CY4PR02MB2680;3:HI/QOzOta2iFTuO33wA/EpTzJOpdCagfTfC8hgimw77EAM1i/4C1F7dLIz2a7ZcyX2+efnRYao7JyxXAs6BGeIkimk9fZu+GSvrju0A6vPGNmK3w8fj6JG98UYGN3nmOG5i0xzV5Qr0sey2BjIK0JRyZxRu9+aK7Xu8Q47Svc0V2GJxuyXTHLuifYcYNi7HqG6+v+Z7qWpzgXeTyegc/UGkvJW+V4aAG8H/YWHMaRwATTaLyvFLiznP7n6+7LSTFoUo0fuyaVf6JbfiFS9crpqfIlYNtrBHD0KyuNycyUnnbckPcDeJIvfPYew7dqgD81TDMDjR5WetIYAb8m5CKSpiC0Thdn2ap8/eUdTkGopI=;25:qwVVOgeJC0ldDRIFsmsqsu3CuFCmKynA/rnbX+GYANSEYq9v8d4Ti5XZSEhlOSgXGIZwgT19wT6cY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W X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93004095)(3231311)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699050);SRVR:CY4PR02MB2680;BCL:0;PCL:0;RULEID:;SRVR:CY4PR02MB2680; X-Microsoft-Exchange-Diagnostics: 1;CY4PR02MB2680;4:J2DzR0YC8vv3Yg59dN3zjXc8kl+RLBS1yL2wk44k0utrBfBH73rFJdj2aEiSQKR/OO9y3JT0qIucD/GtNxfI252/i7CEXcz1j1ZUFp5igm5Hj7zpJEn0HeoEJfTjl2U3JgtGu/sb9wkM9EWNHjuRVPvpuTkfj6aVN99bPL6BvslA/n6E1Aiv5Suq6QBNTDV6EjU1PK321/d1ffyW+wi/pq5DT1IrrrpDm5lbK8lwtwkqiytXV17JCvz4WaTcjJVLMjXntcAzrxJsJDDI4/VK5ZaBOr0gA5PoCci3dITYoAGrATPf2JyGZlCqtQFSwz0G X-Forefront-PRVS: 07891BF289 X-Microsoft-Exchange-Diagnostics: 1;CY4PR02MB2680;23:3/ZT2JKxBMCQhUy5Zhl1wS0P0q+Cafh0QEKJxmH46McgF02aJERKL9+9X8ewlevmjUnWBG80vhEOecTj2GcPW64XoHH77gg2wytx20RG3Ti7Slo8jrPhRqVHLRxVr2cXho3a5qLGd4CBn/EIdOLEugUbXHtdj7t/+mgQR2osT6b+ugGt8o13Vb96reJgiaNMOyfY+Bmok/njk4Bmg3WvkHW3i7VF/FdmCZ7NmzJvix7Xzb6hccN+as4lpyMNDZwles6sXGzjno9Ns1PMqFsgksSioioGsHDSXxET6D/0arZ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WSPgbuyWhNs7fxfdRm0yiLM4+iMQxra81a12ZSooxOolFsaubHhrTF+XAnDs8e0I2yOx7igyKz4vhaFUqvU169C96ioKhVNYZAevRIOaE7zngrqmicFah SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2018 15:03:20.7932 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 29e66b46-d16c-4a91-ff25-08d6159c378a 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: CY4PR02MB2680 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 is calculated using dwc3_calc_trbs_left(), which determines total available TRB's based on the HWO bit set in a TRB. In the present code, __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 yet have the HWO bit set before calling dwc3_calc_trbs_left(), there are chances that dwc3_calc_trbs_left() wrongly calculates this present working TRB as free(since the HWO bit is not yet set) and returns the total available TRBs as greater than zero (including the present working TRB). This could be a problem. This patch corrects the above mentioned problem in __dwc3_prepare_one_trb() by increementing the dep->trb_enqueue at the last (after preparing the TRB) instead of increementing at the start and setting the IOC bit only if the total available TRBs returned by dwc3_calc_trbs_left() is 1 . Since we are increementing the dep->trb_enqueue at the last, the present working TRB is also considered as available by dwc3_calc_trbs_left() and non zero value is returned . So, according to the modified logic, when the total available TRBs is equal to 1 that means the total available TRBs in the pool are 0. Signed-off-by: Anurag Kumar Vulisha Reviewed-by: Thinh Nguyen --- Changes in v4: 1. Corrected the commit message as suggested 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 Sat Sep 8 15:03:00 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: 10593109 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 37B2A14E0 for ; Sat, 8 Sep 2018 15:03:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 293442A773 for ; Sat, 8 Sep 2018 15:03:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D6542A776; Sat, 8 Sep 2018 15:03:33 +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 9FB542A773 for ; Sat, 8 Sep 2018 15:03:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727711AbeIHTtc (ORCPT ); Sat, 8 Sep 2018 15:49:32 -0400 Received: from mail-eopbgr720079.outbound.protection.outlook.com ([40.107.72.79]:26506 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727607AbeIHTta (ORCPT ); Sat, 8 Sep 2018 15:49:30 -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=qyLkM6QbB2yzCrofehve3bPwdyPV0eE/SOxTK9QWomY=; b=NtpqAjAzQpguD0dGFpIsZb9P2tvTxmrMBxTsTJopbkzUUKPGLEkz9pg4o4lMdHKpwJ561/WeNthrtZJ1Iz0hn5wA/8MhAtvybnommC44vMn88mFc25MZJVuMR1g1nzSnhdoN5TPCvf4KI3m01EcjpwcM9FBIqEiVXrxJ9kWA7g0= Received: from SN4PR0201CA0058.namprd02.prod.outlook.com (2603:10b6:803:20::20) by BYAPR02MB4936.namprd02.prod.outlook.com (2603:10b6:a03:47::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.15; Sat, 8 Sep 2018 15:03:22 +0000 Received: from CY1NAM02FT050.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::201) by SN4PR0201CA0058.outlook.office365.com (2603:10b6:803:20::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; Sat, 8 Sep 2018 15:03: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 CY1NAM02FT050.mail.protection.outlook.com (10.152.75.65) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1122.15 via Frontend Transport; Sat, 8 Sep 2018 15:03:21 +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 1fyeld-0002cj-0j; Sat, 08 Sep 2018 08:03:21 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fyelX-0004pQ-TS; Sat, 08 Sep 2018 08:03:15 -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 w88F38Gx031600; Sat, 8 Sep 2018 08:03:08 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fyelQ-0004oT-2c; Sat, 08 Sep 2018 08:03:08 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 43BD6604B8; Sat, 8 Sep 2018 20:33:07 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , Anurag Kumar Vulisha Subject: [PATCH v4 2/8] usb: dwc3: update stream id in depcmd Date: Sat, 8 Sep 2018 20:33:00 +0530 Message-ID: <1536418986-16609-3-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1536418986-16609-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1536418986-16609-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)(136003)(39860400002)(396003)(376002)(2980300002)(438002)(189003)(199004)(186003)(11346002)(54906003)(446003)(36386004)(103686004)(4326008)(42186006)(81156014)(39060400002)(16586007)(48376002)(2616005)(476003)(486006)(478600001)(6266002)(126002)(316002)(336012)(8936002)(81166006)(6666003)(26005)(63266004)(47776003)(426003)(5660300001)(110136005)(50226002)(90966002)(305945005)(52956003)(356003)(36756003)(106466001)(14444005)(51416003)(107886003)(15650500001)(106002)(8676002)(50466002)(2906002)(76176011)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR02MB4936;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;CY1NAM02FT050;1:vLv6Y/OHvNT04NTdk95a16QSk3XhjsiaMrfapfctaxVpTSgLGkPyeFKTl0bbszd7Y3r6e3C66REM/dr5QTphA/nOyEhGE8OlsxPBV22inHgtlHw/78FGUNJV/6ZPrmci MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d7942ac6-cb7b-474c-184b-08d6159c3808 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BYAPR02MB4936; X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4936;3:3J65lL6Bsm56sT4CrFLVNGP53uX4xrjHmL29I7hBs92Ost56u03D6aZvfqAI9G1+0qFvnz9v4yYN1VJS7HLI/yX1G79VDVQigh6dkhwmowYyxl1JI80Z3wMWhb2z0o4WXIbLG1X6q/RGjuQXNl94zxtKzDR492hmEBdn8kXoFaA4rNpQ1lttBVQ6K6caPOrTyCo+fMfIvLcnHyNbI0b3jSSWsmJL+iuJZKqz6BmxxAqfhMJPr41lfHSeMFSH9T2n3vDbMG1P5WDc4fDHyb6QFhh0S3NintJdUdQ+tH0ZGex5Xl7hwv6FGKS6BU9DwCKyiJE+vNNKHf1CKzdfujIdyK2lvMLJ2vAQ3kZLChP7bcY=;25:vwSH9KWhTeTBwTOUqBjPEQqsTO7PMwN/uQu1kYE3LCow9FMoU8WeCgulbY3DlZC27ZnkQfEgcaf3oN+3C3vT8/+Ypfk1wvvwdpYzOFWXzdgOk5DVXCzgk3ujBsivE1p+yhlNT6EpFgtNCuB8fVmaIGNtE6MiRDt70B929sDyL/LUCI7WqPYbrjdmKrEZHLUoWKdYH9L6sgaFF3rJJ8qsWP8TImdbYmAmYzUU2aZSYuFSst9cNyxdBLsZa/JflbVHulUShprUqz0zoPc9Y7mR0il+i0dVhP17R4gPRywtAG9t+v/3SzcrgIOnG0Au0fOH5ifdgRwrOJ4gylxrO1Oe6A== X-MS-TrafficTypeDiagnostic: BYAPR02MB4936: X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4936;31:s1vkqU3lFFqIQc+dWgc7Ng0opCJhH7v0Iorp2gwgvA2TMC3cjUxEieTF+9fidLcooERT1XkZcJnXzdNUXOaN/av2gg1aoMFr9Yk81METvFODDgCJOJsEB4rjIr3/Hzk6kXTUJKPavkSx4Bj6+s6wOso6NSUHzquNfAO4UqXjP9Een751VjNt/A189LuB4DAoRXfZbKRck1dhpJqNAqreLNID6CjN8U8a+W8qpq8aN6s=;20:UOt5Y9FGFk+l5GQNSBzrbUjuw4AH5X7W3FBo4JpR/eA/WdMW9oX7dVBIitgodjGw6w0PML4AUybJzUaI5T/4+OzuA8k5+1XckXCLRzIzHNqUUFXN/AsHh7coEwC+uRRPAI443clgkvEFcgKlp1lxqUu9cSQGS0/g464dqE3syvY/ZZWEBppEbzlRFGOJGS8jUX2fvbp2mRotVDHFp+xcikCo/yNVAeUs61IZoILcoNi9dboEyiSrNWolgMQn1NW1kLsW56IS7AhuCaam6yJ1J7BKqm+5QVf3ZpRrMu3Sy74YmVkPPHo/NV5xOgyy91F5Q6wGmlgfGwsSmQUqMTroiAqopTKhnzv9PfYQHALAAiCqJ3x/Qnj5rOglhXCR5UapM1y3C1A197HZqWH0xpAIlOsTYD46UJeQbVoc4ZigOx80hrzTOwdfkUaihyWC8UOuRcb1xhLgkALf0aN9SrzeMx3lqg8pah7bPctC6MpXeqvqoS15l9GHsSMu8l6eL2GT 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)(93006095)(93004095)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201708071742011)(7699050);SRVR:BYAPR02MB4936;BCL:0;PCL:0;RULEID:;SRVR:BYAPR02MB4936; X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4936;4:L57mwtj+KhBLweNgcOHYMHBgFw7rihNEHJgpfqfnrKdlvxzCauEKmkKXh2SLjjvjtT3kArYu61DYf52lP7SpaOS/11JkWylrTnvdVHoEtwAB3A1KkXhdR1XEiQrjD0ZOOU1wTiSKhfub3djmJ9zUIkrG+2QpSQrPWz78JDA+iWJXBCQ+pNGzPVv1CF0PeG5nhPsNO850GrUKyFaMwNv7QcQQGLEkpbGIXV+z1Zvsm6kNjMR1ve08+JmnI7wH2GPFqEHl+V/FChx8AXQpiphGqYLhkdlg2SrFjLW1D9X3wdP9oFe742mMYcsdNT+Tels3 X-Forefront-PRVS: 07891BF289 X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4936;23:8T1NrJnw0eqt9Hsit4uTvOMorOXqszMEfTtieyUx3fH7B+knwt39kob1weRXDGAUKVZeyZDoD0vTA5xJRxrAkv+eNcIShM1r+vQ+fZHUzgZFYD2iJ6KADx7/XMCWKwXqvf3Wu5Y1RlPQX3Sz4VYMKdtTBbqjNmooCIS8GTYgQcaZAnEtyqsVWrld8nOrBgHDF/GKPcCbLFZDOv87qYH4Ae79FLviVywamHR/wHrqeGFRhhxdadLAkHiWyavnx5lE1F1/J6NOvayU2Y0wgo3wDx2nRMb95PudxaSHGdxATiwrcibMRGxzH2KS4D6GaqPlhTK1GLC5BTAcprcXP/hpKDcaii9pQczIngPV0DnLmOTjcxp77aNdbouo2Km49nvwJBR13L+43SkPiR55X/Rw92YwzhI+5GBtFLEeTtx9m0IbTkbQiw2bdzxqGM+QXJ5kojntwfQh4LUokzF8jnikKniEY1GdFKg3YEwCNIXIBMuHwNDmwwtJ2EZQRGWoC0EKzhrJxZAzB6tGCXX+jWpEA4jELdiAhXw6oCyOnfzk0n9AdcLt5V1Au6qi3KrOuX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PR02MB4936;6:MP6KCtlyuPbERC4siSyi1YnqaqObfGgYFasYDJKtZNl4Z8qTe3MHWp3U8QsygTVO8xZ4LJgdPO7DfzWv/666Jl3bqpc3mzgl+TYQ+NZRoHjuOGgnRbRXx8p5gmWWm7lb+44W14Am8FhkOen+HJqOx7KcU5FAFIABZtU3fJxYdV4HSHD+EFGs2XLHlGUz+2R0Xr8Hfv2uJI6X73VIySksy/IjPtDxKXNGPaFhOVueFaOoO34/41uHF8xA2lW5qlVYs4am4TLVKiufy1JbA8ar1SZgwmyYFeiPouXOEW/xwAebNN7QsSejsyxkmxumJugmMe/AYdoEN9GEu3D9Zcl5o14HXRNNzpPjQVKfadFOmJbcrzDdxwoz8mRdSArDUAbpjfRKHRk3k/R5Rz6ATKmmGyqYOasuAmwE3A0/FxkllRNSdSE5HUL3/exkFBhGmSTzjjfo6yvk0OGX0LDm8jYg9g==;5:CVY+uFUcU+zeE0OPTvHoUNxT+V0ILqOm8BMML+Hhd9o3b6mACbQj2dBg5GnHg+055OarUJ2ES36RMcoFE+cbIqxsMsxvawTArMIBUl1qj6QupEqLOIL/DXB2oFyYg2Dj9HD60NH4Kj2R6Z+ZOv6nNpIr9jvk98Jf9zlEwdrca5s=;7:NUqOP5t2kzkwaIRE2zK5/aI4emZhuJ0rakVm2jz+BtWaTLN9N6k5mAsu7iL5qHOK2EFtuBuX2z/SXfFCO3lFAZL7IJVBSLurGMoXzYM3l5DyDLUncZXLFqihshdaFPWQVuFK/2oQz/Alanb3Pcc0NbJfvb0qi75tFyLztHoSmzZWrswG/3+DrTB7zR6Oe7nz5LiuquDjIus9ovV0XN2zGTALOvK5+9tTKCYkHqfEN8rHWWk3dpFwfxWEr8VKqoNI SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2018 15:03:21.4889 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d7942ac6-cb7b-474c-184b-08d6159c3808 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: BYAPR02MB4936 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 v4: 1. None 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 Sat Sep 8 15:03:01 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: 10593119 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 57D296CB for ; Sat, 8 Sep 2018 15:04:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 494082A775 for ; Sat, 8 Sep 2018 15:04:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D2D92A779; Sat, 8 Sep 2018 15:04:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A256B2A775 for ; Sat, 8 Sep 2018 15:04:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727687AbeIHTtc (ORCPT ); Sat, 8 Sep 2018 15:49:32 -0400 Received: from mail-eopbgr710067.outbound.protection.outlook.com ([40.107.71.67]:43835 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727616AbeIHTta (ORCPT ); Sat, 8 Sep 2018 15:49:30 -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=LdXXzuY3CnCbq2sIB0pAtoYcz6Rj3DG5Cr+brd4PlQ8=; b=1hELC5u6Vewi4jWoY1qh1whBhX3iDSpjcKC9Stal3a/IHJgLCQ7E4u62NOcTN0aKxYtH1CS5/YQRVcWbFMDzTzihzpZ+d2nVjf9+PSsaAKPowEFAmPk1DQZXjxCZPjFgZsI3CvgslNuVq2O8j4bqDTEcmBhmpaCESUNcvd0qrDA= Received: from BL0PR02CA0087.namprd02.prod.outlook.com (2603:10b6:208:51::28) by BLUPR02MB503.namprd02.prod.outlook.com (2a01:111:e400:88c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.17; Sat, 8 Sep 2018 15:03:22 +0000 Received: from CY1NAM02FT045.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::200) by BL0PR02CA0087.outlook.office365.com (2603:10b6:208:51::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1122.16 via Frontend Transport; Sat, 8 Sep 2018 15:03:22 +0000 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 CY1NAM02FT045.mail.protection.outlook.com (10.152.75.111) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1122.15 via Frontend Transport; Sat, 8 Sep 2018 15:03:21 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:54122 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fyeld-000210-9F; Sat, 08 Sep 2018 08:03:21 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fyelY-0004pQ-0F; Sat, 08 Sep 2018 08:03:16 -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 w88F388Y027667; Sat, 8 Sep 2018 08:03:08 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fyelQ-0004oU-9Z; Sat, 08 Sep 2018 08:03:08 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 76F0A604BD; Sat, 8 Sep 2018 20:33:07 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , Anurag Kumar Vulisha Subject: [PATCH v4 3/8] usb: dwc3: make controller clear transfer resources after complete Date: Sat, 8 Sep 2018 20:33:01 +0530 Message-ID: <1536418986-16609-4-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1536418986-16609-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1536418986-16609-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)(979002)(396003)(376002)(346002)(39860400002)(136003)(2980300002)(438002)(199004)(189003)(47776003)(54906003)(110136005)(48376002)(8936002)(106002)(50466002)(305945005)(5660300001)(90966002)(50226002)(316002)(6666003)(356003)(36756003)(6266002)(11346002)(2616005)(476003)(486006)(478600001)(446003)(126002)(39060400002)(8676002)(4326008)(63266004)(6346003)(51416003)(2906002)(16586007)(81166006)(81156014)(76176011)(106466001)(42186006)(336012)(36386004)(186003)(426003)(103686004)(52956003)(26005)(107886003)(107986001)(5001870100001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR02MB503;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;CY1NAM02FT045;1:qquKnuKbEy6poPg2E+JsBgmIpAkFI15OURBCfkPHb18jjWEcpbkpcRbm0c0TQ12CGuwvZgZazvjjiCSRFLQWZ0tz3Vyryh031uYMgXCeA0NmdmK/oiJm05pCYYdfrKQ4 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a1626d3c-7599-4d68-80ab-08d6159c3835 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BLUPR02MB503; X-Microsoft-Exchange-Diagnostics: 1;BLUPR02MB503;3:4rXKuyVuAO44CqRJegwQOXGMv7bkFsl1YPFYlVIySISJY5sizG56w494lEeJyt8Hdqgf5UaA+3Z8PtdUpcy5DrWB2SKvVTmyQJCOCBXhBLkwvsC32qgJ+H15ECbxfER7ZuYEv3CEzLaef6i33qguxBU70d6M7uwFmVdM0474Rs7YsbZ9ft3nNogB9WZLGXYPQnrtgCk9+4Zx3CGpr2FgSJwxJLX41syjUnypbv9LokCqSK3uv2RhRQ673692RwDNP9J+lyHBXeGmdU/QRnP7S5LmEYfQ6x5uNIgKsa6SfsOCQ5pqY3p+mwyEvgapQmQgC1s/vJTuqmmnIa/U4UFBiy5cKhHirglKiLKwXaNDxu4=;25:4t7hfph5oK5WbwPoeYb6HiFOFN+62+buFUCMK7AQEWaHc7y4g7hAPhjxoa4CK1rYyhTBJeD4Q/POhlOWIVzy3TcB/6pMqj6hRR8WC6+5G9oH/V3/gPA15YyrzqK47kUXJ75FgAbfBUBC+b3qjhdb92w+6xdHB0pkqAB3+j9Sy7DoqoN9BhVYoo5Vzc10J3VJC3xTpsSOrPLl8CwZkTfsxF9xXrQPW+YQp1JgItLEWmeTqB5G9lPzIprH5xl6Qk4vQJkk8flaMHcOYe92vTKck3x4hJV198BUmHK9sxY9AY8U8s2lQRi/aMl+mO0re6zTjnKZkCl7ELk150ViHeuleg== X-MS-TrafficTypeDiagnostic: BLUPR02MB503: X-Microsoft-Exchange-Diagnostics: 1;BLUPR02MB503;31:Mh4qES1W9SwOcoTXmfgBxvB5asn0dXmzqzJitACU0Vbf//q6NuTFYF371apZqDeq658lsUn8KrY/fZj+n7IQ7BFKU2XclH85WlEDx4Wbwd0KDKZzEzqW0q8SOCQrCZxD/YP1jm9k0WPYmty/BD3qA5J7doTr296hMB/UNi8QPp25ozB40dzAleE46+z9+k7t3iTJC28i+XldTIaroc4rBXR1Ta/WluojylyGK3mmxvA=;20:Jdz7NvC7IYlJ/5W31R7qO7spwK6CTC0NZG9EbAMFCc8t138SU+KA8abwEaUjT4ygyhaoI6pzWf1S2Gpsgk+kjK2gDMBkXoMQNdn+iN+r8TSVxURSDfAdiBluVFl83tUJDDEGd+KoytisrnL5WH+Eba8e1x7HsJwdm1WP5yK17QSOXVRYft0ELVALt+v957IJGemhaCKkuTLw/Uk4QPUCo+dulWKXuhvw3q76tDD+v1ug8MerxL937yXG+c6ekb7Me+vv5nlh+b8i9pOKO0EOi31neFkIN7RBAeEeMmaWr3nL+wO9gEIm1RJnCW6Qq+Fc21tTdEvE3teDsBYJ0KlDMydlPHoBZkpRbTW+SDKrmXkWi744zL7ePz54NISbVcC1uR32NFNKC6wCNqVdgCt5fMGG6Gksrzg+skAz/QWxElnwwJJTDiaom5ETLThg9ttAFJuWfQ3d8BouT8F4MMmasjGAdbg/8gxBLKoL+tnUtnXlGQHsdgxydQjckBbriEiA 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)(3231344)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699050);SRVR:BLUPR02MB503;BCL:0;PCL:0;RULEID:;SRVR:BLUPR02MB503; X-Microsoft-Ex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1;BLUPR02MB503;6:iZgXhsXIGcQ8f4+KgXVJQEdVbuepGqYhMw4TgK7txdX1/hASEoeNmqTGSkttvpLIoWTaqf3IYmRjN9u8171+x72Th4wpAHSZ+kMcxEIP96dxFKcERTwbtRgHfrrweCJRoBppJOWnlcSo9SM+B41uVvHlhOkHYmR7XqqHRxh9kvRKLrj2mwAA5+dHyCt41/znC9tT2pWbtC6k5J3Nf1JRw37tZOdY2YphDhMWbpcX0xeST9uiKajbZE1//fhgyHgvh99cRh+eb8hwmSWoCs33142ZR+PibmSEMo1GfVoKjRTqoqh7T4IeyD+w9AfSMTmPFdiBlsCb6ifFMmYupbmEtese+Us0FTVvKTyUoHHfKWCW5OTK1reL/ERi0o09c2oLuEmBu4SzmdqiA9auJ0r3kZV6FcBY2ayYJwJ78wAv7b8EIKSYDex15I0lEWYeKjxV5YZ/OBDE84WWLHAq4ewSXw==;5:p4ao0DNz/jyxpsw8ANkPU0d0XfcDK579hTL66ZQPHvX1Kox2V4e7dVrSBC2vzSPy304CTRokW4pjsimvTaabixnNmTmwm6cF3zOMDxADBqc68JXtm6qsKZQAba3Vmismm+c4Z6NOrVHv/2sVQL3D6U3nnqfyJONf6lODOsJkW4Q=;7:1CdOd9jixgrkAzeaLJ5olJyreUHrqi1hj/pCDuItjO5Wu1zsfDImD/0QJX2rlHTJ911j+rl/L0dRV+JDmbJIujnp3XGWyZkA389Yd5PD9ivhiDNL0lZL17cEYfcRhy+h5AaFE72gLq517q4rgBMlvDntM7yme2xWI3aXBWundjK+JxMk7j9J1ci0D7cHOIuRaRpLsrtRV1HN2mXzvPb3+5A3mPLpE3PLHsYkU0z53nviNQiLsxLSe+S1/uGA881s SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2018 15:03:21.7396 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a1626d3c-7599-4d68-80ab-08d6159c3835 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: BLUPR02MB503 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 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 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 Sat Sep 8 15:03:02 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: 10593121 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 74ABA1515 for ; Sat, 8 Sep 2018 15:04:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63D932A775 for ; Sat, 8 Sep 2018 15:04:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 586B42A779; Sat, 8 Sep 2018 15:04: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 B7BC92A775 for ; Sat, 8 Sep 2018 15:04:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727670AbeIHTtb (ORCPT ); Sat, 8 Sep 2018 15:49:31 -0400 Received: from mail-eopbgr680040.outbound.protection.outlook.com ([40.107.68.40]:56639 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727599AbeIHTtb (ORCPT ); Sat, 8 Sep 2018 15:49:31 -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=ehUakPjGEzhtb3OROXkCp27oDnLCpIxZ9iciZof64zY=; b=NW3TJeGk4BVCXvzQiqKpsaB3nftkubLOou3Tz73XFTMdPk5PnLs/JvjtDiZ1qvm9MQ1rDNedTagOyZwXugw5guPXl59JPzczqfouP2pcm39C3GBv1Zx6fm54SuCnrXfOKHyOCvWvxj+l+M317eqyBw4YzS4ibNwEsog7kbfki1Y= Received: from BN6PR02CA0105.namprd02.prod.outlook.com (2603:10b6:405:60::46) by DM2PR02MB511.namprd02.prod.outlook.com (2a01:111:e400:2422::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.15; Sat, 8 Sep 2018 15:03:22 +0000 Received: from SN1NAM02FT041.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::204) by BN6PR02CA0105.outlook.office365.com (2603:10b6:405:60::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16 via Frontend Transport; Sat, 8 Sep 2018 15:03:21 +0000 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 SN1NAM02FT041.mail.protection.outlook.com (10.152.72.217) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1122.15 via Frontend Transport; Sat, 8 Sep 2018 15:03:21 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:54098 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fyelc-00020z-PR; Sat, 08 Sep 2018 08:03:20 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fyelX-0004pQ-Lp; Sat, 08 Sep 2018 08:03:15 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp1.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w88F398U031604; Sat, 8 Sep 2018 08:03:09 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fyelQ-0004oW-HS; Sat, 08 Sep 2018 08:03:08 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id B299E604DB; Sat, 8 Sep 2018 20:33:07 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , Anurag Kumar Vulisha Subject: [PATCH v4 4/8] usb: dwc3: implement stream transfer timeout Date: Sat, 8 Sep 2018 20:33:02 +0530 Message-ID: <1536418986-16609-5-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1536418986-16609-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1536418986-16609-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)(438002)(199004)(189003)(8936002)(90966002)(26005)(52956003)(11346002)(486006)(103686004)(336012)(106466001)(426003)(2616005)(2906002)(54906003)(126002)(8676002)(356003)(476003)(186003)(81156014)(81166006)(446003)(63266004)(305945005)(5660300001)(76176011)(50226002)(50466002)(16586007)(106002)(478600001)(47776003)(14444005)(51416003)(36386004)(6666003)(107886003)(6266002)(48376002)(42186006)(6346003)(39060400002)(316002)(110136005)(36756003)(4326008)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR02MB511;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;SN1NAM02FT041;1:V5sLVrmcEMYHNZZcNzcQMJRPrbJc3G1bHkuuQtIFt4txcuIIvnK6/9RQQ3DUTcMzMIOzQtqHsjR3Nex8pV12STcrI0DrP/L+M3/xRt6zB8LlvUZoJLKTXoNLOhp9rS8G MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 121d9736-2438-47f6-74df-08d6159c37da X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM2PR02MB511; X-Microsoft-Exchange-Diagnostics: 1;DM2PR02MB511;3:jpOYIhtQdx56nb+NQhrlsN9J5G9IXJ1/RZoVHTxPbOpOvb9X55HUC0KTDaeWId9ehaEp8jbIp2vNXUNj6J1a5a9+67TUvUAHYSyv/IJzwyUMek/Cy1ma5t8GsTL4E9xwxMdOQvitWM2JI+2RE82C2teLYoTCz5rg6binaKa2mbg+kd/Gf9V+SV7Hs1koJtlL66q4EdCVBT8YbCWjOiOrmoh212/chdIRTODuEcsqbSK41SeinTkiY7LhzygB2KoipbElhpFeL3alJtd1jvJvLlgghZFtwyFzxB4mgYAs51JdIkVSeVJtlonrjKzOZ0ofwNm5agOczpew0XCEkt10jVy7ZZV2LEtjMgelvUrBLFQ=;25:pgOlP7GM3rs5RLnwbyBSibLwNUCpop7BX+y3YKm94OpZucb+Jh2OpaBohOYWeZb6sTPZBkowhkbG3iP3px/T42YeHZxaWu/FOQ+mYLPIo6hqxd5PgQFdGvTmg0KUrJJA5vUzkhSxVOZ2Bpdx+yeIBpxgnsoQ//LnpXcSHFNs+2uvjMURu1X0h5E30hfyMFOlRomtHK+uv+OnYdgyvBBmV170w2TxRDc+7ZU0FtSbDAaAdZNvelKUVYaGdPwvIIrh+ozOyGs/HfkuDwHxpIdlHhTRBdADzCFGwBgr5WQbZw3WLlpwXBYuWdxT3KO2tCdHp01HomWrx8Kxm8TXWbTcjA== X-MS-TrafficTypeDiagnostic: DM2PR02MB511: X-Microsoft-Exchange-Diagnostics: 1;DM2PR02MB511;31:7iATQHBNcn8BnPXROtdMW/A96ysx8eaLPpMasJthJqvXdstaeUBvuYU8YeirpEqzv2tlO7AuDsNfF9+3SOe23dQo4UzLtZ6w4FSUDJjzU3IUFoh+g21hMHP49gbb4eodSVGSIe57FLWE1nrfrsSVDZ4yettFeeA36or/E6jjpuI0Jsg/elSNbMKWXIzsPeGwGzhyyugbAj6nsadvbDUaW6JxXmANnO2KGUc3/Nap+bs=;20:8mN3cOjLAJOXRmx9DRE3MskPnxnaxCCC8tyWEQ8czD6pl4/O/6FIiPH95pQTymjMyslsAvH+NOs/TlQJwmXrNgxjgyom6EK+lBUqgp8MYnZIwQ60xTGFJZS1rPiUmAL+uYSmJyJcl3vYrk0P9E/J69GX2SvyIrrydwLsciHFsOYeplg9FSPU4kU8wnPjdI6R84ql8gKV5D84j7b5ieMW/Kg4NmWwMEQa/k7CFilYYI7b5E3pyakdZ2LDMoTnenFAzoVNgFyJjguEFpLHQGeGVEtZ2vzP06o9R5M+5Fl6pXSOP6is69qTgio7xGwd4d8Og2qLJsgYT/2ORSnSsN1M3J301X9AECXrhYHXkhqsONObPjHgTQ/zDUReTtsoil6Q/3XicXZoA25N2IXLExPEjia2u6lOv0Uss7kgHG50QrGJgShItjV8WRAn+wxWy1LfWsTnUA2ux2q6mdg+GK+1EncDDN+roN5l2XQkACFhXRq/gkO5WeKOvLkN1tV4rUxm 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)(3231344)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699050);SRVR:DM2PR02MB511;BCL:0;PCL:0;RULEID:;SRVR:DM2PR02MB511; X-Microsoft-Exchange-Diagnostics: 1;DM2PR02MB511;4:QQTgXadYlJAGEZNOaHv6k6wZksuEu/k15XYsTE4jAs0mp/5zjJ20n5oViWDrJagPo4RuiXJuFoV0pcmk3HhIQy9HKzRq3b7UGst9sg02mCCvW+KBGJVAq5VAeTcenJ8tZmAHBs0WZ6SsWoi6QNw7b53lR8DS9Ycn/Q9DSBSWdIEI8jMpk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J2D9fIPkLmRoWzlSNcDYMgWXMkVr++UF4EXgRYyZgtD0tpk5s8T1YiXx9WJsMoFQBcxQRzbXx1kYnAUEp3ilTnqg0Ir2aG28pLs+Hzc3LJ5XSq03r1T29zpYXQJMMKoe2ONVzhMDmviyD1LuyH8sX6YG1bKcEO3qO8o/xI1ViSVxfOKtQjXZ74AIfL+cj6IHnuBsw==;5:ah6CLzaMHlkLHgdmLDgmygygGAy5dyia5C7gvdLMg5gakvIsySDPnGYmif0eIWZnr/18AEturI0G8wHzbhEslFfJEYw99xiH50njvlD7b6VsL0MmCIp++fDuktlR9aPMj0VDl/DdZ/tKWmbPYZ4YYaZdAT6p5yQqNuYETlzTsZA=;7:+OgYiC8y647UeGhnwM09CqRJI/YyvkddzSniTbKN3nNgu93LlWmrXCNB4n9CA6dchwAihi4uAtKRosNEklyvadAP6kRRofFstdezx+I3mmrAy2aWRjxp11RNcTGDN7Y8VrHWjqEMuw7g844Voeb82647Qj90WyrrlJO37NLPBymD2H53kq4waP1bFDRffMAPp3Yrhmq5px8Cux2jDefCWeVFMOys4mh/c4xnDnMEMPv7pXxJ9UIqTyaSvyFsizDk SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2018 15:03:21.1586 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 121d9736-2438-47f6-74df-08d6159c37da 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: DM2PR02MB511 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 --- Chnages in v4: 1. Added description for stream timeout timer as suggested 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 | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 5bfb625..f62e8c4 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: timeout timer used by bulk streams */ 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..306d4c5 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,17 @@ 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; + + /* + * When BULK streams are enabled 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. + */ + timer_setup(&dep->stream_timeout_timer, + stream_timeout_function, 0); } if (!usb_endpoint_xfer_control(desc)) @@ -730,6 +742,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 +1272,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 +2424,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 +2515,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 +2621,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 Sat Sep 8 15:03:03 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: 10593111 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 35F116CB for ; Sat, 8 Sep 2018 15:03:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 265282A773 for ; Sat, 8 Sep 2018 15:03:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A3372A775; Sat, 8 Sep 2018 15:03:34 +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 DA73E2A774 for ; Sat, 8 Sep 2018 15:03:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727758AbeIHTtf (ORCPT ); Sat, 8 Sep 2018 15:49:35 -0400 Received: from mail-co1nam03on0040.outbound.protection.outlook.com ([104.47.40.40]:39808 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727256AbeIHTtd (ORCPT ); Sat, 8 Sep 2018 15:49:33 -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=4GNFl4f/J54zigfvF25AREp02RymxyPuWz6cNSjukBk=; b=3T0NI1N/zlE5JHXUTjmI/Z7TyQzXO8GEQFt8NPtCTH/MfsIKQ1oKObFGaDwaD3ZeS6UfimVCyw5oDoPPAvU5lEKlGfpqX/aYqAEZ2fX88mzyi/bd1NhfVc/TPLArCd/RggrhJmZjAswold/bRRk+W5yRQT8N7o4AAJnPDwlKS/4= Received: from CY4PR02CA0044.namprd02.prod.outlook.com (2603:10b6:903:117::30) by SN6PR02MB4941.namprd02.prod.outlook.com (2603:10b6:805:99::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.16; Sat, 8 Sep 2018 15:03:21 +0000 Received: from CY1NAM02FT044.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::204) by CY4PR02CA0044.outlook.office365.com (2603:10b6:903:117::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1122.15 via Frontend Transport; Sat, 8 Sep 2018 15:03:21 +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 CY1NAM02FT044.mail.protection.outlook.com (10.152.75.137) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1122.15 via Frontend Transport; Sat, 8 Sep 2018 15:03:20 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:54063 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fyelc-00020y-8N; Sat, 08 Sep 2018 08:03:20 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fyelX-0004pQ-51; Sat, 08 Sep 2018 08:03:15 -0700 Received: from xsj-pvapsmtp01 (mailhost.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w88F39V5031606; Sat, 8 Sep 2018 08:03:09 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fyelQ-0004oc-VF; Sat, 08 Sep 2018 08:03:09 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id DC313604FC; Sat, 8 Sep 2018 20:33:07 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , Anurag Kumar Vulisha Subject: [PATCH v4 5/8] usb: dwc3: don't issue no-op trb for stream capable endpoints Date: Sat, 8 Sep 2018 20:33:03 +0530 Message-ID: <1536418986-16609-6-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1536418986-16609-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1536418986-16609-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)(346002)(396003)(39860400002)(2980300002)(438002)(189003)(199004)(3923003)(36756003)(81156014)(36386004)(50466002)(48376002)(51416003)(76176011)(47776003)(186003)(81166006)(8676002)(478600001)(90966002)(103686004)(26005)(107886003)(14444005)(6266002)(356003)(305945005)(446003)(5660300001)(106002)(106466001)(126002)(2616005)(476003)(42186006)(110136005)(50226002)(486006)(4326008)(336012)(8936002)(426003)(52956003)(54906003)(6666003)(16586007)(316002)(2906002)(39060400002)(11346002)(63266004)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR02MB4941;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;CY1NAM02FT044;1:qn3ctWCnS8IOTefKpSV+g5BTQ8QSvkbMVUiuWbWgg2SVEyoi4t4HBUle8LQ3YbYZeIj7awX95Uzck9t2EqVb+7qpd1xoovb83TLk1o334Emenf78Aa3U49NYN5ZqXNH2 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2503673a-c8a3-4a95-b1ef-08d6159c379f X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:SN6PR02MB4941; X-Microsoft-Exchange-Diagnostics: 1;SN6PR02MB4941;3:duBMeVC9luF/yACY9QYmM5kimzSF5r34igyf9Uflgx7jOQq7HWBwfp8/THp+T+8z8gH/mnqKCdOd87WnbI7OpRik3q6CdLaR7C9yXO3nBcTCspytOLBwSFAkTUNile5nv6XJTXmutS1vUMHhYCMfQ3magpghopD+lBx7XXPIyM8dZQ9pPlfoWDEvR3GPrbFYOwoS2vLw0DSn6WyAqwvYkV6wOuBU4YNwqa7GRCcLV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BdmMjzCN5+ABsPIYjctd7PIpfiSd/JkX1oZe0gItsAkSsfsnYge6KZWS8MELFF+GQr/QmhxR3SyQnYfcyQAEztaN2SpknY4T3e1+mgWLK5a2wASwzKStswqM+lTgDFzt89fTuTo8Sj5g9u9pf6NzUxZzlQF2iwJB/fBY6WFp/i0XT5oHMhuTq+xp4Douqg1DrMVOk+BxuOhPZdRZug2h 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)(3231311)(944501410)(52105095)(3002001)(93006095)(93004095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699050);SRVR:SN6PR02MB4941;BCL:0;PCL:0;RULEID:;SRVR:SN6PR02MB4941; X-Microsoft-Exchange-Diagnostics: 1;SN6PR02MB4941;4:1xEU9a+xFSc8jJMsPHjRcnzmc+fpZR7JVAoaGpxwOCkvPx4tawSgP3u5qlAYArGcTJ1IPPJdNFPAxqCu6Ehs2w5IQJuszdo0PmYCFKkf5f20ZE0Se9Jhz5BGVyEN9q8ZBsxnhJRM+rRJMHI5MvTxEjXYy28HxoUjSAu2gaM8u51E3YZU9kq4i3U7CnMftgDaFAb5qr9q7eb9gNN+7CnuAK8+PXG8COUtukYNmC+a8tnVCp0m+ak+9GGbROmgrdzDun2FKQpIvvM04YXkG0qDLb3kGYIKmwdG2oP6meI/CG6P7drUnFdxU5AnjYOkbyBy X-Forefront-PRVS: 07891BF289 X-Microsoft-Exchange-Diagnostics: 1;SN6PR02MB4941;23:tnxeGiQeNviWPbxusIp+JAOf3nVZnOLDCQAjkT9SvsUAQ7962n1ImyQmGpcwdYm6lYgL14K0lxMJLO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vWcLyir8w5GVs5n/Jp4jerMMHoc6Yd8YJoYoloRHtSXzCiba+L3bfvn4N1rMAyNWSNAiZvATzaO4ScjGZ3KlG8ru8=;7:AIO3WWtT/n5qXC1kdKenLV4kkwp4xBxKotevuTZfPIdWSkU4tHnPPA/NFU3Q0PbwRZ14IRQqFYZkQ+H3b3lulcZ4VV9G4pGQik1lDO6cDxcY/jqyJHQy/RIVuqqOh6smMyId6eUnh0tfanObPUaD4uip6vmibU2/Sko2jH+V3R7/srYCAg3Lw1b+Dcsm25BVKl80LTXfjLbGbpxHJBKgGcpYUQ9dD/+HXuneRFJx3BBlDje4GJQ9Z4vCCqr240kY SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2018 15:03:20.8047 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2503673a-c8a3-4a95-b1ef-08d6159c379f 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: SN6PR02MB4941 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 v4: 1. None 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 306d4c5..97bfdf0 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -677,7 +677,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 Sat Sep 8 15:03:04 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: 10593107 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 1DC5214E0 for ; Sat, 8 Sep 2018 15:03:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0116B2A773 for ; Sat, 8 Sep 2018 15:03:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E613A2A775; Sat, 8 Sep 2018 15:03:28 +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 44C412A773 for ; Sat, 8 Sep 2018 15:03:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727623AbeIHTta (ORCPT ); Sat, 8 Sep 2018 15:49:30 -0400 Received: from mail-eopbgr690050.outbound.protection.outlook.com ([40.107.69.50]:32256 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727598AbeIHTta (ORCPT ); Sat, 8 Sep 2018 15:49:30 -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=0O1pAwwtY+ViNBJ5rrNdOEbwp7dfAZ3afMgsGOUvz5c=; b=5NC44j2QORbuC2QxYHdUyqKhenx6/sy0WBe3+T5mAGiwxJ3iRuaVIC9WP+W1b7rps0Pm2M74/BECXL2a9cCe8eNYgKIP6SQ5V90qP+j9j3ghQz2UCGEPYfMS2sEuaO6q28B1iN/hHciwlKFitmY6P88pr5ge4uqpqCWJKqpD0Kc= Received: from BYAPR02CA0061.namprd02.prod.outlook.com (2603:10b6:a03:54::38) by BY2PR02MB506.namprd02.prod.outlook.com (2a01:111:e400:2c39::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Sat, 8 Sep 2018 15:03:22 +0000 Received: from SN1NAM02FT007.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::207) by BYAPR02CA0061.outlook.office365.com (2603:10b6:a03:54::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.15 via Frontend Transport; Sat, 8 Sep 2018 15:03: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 SN1NAM02FT007.mail.protection.outlook.com (10.152.72.88) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1122.15 via Frontend Transport; Sat, 8 Sep 2018 15:03:21 +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 1fyeld-0002ck-2F; Sat, 08 Sep 2018 08:03:21 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fyelX-0004pQ-Uy; Sat, 08 Sep 2018 08:03:16 -0700 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w88F39h7027675; Sat, 8 Sep 2018 08:03:09 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fyelQ-0004od-VD; Sat, 08 Sep 2018 08:03:09 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 0C97D604FD; Sat, 8 Sep 2018 20:33:08 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , Anurag Kumar Vulisha Subject: [PATCH v4 6/8] usb: dwc3: check for requests in started list for stream capable endpoints Date: Sat, 8 Sep 2018 20:33:04 +0530 Message-ID: <1536418986-16609-7-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1536418986-16609-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1536418986-16609-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)(396003)(136003)(39850400004)(346002)(376002)(2980300002)(438002)(199004)(189003)(107886003)(446003)(90966002)(14444005)(8676002)(47776003)(39060400002)(63266004)(6266002)(76176011)(51416003)(426003)(2906002)(486006)(106466001)(126002)(11346002)(2616005)(36756003)(36386004)(476003)(52956003)(305945005)(5660300001)(356003)(103686004)(50466002)(336012)(48376002)(6666003)(106002)(8936002)(81166006)(50226002)(81156014)(26005)(4326008)(54906003)(16586007)(186003)(110136005)(42186006)(316002)(478600001)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR02MB506;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;SN1NAM02FT007;1:9GUnu3Luz5feVH2SqI7sECC7p/4QFlu0sUSnel0/hlgnP1rxoS6gEoA/SZaxFfwzNUbvcs4AcAqWtfERv1rbU12cqY4+vQgJpgH8wVvjEwcORAjKlAlCyVU24B/wKGRd MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5c60efa0-a862-4a43-9074-08d6159c37ef X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BY2PR02MB506; X-Microsoft-Exchange-Diagnostics: 1;BY2PR02MB506;3:PiARWVues8FBRTpSo0EpKhboXEUt8bH7RSyHXyXTUqKHs60gAY3EuWt132jakQr/SD8EOFuyx6YVV/SPH0vsOnxpU78D0hjx/mFhgelmtxCd6jsbSKmvNjzg7gbLMmtrzeBi1rVOElE9rGlUKStI/U9NyPdF5Gs0kKpBw/ZevnKN+CUS3wFGgOquzgU2xvN5G0ci3w9baGGuy97oe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VQtpEfX8ZbaScsywEPneOB7qRwXYNz7lFLUQpLVuGZ53xidImR4no93eGOWFM//PB1SgKyb+fWkp2KPxmWXHtVgMMJT85bdpcvMNkn4CEwtdCS3XCtgi3bHBb4OHr9bW2r7CSfB1cvIex/7NREktgJxD0oLyvwOhmZvFPkfqCTFU79JQnC58PxuLczvZa/JZYG86hBNdg9KKCeBPy2Q++e+4q2RLO+VxJgzuEk19fDwZk6Tb2Q X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93004095)(3231311)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699050);SRVR:BY2PR02MB506;BCL:0;PCL:0;RULEID:;SRVR:BY2PR02MB506; X-Microsoft-Exchange-Diagnostics: 1;BY2PR02MB506;4:5cXIxT0PHNFJSSxCKqYpSaf3/a3MHKtQKn7PHbW7RLOxM20UTH5tbHg5egQ48UfyBe6dws6sOOaz1RG3T8qZ99FqQw1fp59SVT+hCunhDmNYcS7aN39qZLlDnEMPlNfLK5mjEiL5oPb4GuzqLThZ/7DWCAxULiUWhHOfu/L7JZc9w+J6P/z1q5Pt3BXanjI83KUdhO7TNQEWC8kiX7bIhwAQjL75+sqIhOaigk9SpGXKFu6G4D3Lrm6OWr8x2ICx4v4+V0Xibd7yz5obzs/8g+i2zaVZV0xbNbR4gum51QWPHKiurOiXzaY5KiuYMH21 X-Forefront-PRVS: 07891BF289 X-Microsoft-Exchange-Diagnostics: 1;BY2PR02MB506;23:E4LMQEUm082IhIjeb3mGBPXCYRdGkmEnk9noBU5jBNXYQTO5HqkMgf92jCB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ef55Ac4F0cngsgHZkat2POH9Bl0grEkryB1rEJyv9tCVwez022YinimKsa6cEZ284NMRNELI2VXjeGKoVBfUg+7fUcIo=;7:sSSzZkwOwXoAgdQAyCRkaT32IpqpQ5jKlH22tKlpTeHlJL/C9UTM0Mkfw6pcx25GRRfeQhlMOrPdjpn2oGs1q57rJSZiZ/m2x+GFnpscHyUErjNenUr+07zwIkbtHXePRCJvAfnxT4JNQJtkEZg3iv9MF8tP0pR9vvtOEWQpKiTHYFNvtzWvOqPL2sTFHZK3OpZmyYS7z1wn0OkURVnpS3+uaT8+uV34Gh8rRzfg4g4fWbVUG3xsxWfLAGMWrzXY SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2018 15:03:21.4219 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5c60efa0-a862-4a43-9074-08d6159c37ef 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: BY2PR02MB506 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 v4: 1. None 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 97bfdf0..c50cad8 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2433,6 +2433,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 Sat Sep 8 15:03:05 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: 10593117 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 8CE2A6CB for ; Sat, 8 Sep 2018 15:03:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EB4C2A776 for ; Sat, 8 Sep 2018 15:03:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71FEA2A779; Sat, 8 Sep 2018 15:03:56 +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 D4C7D2A775 for ; Sat, 8 Sep 2018 15:03:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727798AbeIHTtx (ORCPT ); Sat, 8 Sep 2018 15:49:53 -0400 Received: from mail-eopbgr730076.outbound.protection.outlook.com ([40.107.73.76]:19045 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727608AbeIHTtf (ORCPT ); Sat, 8 Sep 2018 15:49: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=Qz3na9iWZchYjpyX2mh0Owz4vmHzUIGY5zRph6sdHhY=; b=Ml9BC6eMpYYomC5K16sQnDUKEgkOSnCCML9f8m+4jJfq7pkGgHjyW3S8GwI2JKq5GEtt9gXdndrUk5Bl4DjEUyjX6Ww8pMTfZBlquqfyI2qwuJh/MwvLmRpSBUwKQ3d9+iFIXBxJiu0JNDTTPbMqTda89HjUmHYxrzCtmb5TI+Q= Received: from BYAPR02CA0058.namprd02.prod.outlook.com (2603:10b6:a03:54::35) by DM2PR02MB510.namprd02.prod.outlook.com (2a01:111:e400:2422::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.15; Sat, 8 Sep 2018 15:03:22 +0000 Received: from SN1NAM02FT025.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::204) by BYAPR02CA0058.outlook.office365.com (2603:10b6:a03:54::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.14 via Frontend Transport; Sat, 8 Sep 2018 15:03:21 +0000 Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT025.mail.protection.outlook.com (10.152.72.87) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1122.15 via Frontend Transport; Sat, 8 Sep 2018 15:03:21 +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 1fyelc-0002ch-MF; Sat, 08 Sep 2018 08:03:20 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fyelX-0004pQ-Ij; Sat, 08 Sep 2018 08:03:15 -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 w88F39JW031608; Sat, 8 Sep 2018 08:03:09 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fyelR-0004of-04; Sat, 08 Sep 2018 08:03:09 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 2A75A60493; Sat, 8 Sep 2018 20:33:08 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , Anurag Kumar Vulisha Subject: [PATCH v4 7/8] usb: dwc3: Check for IOC/LST bit in both event->status and TRB->ctrl fields Date: Sat, 8 Sep 2018 20:33:05 +0530 Message-ID: <1536418986-16609-8-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1536418986-16609-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1536418986-16609-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)(396003)(376002)(346002)(136003)(39860400002)(2980300002)(438002)(199004)(189003)(305945005)(336012)(76176011)(106466001)(6346003)(356003)(26005)(2616005)(36756003)(51416003)(50466002)(63266004)(48376002)(478600001)(81156014)(81166006)(36386004)(426003)(6266002)(42186006)(16586007)(11346002)(316002)(103686004)(50226002)(47776003)(52956003)(446003)(110136005)(54906003)(107886003)(106002)(4326008)(476003)(486006)(14444005)(126002)(5660300001)(2906002)(90966002)(39060400002)(8676002)(6666003)(186003)(8936002)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR02MB510;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;SN1NAM02FT025;1:kx0FgZlXOiRzKd4R7BpPbAHZrtiE5qBeSS0iVmQJq4gJfUEFlmSjb5vTqYYIe+lNJhZA3Q5RunSHBoiU6LK3Yv/2D+63HVYkQDa/lfYcvI20XOI395C93GtkBO0H7QcZ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3bc7bee1-06ed-4551-08c9-08d6159c37b7 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM2PR02MB510; X-Microsoft-Exchange-Diagnostics: 1;DM2PR02MB510;3:s+IQst9e8zclytvgaN79ld5JCiuKrAnxuom2VVF98AEqg4CsZCPkIU5rYABv9kTJDOSXmaSkXZ7iFO/kbGYvePX3aDGtylMs6Awn29A6hr5JCvCR77Pgik2rwUpnHue7iGIahrlc6J8oo6vQYrPpZvyiENfoWLuhPQK4/+iuQ+dFv2j8Z2Ka1tX7zIkdso5XWETyEQRXLoGQ6eGBg4lzy2g7adHPPruwDNZnmQdp3GZmmKTGrO+LaLWLgoelW88sfpyzmCaIDRretLxfbTAD7pR2DNIAdb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BDnPWClX1Q7vbs2yf6GC0j4BKzNqy+SoMhsnqwQrbM/iVmk7QQMtIOEqplk70UChrEQ7F1wuh8n+9ynPklHOE3bjo6SK1OWRybcb4rlfyRzYw/v7Pi05Qvw/HoaA9tPqgJ4Uj38twEMQvaKM6WIt6/geVe869p 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)(93006095)(93004095)(3231344)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699050);SRVR:DM2PR02MB510;BCL:0;PCL:0;RULEID:;SRVR:DM2PR02MB510; X-Microsoft-Exchange-Diagnostics: 1;DM2PR02MB510;4:o/M1ofztGQjWK0wLvB1nq8eZad+mxbi589Bh450509LhNE6wrcFWljlUJ0eLx/oIEDt15VJIFbQLfy+Hv2y4sO3aZBxSDeXNVlPafBLp8dgEYFWbn1MepJkYrtTY7RbW4JXHK5obLRx9zgywjG84LgYuVbLyi9QC6Spp6gdDajvxnSXKJ6jZWD+YB3c1QGL3a4NRflrkYy8JPDurApJvKfkGD0u93sNLJqWSppHBOx32c9OHKi7tgvn7QlA5LuuFBx2S/NUJKJ/4opKWfSkXMXo6c19b8KGKdI3v9tJV3F/XJSKlI7OXnfPh5omj7IvQ X-Forefront-PRVS: 07891BF289 X-Microsoft-Exchange-Diagnostics: 1;DM2PR02MB510;23:31p9q8/pPjGG/cDhKm79dP278CsY3ASst15iVPRcUM5JX9Kl9X0qhIR53k2lkX3I0Yk6TbPvInmIaMQwbNI5fEdJHVk4NUiaRdyWiYtRx7VlqLZYu5eYi9jLwbuRupSRUy9gOpWoD7NmA5qp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YyYrRsLeLh9Yh6+/EU+f8JOC0Y1SGT9HVQf6b/o7PB31QxMfD/DO1P+o/0XPQqe/Y7LSUen+/i63quKkGZKvt4tV4rwpClpc71f/XrPp9VJtoAuq0CtNfS0sDrlIH6NyJ/wpo7XNcHGty2Nx/0a2F4k9BLSnObRqx0ls8hgy6k2gmicpGN22SE8/qb4Yn90ir76QXSd2I7kNs6X4dAZs10 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2018 15:03:21.0515 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3bc7bee1-06ed-4551-08c9-08d6159c37b7 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: DM2PR02MB510 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 v4: 1. None 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 c50cad8..6b6bdd2 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2299,7 +2299,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 Sat Sep 8 15:03:06 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: 10593115 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 D14FD14E0 for ; Sat, 8 Sep 2018 15:03:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C06292A775 for ; Sat, 8 Sep 2018 15:03:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B442C2A779; Sat, 8 Sep 2018 15:03:49 +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 4DD2E2A775 for ; Sat, 8 Sep 2018 15:03:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727818AbeIHTtx (ORCPT ); Sat, 8 Sep 2018 15:49:53 -0400 Received: from mail-cys01nam02on0047.outbound.protection.outlook.com ([104.47.37.47]:37011 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727607AbeIHTte (ORCPT ); Sat, 8 Sep 2018 15:49:34 -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=BEtq3yiuelDpEsnrtGaDUFtbl/A2Uu6Tp1oAaerMSSY=; b=fBXmkY8nbE7ylLnk9aU1cNjwIrChEtDUdL1u8a/0LXOJXruD7C92vnGFVabEWmtlA/mBHYjE6cYWlnKc1DnHoDPXhvt4JKmaG0D9nosdOuO38bv33TdR6y6oeu52OkwR8/Jym+Dx90JTiBdF4YyedsITGDuFtMpyHO5k17nTBsU= Received: from SN4PR0201CA0038.namprd02.prod.outlook.com (2603:10b6:803:2e::24) by CY4PR02MB2680.namprd02.prod.outlook.com (2603:10b6:903:11a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.18; Sat, 8 Sep 2018 15:03:21 +0000 Received: from CY1NAM02FT020.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::200) by SN4PR0201CA0038.outlook.office365.com (2603:10b6:803:2e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.14 via Frontend Transport; Sat, 8 Sep 2018 15:03:21 +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 CY1NAM02FT020.mail.protection.outlook.com (10.152.75.191) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1122.15 via Frontend Transport; Sat, 8 Sep 2018 15:03: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 1fyelc-0002cg-CB; Sat, 08 Sep 2018 08:03:20 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fyelX-0004pQ-6a; Sat, 08 Sep 2018 08:03:15 -0700 Received: from xsj-pvapsmtp01 (mailhost.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w88F3AiX031616; Sat, 8 Sep 2018 08:03:10 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fyelR-0004oh-Qy; Sat, 08 Sep 2018 08:03:10 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 4A39360498; Sat, 8 Sep 2018 20:33:08 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , Anurag Kumar Vulisha Subject: [PATCH v4 8/8] usb: dwc3: Check MISSED ISOC bit only for ISOC endpoints Date: Sat, 8 Sep 2018 20:33:06 +0530 Message-ID: <1536418986-16609-9-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1536418986-16609-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1536418986-16609-1-git-send-email-anurag.kumar.vulisha@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(346002)(396003)(136003)(376002)(2980300002)(438002)(189003)(199004)(48376002)(106466001)(8676002)(5660300001)(90966002)(356003)(50466002)(36386004)(42186006)(8936002)(63266004)(305945005)(54906003)(110136005)(50226002)(316002)(486006)(336012)(106002)(103686004)(11346002)(217873002)(446003)(126002)(52956003)(4326008)(107886003)(478600001)(81156014)(16586007)(47776003)(39060400002)(476003)(426003)(51416003)(2616005)(81166006)(76176011)(6266002)(14444005)(36756003)(26005)(186003)(2906002)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR02MB2680;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;CY1NAM02FT020;1:3e6EBwYM6FhYTJ4depUDXWuxGT+XBwWpMWkcxxd8PHMqhpELTunzjDfQKD8d95/X4ciOpJ2vpTppMeOxHBydoPO0iyeyevFNmhOsOr6ueMUzdTwhz731K7i8pk5rwJog MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c9e4bd90-54e2-40b2-2133-08d6159c37a3 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:CY4PR02MB2680; X-Microsoft-Exchange-Diagnostics: 1;CY4PR02MB2680;3:wsNh7MHLqcdOSSL5kbVWLBW6/w4p6huwerPsV2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EgpQnUtgviyMGDkPgJcQje8oDP5xAJkK3+3UEcWwFRNKL0JUN7Kxw2Ap2hMpn/AN6E/kAJzCk2Ok8Ri864M64j9VwniN5DAX1z0zDqfbjWhMa9ZojkBWdkENiDhinHQzUQNkS2D/3QPxHN0JcED70dEa96CBATvFRZCFWdRr4ZoQsusUe2COhkQTdEhde3gJunNIbcNOztVBWIapzJHrjHqSzpsoohQgmL8blf9ghhftCtq1FODcCaouKzBNbOSc0mkhLZ0p+l2t8CQAWrLOBcEd6TaIgfQ+l8ptSEguzzJvByLbjRhzR6Q5kUC8OczZZp0UuC6vryPj7Ihx1+lOhrVyKcpb17eJKcZsxurqMD29KlKvC3JJZ/vWYPuZmhDWu2Yu0sdVgYIdXjwJ X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93004095)(3231311)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699050);SRVR:CY4PR02MB2680;BCL:0;PCL:0;RULEID:;SRVR:CY4PR02MB2680; X-Microsoft-Exchange-Diagnostics: 1;CY4PR02MB2680;4:RrZ+KT8+3njbQUP2mmeR+fWk0j3/0OFpvo7nFIvrl6uMbM8hOIYQ3bIXN5mzKCUBr1dYe0FMquVKYFTOLhm2sMd6L2zmBZRjdLP0AMQCdDQ61BOYGeXlCo76U7VJ07titCKgizPUp9FdqA4DGilIOdA5wJsKdeNOvxUSgzsfV/euRhiOMmGbqyq+wvQ8Q+LttBmeHGziMZlhIs2d/lMJ79NhBY70dh2bsvlxHuFhtk5rhqcw+IyZGgoIzrLDH75O9Z6Pb8vSE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ztZ3AoP030UyLEq5bp+oJMmpM0qTUd5S/o0CA==;5:7EEEAHaZeTcmdldwZX2HIeNMZfMoHFQ43VwNfEpHYdd4BKDNhyWOR7LVt8qzo3gUG6jZr6Q+vOfY03H8ZhSNwfqjS+jgY7UBdgHPNUG4R8GccUWtfoD/Lk+h5JwVUB+v8ZCNoICErVenuBol0qfAC/AonQASCtk2GznKmkplxjU=;7:nNmY5VK1p479eRCDF9tzP5T9u+EZos9rgQPKbg4vNUmZRjipRneGkwrogMFSr0bcmu0+dSOK1eUFPgS9JaHx4xxNvRjRPDqWTnN/yc0QbLGVzALqPFLOS9f+qItCeapn8QTcjSX0Ad6SwMfkPNB6xeBw+fBe/db++qfx+USbsPZhKh+snL1a1omr/lYDejIqerZz8zcc/X0Erm927BxD/1Tao4QjLWjTn4KGs96ebN5xcgnAIK7v/9B6aQVmoVdT SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2018 15:03:20.8425 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c9e4bd90-54e2-40b2-2133-08d6159c37a3 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: CY4PR02MB2680 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 v4: 1. None 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 6b6bdd2..2c9e3ab 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2422,7 +2422,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))