From patchwork Sat Sep 15 14:29:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anurag Kumar Vulisha X-Patchwork-Id: 10601453 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 3836717D5 for ; Sat, 15 Sep 2018 14:30:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 285F72B847 for ; Sat, 15 Sep 2018 14:30:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E2A32B7D4; Sat, 15 Sep 2018 14:30: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 7E4492B84A for ; Sat, 15 Sep 2018 14:30:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728010AbeIOTtq (ORCPT ); Sat, 15 Sep 2018 15:49:46 -0400 Received: from mail-eopbgr710060.outbound.protection.outlook.com ([40.107.71.60]:27599 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726917AbeIOTtq (ORCPT ); Sat, 15 Sep 2018 15:49:46 -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=lcVzG+1iI7WYvwcHjeFBJrsUGTqeXQXevwGSyAjg0KI=; b=Z1w+v0pH8B7tFw0we6s73oZ6CP3+ZwJuU6I8emtAayZZxpNZEXr9BbjIXJWZA1xlOgtrytu/iuCzuZu2ymD+X2h5N4ODqo+OKvtByYCegdyCDYc3VBbx1n/VQUZbnbxy/TlXdJ54xnRBdeE1Ra7SqOAv/Tqnut+YqEI7z5IzcpY= Received: from SN4PR0201CA0062.namprd02.prod.outlook.com (2603:10b6:803:20::24) by BL0PR02MB4465.namprd02.prod.outlook.com (2603:10b6:208:4a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Sat, 15 Sep 2018 14:30:31 +0000 Received: from BL2NAM02FT009.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::206) by SN4PR0201CA0062.outlook.office365.com (2603:10b6:803:20::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1143.15 via Frontend Transport; Sat, 15 Sep 2018 14:30:31 +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 BL2NAM02FT009.mail.protection.outlook.com (10.152.77.68) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1164.13 via Frontend Transport; Sat, 15 Sep 2018 14:30:30 +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 1g1Bag-0003To-66; Sat, 15 Sep 2018 07:30:30 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g1Bab-0004qu-1x; Sat, 15 Sep 2018 07:30:25 -0700 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w8FEUHfI031449; Sat, 15 Sep 2018 07:30:17 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g1BaS-0004kT-Qe; Sat, 15 Sep 2018 07:30:17 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 08C9F604AD; Sat, 15 Sep 2018 20:00:16 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , , Anurag Kumar Vulisha Subject: [PATCH v5 1/8] usb: dwc3: Correct the logic for checking TRB full in __dwc3_prepare_one_trb() Date: Sat, 15 Sep 2018 19:59:54 +0530 Message-ID: <1537021801-23896-2-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1537021801-23896-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1537021801-23896-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)(376002)(136003)(346002)(396003)(39860400002)(2980300002)(438002)(199004)(189003)(336012)(54906003)(90966002)(8936002)(478600001)(81166006)(186003)(6266002)(36756003)(2906002)(50226002)(81156014)(39060400002)(26005)(51416003)(11346002)(107886003)(106002)(110136005)(48376002)(50466002)(426003)(446003)(4326008)(126002)(76176011)(486006)(16586007)(15760500003)(5660300001)(316002)(2616005)(356003)(6666003)(36386004)(42186006)(47776003)(305945005)(8676002)(63266004)(103686004)(476003)(106466001)(52956003)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:BL0PR02MB4465;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BL2NAM02FT009;1:HZMqoCLwG8ZdgPtgU7kh7I+v169KhRS4gNOa8+cKpXj3Z85f7qpCDDoE4tiMAfbkLz9nbs7M3Fyy0TDm0f7oddPS8xSWNb+ZbPbcI9lJKf85HQslMXUDbeF1YSMYMtYJ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9f03dd0a-fbab-45e2-ca3d-08d61b17ca33 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BL0PR02MB4465; X-Microsoft-Exchange-Diagnostics: 1;BL0PR02MB4465;3:YV3MQdBcID9/5ErRYHwzyxIjzyCrRiT/VXPkpdpidGvNUhNlrsA4y2VAPmbnCEujtoceVqW4LAGSEYLLPMY4U0Vmcff/5QOKOhE3RIojGv/viZhWwu7+3GgQQZLdcjpwGi6n6hfhOFJroJ83P6nioItHQTXA8Aditcwyl0y5yYd0IQVEUorg9XxvvMojJ2lnJNlK4PrhXnz65WCq6e81tm458pX6GY62YAZIL/xIyoqVy+xxRU59KN7fAGElfsoZ24IfBIu9qJ7TrjQPnVjRYoAf9/nmhk1cmw1pkAJHTOfaqB77mF9eNx+PjbHOlThH1+Fu47hfM268T5rZhwqrQU+aA6J9F23voKXB97dxLkA=;25:ebFcvS/0G4lZvgAXPPAyKZZDWV1lFu+wGpgFtdD92dQ1tjcFQLBOiSc0Uallx/dgy79Y2grN5wlreYI1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ICJLDCFnxIA0 X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231355)(944501410)(52105095)(93006095)(93004095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201708071742011)(7699050);SRVR:BL0PR02MB4465;BCL:0;PCL:0;RULEID:;SRVR:BL0PR02MB4465; X-Microsoft-Exchange-Diagnostics: 1;BL0PR02MB4465;4:gXI8FtNHG6uQtE7F0nbxsZu2LLTWmZ3tUEOZJcUhQCzthVDo+cteeaDWJnTxfr6FfFyw29mKawCTacya2bFs4mn6+0PYAv8PDdoQVRlYV7EKX1IAJVC49V6+GiPtuKXU+KWJLfn5ld+UPNl7tSeM3/VUTqjIbiFXFW/V0m2lpZLaP2RpstK6L55k4W9KrFQSLA3nWJvidpNwOFe0M1Od98ImKqyTpLNywWeQZ8UifM8JIpK10xZtFhsH3tREVZICag/ZtJHhaGV68B/+lwV3Q7LiXZB7kYdiIGdU3MLF5+s4kx9k3EKRjD54grUHt4bO X-Forefront-PRVS: 0796EBEDE1 X-Microsoft-Exchange-Diagnostics: 1;BL0PR02MB4465;23:+d13QTLiBnWbjLNFh+oKY5fSNZ1jbbs6bIpTpmYtV1hrt8RzG+abRboFWWFlWN76+HLDMTgmW9sww0RJSUy1/ImCVQUWPjvMIokRR8uwF18m3TaLqXMhehpJEHaGvwy+qIsFcb6wB4NdRWpt4afimxTsNKzrXUEPx2O6KYZmF46OiewOcapGOXBxF42HLpCfMM5ky8DgaxSztOFKAD6gnJsfFbu+FeU8O8VBEwofM2N3/+BPKc+gaDJigbeD61MTIUwLpxENGvBs3JQ/WVKhQhxDM7nD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Rvi4ELc0IwECB7SgQVb9Y6y4J6Gj9wopIgAzbXNyuq4RtGjo8tMbcaiGLMzjVqcc1WX/aM8w0AxqRSnFwUiV6MN9A7NW+K3E0XkzcNuKZdVBbdfBCBZ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2018 14:30:30.7593 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9f03dd0a-fbab-45e2-ca3d-08d61b17ca33 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: BL0PR02MB4465 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 v5: 1. None 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 15 14:29:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anurag Kumar Vulisha X-Patchwork-Id: 10601451 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 D7AF314BD for ; Sat, 15 Sep 2018 14:30:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7BBE2B7D4 for ; Sat, 15 Sep 2018 14:30:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5E762B847; Sat, 15 Sep 2018 14:30:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 419C92B7D4 for ; Sat, 15 Sep 2018 14:30:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727311AbeIOTtn (ORCPT ); Sat, 15 Sep 2018 15:49:43 -0400 Received: from mail-eopbgr720070.outbound.protection.outlook.com ([40.107.72.70]:23912 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726917AbeIOTtn (ORCPT ); Sat, 15 Sep 2018 15:49:43 -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=BmuiNfXtLOQBbueEAC368aZ+Xvulp1Aj5ZVIQNowiME=; b=4B9vovhcPqO2ye01bTJmvpwHeg+yxB3WORPz8QcuFSD1R3MqfIfEaWa/t2StL0vjlxrl32QSPTnpRYv5Q0JOMIRqnrGaqff0QJIpLpjEozBph9HQ62XrmtLdoIZroTSOCPDxQCT6z+54CLaAs8B1cFjgS1FBdq0RUX/d9ZsUANY= Received: from DM6PR02CA0005.namprd02.prod.outlook.com (2603:10b6:5:1c::18) by BN7PR02MB5107.namprd02.prod.outlook.com (2603:10b6:408:22::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.17; Sat, 15 Sep 2018 14:30:31 +0000 Received: from SN1NAM02FT037.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::203) by DM6PR02CA0005.outlook.office365.com (2603:10b6:5:1c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1143.15 via Frontend Transport; Sat, 15 Sep 2018 14:30:31 +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 SN1NAM02FT037.mail.protection.outlook.com (10.152.72.89) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1143.14 via Frontend Transport; Sat, 15 Sep 2018 14:30:30 +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 1g1Bag-0003Tp-Gl; Sat, 15 Sep 2018 07:30:30 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g1Bab-0004qu-CU; Sat, 15 Sep 2018 07:30:25 -0700 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w8FEUK1F024944; Sat, 15 Sep 2018 07:30:20 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g1BaW-0004ou-EB; Sat, 15 Sep 2018 07:30:20 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 9FBCE604AD; Sat, 15 Sep 2018 20:00:19 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , , Anurag Kumar Vulisha Subject: [PATCH v5 2/8] usb: dwc3: update stream id in depcmd Date: Sat, 15 Sep 2018 19:59:55 +0530 Message-ID: <1537021801-23896-3-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1537021801-23896-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1537021801-23896-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)(376002)(396003)(136003)(39850400004)(2980300002)(438002)(199004)(189003)(426003)(336012)(6266002)(476003)(126002)(4326008)(186003)(11346002)(446003)(39060400002)(90966002)(2616005)(356003)(36756003)(305945005)(26005)(2906002)(8936002)(478600001)(5660300001)(107886003)(14444005)(103686004)(15650500001)(50226002)(6666003)(486006)(76176011)(316002)(8676002)(50466002)(110136005)(16586007)(42186006)(106002)(36386004)(106466001)(81166006)(47776003)(52956003)(63266004)(81156014)(54906003)(51416003)(48376002)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN7PR02MB5107;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;SN1NAM02FT037;1:xsAFvtNKpD48MjXZyw6ythsmyUAi5yobcRk4BEXsyYDDH2PFWD9EFQIHGM68UqnqHq+0ubg8hX8HOh0qr7EapTcJGy9acCOhFmQrc6BodPYATWz7yZhTiW1AtjqTeVd8 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3dffc09c-c83d-44de-e70a-08d61b17ca51 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BN7PR02MB5107; X-Microsoft-Exchange-Diagnostics: 1;BN7PR02MB5107;3:85rL8y0n7ASBlx0XBtDwIpSDi0EYKxw5C1yBcXZkWOWtf3sU+QXbokUJgYx3zsjmBOtbQiXkFL0MLVqQKgwNcu08ivg1281S3RYKDsv3hPaRy8h3lVYWtIBFpUYPbOPF9/MPSHqvMn+x7zWeOx7NoA7CvqwPGA2BHdElINmRpJhnwnphPX8ZhO1aGT4hGM0a1W0q13xvPO9Vzy3E1Xw84/yH10oB0hPSVrj5kPCL6VvQkgyJU2yAinWpXUP7/CsdVX6aRYN4oe64pPRYlDwreL12NMEtXurhfAzqryU/kRNuYNnKmewN7GpDohrn8D7ttnHwVrjfrfQosfTyVuCSowoHjeSfP0zyBlzhfOBQfbQ=;25:R0+OPvZnHd13OW+jkGRw+bfxfivssQl253AX+EaPbpg4eAbjvVH3ag+M5SjosVy8RlFtmF+/j3rMyh3RsL09aGtl/4Yl4H4Y/hsxZ4bQ/tdq/SSyfkN+1gFkYpWyaA+jFzTIr53aM5yXpSbc5l8mcHlQ+nBteG9gQWdkzeWy6qFrWvS5thb9DwEAOdAGfCK5KOTp2cNelXXwKx80wJkPbUwhYNP1oeJNXyG+k16b3gqmCrOeZvPSyUvj1VbiYvQ5mCM1YnoxDScyIGxLi03aW94EoKnw3pQ8noxJ2mw52wWp8unIrOIuBRP+0Ai2afc095kXrSWVuWPJy8ZlkAslIQ== X-MS-TrafficTypeDiagnostic: BN7PR02MB5107: X-Microsoft-Exchange-Diagnostics: 1;BN7PR02MB5107;31:WobXCmycBcAvQbtFyNSZplBD/PVbQ8qBKfH9utChYTgB6nVi1t+7mEfdsIk2NMLXs3wDRVxju7vC0GvSt8FzwSsC/wH5u4hr8znOSZpM5+FwAww4xc4s4tWcte9w1PkCJxJ2velxmek4FybVRJgpAVVdNZEC6kqMjRc35icV0LGXpeiAmkM38iA1kBYCegUelFRs+5/3qfealGBE4rgodLZvv7Q1DXI6Uq7mkwnKSJ4=;20:y9Ot2W1OD0JgThedNGuoMuUDcH0c6xjaBSBEQx2Pej2fb6Gr/7o1j9ir/WuDvqyG0OpodVWJMIKaZstiZdNxlRL3N6BDokBZjvDmWRxKF41P2Zun2+EVEX7SMJyi76pFdkIKfWo6tlY1bzF9QBscYUy6IUxtUNeBPhbqKKmhHiHWiVI9uYkdfBU7RxcT2VN7B+yE9jbUmKPgIwdBVArVLikBF5djF7LAy4Ri/OFczCDSNw8CNH/KSP8Qz3Zk3b3KBkQyGt2Pspst6fL4AFY4D86vFiHYUQUiEpsAbkoBzXIkUjETTMe+zjLd0Ut3G32dZb2foL1LulIh6a4osClm8C26/ccDSIHYoUc/eA9KoDKBi0pQLWsP3EvMkTW0/stcREwSuPTYu5YgPMQVsAec3lsRIUt/KLGrPP/gAqdEe6X5YYgD5uVltwKsLq0tLEJkffiY4VF4Cc6mJ1hmj1QTNd86TWqLggKa+wIXJklyhfdWx4Jq3KcERSKbzjPmCsJW X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93004095)(3231355)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(201708071742011)(7699050);SRVR:BN7PR02MB5107;BCL:0;PCL:0;RULEID:;SRVR:BN7PR02MB5107; X-Microsoft-Exchange-Diagnostics: 1;BN7PR02MB5107;4:j0cS4QGho/XJdEOXtwimxa4XWiYuqxfdLSEC9AEKNWCGWC4M9zTmrHUK31LwjZQkZTiEJhb8qEAW9pEeZtCsTnCL7k0ZWHxbZY+LYq9j8oJEpcitPZLkf8l3SiFHMvqiaddzU4QMmTuR4llBGlXmyPdZJq7YTn8Dz3B9wHdyUqp+4+toLb188B3veYt5TpHzvbCGnLYqLsFcIcp8TDm1gsBcmOawiGkGnReU0Ow6uTmItHyys5A22GAEepsZMwQtBeQ0eWRtceEu0UQcfrtYI/GYPyiR9dpSI/t7t5t98FUSvT/6LJ9yace0Evhw7A/Q X-Forefront-PRVS: 0796EBEDE1 X-Microsoft-Exchange-Diagnostics: 1;BN7PR02MB5107;23:ux/zYtUGDkKl1BEkKxEjbyW78x4WoWzfP/Z44w4evp4VsnwKWG3TpCOaPyCXWMtgTZRnA92BRmulBB9L6zWGwpLyQXywH7x+nuZdzbsDnk7EkbWTjrW5GntnsDFpWzTWVbpj0H+mVEJ4mLQpGPgOFE7OfyhhmAjBFc++PL16LqOnmJfhW66CoA+QeNaO/qyL2QFoSZfUUClgfAXKU927W+m9prSTberHnzYyqyYRSxqMjNMCB+x3uG6po4hrbbFnMp3HS56m4SfG9/5ThY20DweEvSp/WtQK/UecdcdQWsJ7lzi7W03zMzMfwfDOSxzAHYZOINW2wSj1Lt+CBW92toOVUQn5w2JbrVq+Pk6jOEkvhmrBkufp3jLbBtjudFGnfzGIJ/qSNnmPvnP0OekXZS1BMssSuUJo9zJ5AgfR4U9bPl2TDrNidnsp7KyQAHS2G9BYNCQlO6TI9iIFqo3mwfle2LiB4oiy63CooXEXp2jzoWm3bGGf8Njr0XO/B9izA2/t6FooTV3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qGmyH8s+Q7ck= X-Microsoft-Exchange-Diagnostics: 1;BN7PR02MB5107;6:kW7Ogm2KT5d6YWjQbWDT5sQ8nfUcLMK2v0kIk7LpUVQP3Wac2RxT1r47XPyH50vWtrziT1qzcdXyjHR5r44sfyfcez4OGDy66ITKGcLFHp00ThqLhMA0UhbXsOZHX9aG7o4mZkjJ++OkT+KHPVj9dW3mGCIzomzRuXdHA3H+1iX7Wz9LXvuCLzxvJ0cfnFnMo0Kk38buh6FienFEOazXLTKHar3xgtdeqBdEf9JACoz23y1Okvu3dagNj9ZNOtk+T5qmSwlRNIibKg2AMVY4wfJkAMtkV8vOQ2223FZ8ysLp3lY6c2Q+x68b0BJafRRKW0KFSlthYGf73sQJ5dOqg4oAhg1yvmV1WNmX6jfVRoFMOLRg/OaNR1SQVgyCpF5sKyhd+vZq7ZbOWaqpGBYI6P7Da/Jb0Y+gam73aHsTJ8cPJQ/fJCHafS17v1YqNGt+a2JsCaAAJ6rcP5ed5FA7/Q==;5:AE+JCz2sOqrQzE5qoOfXyymd8jtl53tYZQB/xzKfZSWAeA6s38Qn9AXtTgayptOR4zn1lEGDfR7aeKb+ICfY2J7zP0ZN4LP10xAhfcCI8F8n7f24cHS6Nt/YLFKnjcJZ3rjJ5uURDjDu0qUwS7jGE3ptlsJSqmp7GPcGF0BnShE=;7:jOQ4AK9F3P2gPjPLsHi81osli6ElgFUr96iuvsmpNsDyiCmD+Mr/vh8rzHB36qIqSqe5JRduAagGxan6AZJOUgWDvCVRz9EaQFSQtvf99Nje4z02BCjcWpOOEkPsitgehROz1U+KiZeTpM9m45NaBCBCz7il6hYVxerqkRr/yuH+BhHrFeZRo07xEZjKuJdzwXaidTEU/5JLCkxsW/LXX7eq1MFYY1/oMtKMZSHL3SgxBTQABFZFjdtc/c2634Ik SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2018 14:30:30.9254 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3dffc09c-c83d-44de-e70a-08d61b17ca51 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: BN7PR02MB5107 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 v5: 1. None 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 15 14:29:56 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: 10601455 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 7357414D6 for ; Sat, 15 Sep 2018 14:30:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F54D2B7A7 for ; Sat, 15 Sep 2018 14:30:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 54BE42B853; Sat, 15 Sep 2018 14:30:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2C032B825 for ; Sat, 15 Sep 2018 14:30:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728012AbeIOTtt (ORCPT ); Sat, 15 Sep 2018 15:49:49 -0400 Received: from mail-sn1nam02on0047.outbound.protection.outlook.com ([104.47.36.47]:65446 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727291AbeIOTts (ORCPT ); Sat, 15 Sep 2018 15:49:48 -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=irb9Ec6IxmxfN6v33xS/0769B4QncTxsdO6kgoqpTMQ=; b=XHtyRswEyQVtzEDnxmhhlrkpPCzBkT16TrAGOMnzSsHH1+LYhW8KWsB9Znp3fIEtae6XysKbVvJyeQnxM9sGkBlKNo9Qlvc9+lBKCqsEATBVkE019kQhC4hOjJ/4yzCHd/7UI+elWjvx1k6weaN9iwJ8g7or5I+Yj4/0cOELs8M= Received: from BN6PR02CA0046.namprd02.prod.outlook.com (2603:10b6:404:5f::32) by BYAPR02MB4470.namprd02.prod.outlook.com (2603:10b6:a03:10::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.17; Sat, 15 Sep 2018 14:30:32 +0000 Received: from BL2NAM02FT062.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::205) by BN6PR02CA0046.outlook.office365.com (2603:10b6:404:5f::32) 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, 15 Sep 2018 14:30:31 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT062.mail.protection.outlook.com (10.152.77.57) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1164.13 via Frontend Transport; Sat, 15 Sep 2018 14:30:31 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:34685 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1g1Bag-0008C7-IF; Sat, 15 Sep 2018 07:30:30 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g1Bab-0004qu-E1; Sat, 15 Sep 2018 07:30:25 -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 w8FEULdQ031541; Sat, 15 Sep 2018 07:30:22 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g1BaX-0004po-It; Sat, 15 Sep 2018 07:30:21 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id C3523604AD; Sat, 15 Sep 2018 20:00:20 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , , Anurag Kumar Vulisha Subject: [PATCH v5 3/8] usb: dwc3: make controller clear transfer resources after complete Date: Sat, 15 Sep 2018 19:59:56 +0530 Message-ID: <1537021801-23896-4-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1537021801-23896-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1537021801-23896-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)(396003)(346002)(136003)(376002)(2980300002)(438002)(189003)(199004)(48376002)(186003)(107886003)(47776003)(54906003)(50466002)(26005)(2906002)(6266002)(51416003)(336012)(110136005)(42186006)(16586007)(486006)(446003)(126002)(2616005)(11346002)(476003)(426003)(36756003)(76176011)(36386004)(52956003)(39060400002)(4326008)(478600001)(103686004)(90966002)(316002)(106466001)(63266004)(305945005)(356003)(8676002)(5660300001)(8936002)(6666003)(81156014)(81166006)(106002)(50226002)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR02MB4470;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;BL2NAM02FT062;1:0bCySa+mHRKB8gtY3j8UIhGAP46G0RZ2RHKAX/Q+Tsnzy6MhjGT2NFi3UFy81O3CwPr8m/T1l1sJSKhQa8ILaQGNO+OynHcovA3UfoO2NbV7y5AGeeK3LdJRTP45IDK/ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 52a18c32-7869-4d78-829e-08d61b17ca74 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BYAPR02MB4470; X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4470;3:71qowaLxt5c6Ymnl4QLXtXbm0lw9q9C7vNRDMT8Gidw96on2xjREyin7pPsnk5TDmctGPSGnlwYsVWixd4QzdEIJ8NzwvxOrKGXm2GuU0Ev8qs4IY46inwHCVrEje4kV/YYneNcjx1tNJi+sApyfAHuiv1Z/vOy+OMxKa7cH828/sOpFO+sTowvxgF9uBuJTw3QcDZIZLs+/nrN7wD3hg18jpJbvoNeCSKuOwxZZHIVKVg3Nc2Sl/ZsEFHFRVrb/KIvCUCunLg5wgi7dMNmwLOX1YP215Q0/os72j0wDGavNZbMxPSBObJzTfO+SzTsx2Wi3yfh7DcBk+XNI3aufA0ex/zthxlh/ncgyzh/fdpM=;25:32z8BTXjjx0/zpk8iIX8iyQShZ4dKLhNBp/Hz7GFokpCOUtUvhyHhvLnoggpJ0OvZfrK3S3FQRqsMSTpiH68YKjV37SGKu5OYe4GXrWkyucCyyLjEHdLfireDqwPiN6ejmwNJZEamNE7tw4rJ9zN1Ny8TyA6HlwtZpf0acECeqNJH9F18t/e2DRy9hA22Ej1FunC5JtAeMZ+T+Wb1vVJzQoC2Y/zQn4yRApscJlmXipcB29hkdD7FQN50cD0wQuMi57OMgluydHcI1W0Ystpy7tis/qgLFIoR2TK5S1T0SjZtrbwSHV4afyZM9gxsoCfLDznUSD8GpXC2ZCdPUxt2w== X-MS-TrafficTypeDiagnostic: BYAPR02MB4470: X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4470;31:bGXhQFICH6Sa6p7yZfBYk9K3U+P0jbHm0lPiQCQKOInNK34ChsPJmjuOOvBM3k7sX/Or8VoCZN4Gqfrmi5QrjrAjW6k5jvwxpXLzCqBAqYcTJMdK+xuGe5MDhTgP0bWpVHti+ahhqNnC43x/dFymn9HAWx0DhfBeWGDidIFAjgl8JBbjsUN8rORj12mugR3q3M/+Kn0Ap/WJPRi8CuhBsGrgBfTzzmqS0mz22jdugYI=;20:Lj1ZJElSQwVa1pZs+hKj8bVF7BIzwjBcxyQb3wzOI5rusy1b2/zCmorzF0r3FrSQz/lkwyThrSFMhicav283n9BngbnuQx3bTKiEAO/jWNV12+DGAHr9Xm0HPhOP9Irz8PglHVKCrZPi8Lb+lbo+vXPskKy34JE1ovFvf+x1QD0HsHvsGBIzHrTdQahxMKYxcqgq8rI0hOj2+HQbU5dwI4BQ177/GKYDoJ4d4LFrIICkt7+wMmzIDxg7RloPI0tEtE2PhfR6d07TSf875ggdzPDOBKiwEZJwSGkaxn1W17VK9boi2RwjVWWyWb8lIb3YjA/Mcdx3JTN9DzOGrIr1JbhGTBDRAJPnYukOqzr98yx/pKiCJZtnPedDTTzB/VvdFV5ZrXuRxCWjW6TRuWtrQ2QQ9jkcp+wunzcqGxoPeBy6MXv7Q88d2aqFtYYxQWpiOD3EJVwc5zMqLZebPZzXdvkA4aSKt/qEbuYse1VBmaOqSaPUjcpJ1yDUHlwqT3PI 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)(3231355)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(201708071742011)(7699050);SRVR:BYAPR02MB4470;BCL:0;PCL:0;RULEID:;SRVR:BYAPR02MB4470; X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4470;4:Tcmhb3ldQ8UkLxXV/OOI2i7JWySrbE2zir4rb4ReQgNNqsmdzijx9VwPN0Hr3wjBgfZ33I1kXwat6B7G62he4U13CT4FJKoson5/it4M8nuNkrOcxSfhImZB7jnhb2msDVFmJf0cYGgYB6oVer0Sl5gBqQOcVGPH7mGZO0I1ZcUPaQV+i3sho7J4GRaLzvnhKTF5vgFPnLgjWvj8GW5+KytK0DStCAh7NfqOxV0RZhWTwq6NP5x3hZuy8302g+KIjkkWIKQcvkktndLJ2JEO+wEU/pSSoIeRURben3SaAt7D+1RDqsBLhBgrk2EUexnD X-Forefront-PRVS: 0796EBEDE1 X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4470;23:yw+3XAYxnUzvMx23x+sJF+R5uA6+8rYZ9qx1hq2XxqSO2mhR4Kg2x6G6HQk3+0UtfTrg7B8fH1ENkpD6F0FyuQ7iUXkOZNiiXZAjvFKy18yKf+ClcueRGazJXMy6kUB3P39SmfUsdKlhRYRh29EVOqidh6I2jxTZ6Yj0HbOhEzoOlM67W8qHj7VMb3DoFaLAm2HUcvb9QzpfFIz3tO/8hngNvwqHLqfsFHcOujt9ILGpe9PL1ckWxTgS/mA7ic3ZpgbZkSH8xujsr9cSmr9KStoQAnqNQy2cf+0SzagdCX+WFu47Fy/utEKP5/+/SpEHdXzYywc4ErqnCTnXDdbLzGFCUDLvjsPHFkfpXlyotUNeYOdONeKLzDra1/uNsUbqVoN6UFiAPaKcanuuM+2lVlaMrG++DHtYKzEY6Pm+1u8IVMcpfySqIiL3XCGnmn75B9LSVwLssHdVq9AVPY8XLknZb0ecLHiA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EC+7w8snJyih9yShJOMcj2+JYrpxknvs/PdShxajajL8QDaQ57turFmID5JIcgc= X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4470;6:TDAoNynkoRo/gflW8suGp0zcj8APLbcu2ENK6cZjuXYT9Oql3F2VeF+iyGCC393bAeW3KogYpXZ1/GKusv2VRsLe468u5oGxAU33f7QMWQwwABsbOiB9UscPjUFolGaRGGDI2dwORcJgIiA0gcJv1l+xbK/IWtYzONL7V6GNl1hTjK2zQExNntH1tfTfpzyomTOJ2q23HDmPquB/AfISo15XFeJxrJfDuBLIOONAwtka7IO0WB5NYlb+iKP0PTf3silJRg/n3qGJN5kigHIMlmgva1fkfo4ANScZxEzrJd8xx2/CABXrCTXOf71ko7otIxxS7TJMmXvKnk+yhuiQzHs59vzrIWTzArYD0vdwmidCx/R4ZekaqQPK9xhEw8KJvIXKoUe3vyZb8/kX5/JDndjA14/F4DIYgK+8b5wgmYEmOVaSzdFGHXN9wzXUNTpW+5rd6JZnmGPsQptLh8Uhqw==;5:2lVTzs5XSY/URFvPLQ9pOXxJpE0IpkWZVJ82DEzrMrv8s8E7MPCocS703jw+5Xbyy7UfqRc6Im4y4YXdDe0djRgIhyq2opyguUsenmOhUjky5ehbP6f8y+oR4Md9dzAzeaEeCyCAA6fPIXPzW9VZOHA/KDEC02CsuJI3xb2zx30=;7:a6JqiB3sMcOKvn7c8/OJjgG+Rz9NeBitS/X0tfCvQXabQB1bWjGC6Gm0q5OXIov0X/R88l4CZBWgTW0pibL4sjeOhOQd5o2BIMzhC3RCDN7cmsBFXeOLb9MRLGGG2OaifVBpzl0oI5Zi1lUbLI1PQT6cXHu7k8oiV1MHnda2kX04hl7vBAkLLUjO7/GyzakLLhXkgXBwdODEyYA2TqZ4OQE7afEaa2x9dIUh/rW/wW0i8e8CzszonMwkm5O6iHy4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2018 14:30:31.1834 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52a18c32-7869-4d78-829e-08d61b17ca74 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: BYAPR02MB4470 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 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 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 15 14:29:57 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: 10601465 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 EA93614D6 for ; Sat, 15 Sep 2018 14:33:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D03572A0F6 for ; Sat, 15 Sep 2018 14:33:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3FF02A18F; Sat, 15 Sep 2018 14:33:46 +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 945352A0F6 for ; Sat, 15 Sep 2018 14:33:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728125AbeIOTwt (ORCPT ); Sat, 15 Sep 2018 15:52:49 -0400 Received: from mail-dm3nam03on0077.outbound.protection.outlook.com ([104.47.41.77]:36592 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727246AbeIOTws (ORCPT ); Sat, 15 Sep 2018 15:52:48 -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=qi5xO1F9LyxDO99qXRmHSc08cWzrHY6uMEgll07uXrg=; b=schKRKjlD0QRc0yUy+SJvqDiJ73wGFAUVsH6I4O/nuVMM15LnOsx12tfWzwsCFsdK5e6EYHpoMbPCxcq1qpYqBz0MBTvvwhDLIhB9GEA9gX4JNel/gkE3RAzsPANqoIeLyMQGazwFe1uC25MaWQLOJtiks4/rAkm9W4FV61Q7yE= Received: from SN4PR0201CA0031.namprd02.prod.outlook.com (2603:10b6:803:2e::17) by BYAPR02MB5111.namprd02.prod.outlook.com (2603:10b6:a03:70::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.17; Sat, 15 Sep 2018 14:30:31 +0000 Received: from SN1NAM02FT052.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::206) by SN4PR0201CA0031.outlook.office365.com (2603:10b6:803:2e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1143.15 via Frontend Transport; Sat, 15 Sep 2018 14:30:31 +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 SN1NAM02FT052.mail.protection.outlook.com (10.152.72.146) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1164.13 via Frontend Transport; Sat, 15 Sep 2018 14:30:30 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:34653 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1g1Bag-0008C6-3S; Sat, 15 Sep 2018 07:30:30 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g1Bab-0004qu-0T; Sat, 15 Sep 2018 07:30:25 -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 w8FEUMm9031549; Sat, 15 Sep 2018 07:30:23 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g1BaY-0004q6-DZ; Sat, 15 Sep 2018 07:30:22 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 960E0604B6; Sat, 15 Sep 2018 20:00:21 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , , Anurag Kumar Vulisha Subject: [PATCH v5 4/8] usb: dwc3: implement stream transfer timeout Date: Sat, 15 Sep 2018 19:59:57 +0530 Message-ID: <1537021801-23896-5-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1537021801-23896-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1537021801-23896-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)(346002)(396003)(376002)(136003)(39850400004)(2980300002)(438002)(189003)(199004)(39060400002)(26005)(50226002)(2906002)(336012)(426003)(356003)(5660300001)(8936002)(36386004)(81156014)(90966002)(2616005)(446003)(126002)(186003)(11346002)(52956003)(486006)(476003)(478600001)(103686004)(8676002)(6266002)(106466001)(81166006)(14444005)(6666003)(107886003)(42186006)(63266004)(316002)(47776003)(50466002)(48376002)(36756003)(54906003)(51416003)(110136005)(106002)(16586007)(305945005)(76176011)(4326008)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR02MB5111;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;SN1NAM02FT052;1:FbCK56Ar6I0pAlmHJK2Jctm+corsaBkgCDcvL/h7ux5t96Edx+K5NsAzg6+rDhukIXU8pio5ImAIkqrmcR43/YHR/x1bStRxQD/DrBEKlwq9vNW+DZqORnDXzMOZvQjY MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 789737aa-3b73-454d-f8d2-08d61b17ca21 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BYAPR02MB5111; X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB5111;3:8M+4qDKgdH0e6zqJFHRjZyXX8oJXcsK7HC5GgVHWxSAkQa7pUDjK60zbLx2GB0GlhzNh3x04L+F7p9O7M4lE9JU6vCzIyHZw45dJnN6tOPIUV2bw6Q7ZgZ76pg7L5EVKh3FADVsa+Li5QnWodvAwlWU1aiLQuol9+ns61w9YwWALFi+pDpNLezOKn4NNu44oyxKi0mJnnbwnZu5jV4xlF/rWcY8i8J4Qyb0eiHf/4HxDLqZTiJNjOoz63+xj1cwQWTsfQXwGmbMrqh1/rRR8QUg99sHGm8X11ciYwMFZwuSkrccuMGmEP7rah8ACjinj4LWu1epVgTyrWPSfT7eQZUbjz4GBejqzW6u3JPY3peU=;25:dAq3yg75qXvU2iFNfT6X3LZEAHLBTSDPL2YYCJq/8AXeDFvhyPLehE9KdhTEmWg0E0vqdMH5d21FED4Z4GLwa82OdVc/9l5Q7EJWWglDHyO3eN8Gk907ozc+bFq2aKO0lqF6V6R7lUWewRJIhYNjuVCA54h/BB4Xrb3KIXNM2FxOCYseF9ReBqUR5Of1/Ri+rgCW38ezi6Ty52dHXdnowJUPGa/+bn45Qwi7QioRhICVrw3GKxmzvNYhppByTqOrxDkEe4inXflMLyz+6AXCX/RXHEQ3nn4W3QczZisgi/wgfZHFaTqVeNTyJBxEdqNtYB/np1ZmasfJS/wTY0KfHg== X-MS-TrafficTypeDiagnostic: BYAPR02MB5111: X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB5111;31:jXcA80JmRO0hu8iku2RKLSw5EpCJAEKarSq7CxrZRlnimUHtl1MaNDhJNQ/LTbJeq6sMqNDQgGdJL8hgbahOWL2rPrdHki7EodoO6ppTUPymtHw4JOVobMwOF6Uhqcn1CFWND9UAbVy6uWdeDjhzyakjh1EBA6AgAuKENUFyP9qR4OFp+UU1huHF7HwBE9uCEqsGE/8dmRNTMozeUGx2BJERUsLXErdy/YAH9wzoRwc=;20:q11R5GsTe09nPUKN0/s0hTJLqOEvTuwqUQ0uGJcBqgvi8fNQ0aFBuuqH+QTnG1/7QMEIf6/No4XD1IC/vHULRDz+zI4vU0HX7PEMxpsU3c9daCB+oUAZboCkqdiKXG8tWgdiY3GY4EV27NfSujPEWOVbjegP/z6wQdpeUNPcxxEcnlWr14LWW3VIxG7OYSoHI5aMXf6nuhXLboM49YDjsDTJj0oZ/JgMiTQfiALdVMVui1GBLVCtz0UdWl0IJjzqq6ioezSUOqGX5SutU/vuvKcBgidhL2FUE2LzmI+/sl6E9e2LV9uSY+7191hR6MqpHOA0KjU9/MKReQEcDuS0JGe6bGS/FUhJxm3mlkN4vswM6ZSRR7VOTgqmGLGlXo/PAiK75mILOneY1N5XxuOBEymqKOHgutry5i8KcW7GpcjKM4K2dv1LvJDwYyDSc16iUCe5VqRyYZ62Ry+6o2Ti0L9zURtDuUlNFGP/eB9d2Zhd5S7AyGKLs0FV5SgLJWLG X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93004095)(3231355)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(201708071742011)(7699050);SRVR:BYAPR02MB5111;BCL:0;PCL:0;RULEID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rrvMC7+CsqwRiWsckS0unK3iwgoje1tSNlda36519SwrXh+rultVD7TJHC1pxehEHp2MDiDiKxFlro3qDjwuA5r0de3JaHvBvOCFdnr3jeWG+GP6+SI5Ae7TsHRqOTrxMyZNZxd4ZdlrdKqZSaXsj1yhlqeJPUff1jcVHBYPIINRUDDkRuOZHYQ62CwQTFeWce6tLoKDcre3CXi6gQNZ8DjZ3UnRBwrSxBb+dR0+pjOZeYPVPBf4hmeEbDiM8LVKnVSME36v1jKEWGgpcvMCDdfX/UNpWYiPOYj+D5OF5eORHndnZNqwREyukN1t0nhVW5i+S9V8gLdYV1nhhezTY+ajNg+li5DzyWnJlmn3/RVADAvyfZW22mDB8CNqkWfkHNKKW1tPQGxVo5h9KQL+cc9BgklDjg==;5:4qShFLEIhy9vEGd3HycQks5VtoBEF7rDjovisqaMxOznm9gzAtUSyhvmAJm42oEnGUDmF8sLAN7rRwE8wNYKGA9SSHS7D3nNf52nVoBaBHApKQuOdWoSPYG8gHaN13FgWPAkjpf+pDbJNcH5XvtehoGZtnTQ90q5NbBQsg3jrJI=;7:7cDTyONqJgQIxpK9MO0NL49MfeY1lp6XVbH26+9F6EiwmtldDSWe2w7IuLgOomhJfpFAXI6TAECHIpC5u69dldjw/nVrjkRo/s23aeit0BlYs0sjdVlRi6vhnnZNZ7VrW3y6W/nGZ4LxTyw/KlCDKtEIJixWf4C/lA/mgmiwd13i+rOk+c99FZ22dUXvM9L+hf8xSl9CKO+IP6BXw/p9Vvddj7Wp7SHwAy7vLkfAjcvrDVjTEeZxwYbPl6A0y2se SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2018 14:30:30.5644 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 789737aa-3b73-454d-f8d2-08d61b17ca21 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: BYAPR02MB5111 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP According to dwc3 databook when streams are used, it may be possible for the host and device become out of sync, where device may wait for host to issue prime transcation and host may wait for device to issue erdy. To avoid such deadlock, timeout needs to be implemented. After timeout occurs, device will first stop transfer and restart the transfer again. This patch does the same. Signed-off-by: Anurag Kumar Vulisha Reviewed-by: Thinh Nguyen --- Changes in v5: 1. Removed dev_dbg prints as suggested 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 | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 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..e18f9b9 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,9 @@ 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); + break; case DWC3_DEPEVT_RXTXFIFOEVT: break; } @@ -2588,6 +2619,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 15 14:29:58 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: 10601463 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 77DED14BD for ; Sat, 15 Sep 2018 14:31:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6602E2B6BF for ; Sat, 15 Sep 2018 14:31:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 592A92B6FE; Sat, 15 Sep 2018 14:31:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C5392B6D2 for ; Sat, 15 Sep 2018 14:31:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728179AbeIOTuy (ORCPT ); Sat, 15 Sep 2018 15:50:54 -0400 Received: from mail-by2nam01on0062.outbound.protection.outlook.com ([104.47.34.62]:2379 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727162AbeIOTuy (ORCPT ); Sat, 15 Sep 2018 15:50:54 -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=YHKTFBCrGpeeBxkWvOvxpl4OX01ojhxm6czd0z3qOaI=; b=RAUCULYtNwr94fhZXYfgR1V8Lx+g2D1VM7KRwn6r4ZAGIaR5HErmMdgFdMJAKqJPGTDPJJCdIhtJGajbHmynnCDD89GkRU5X9gSLW01la9B6IQZlRx2pUvKuU0PG/6NaQ7hcBZhemo5yyDsOh8ZdMmZKORxRQUXB6heLX/bPF2s= Received: from MWHPR02CA0027.namprd02.prod.outlook.com (2603:10b6:301:60::16) by BL0PR02MB4466.namprd02.prod.outlook.com (2603:10b6:208:4a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.18; Sat, 15 Sep 2018 14:30:31 +0000 Received: from SN1NAM02FT038.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::201) by MWHPR02CA0027.outlook.office365.com (2603:10b6:301:60::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1143.15 via Frontend Transport; Sat, 15 Sep 2018 14:30:30 +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 SN1NAM02FT038.mail.protection.outlook.com (10.152.72.69) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1143.14 via Frontend Transport; Sat, 15 Sep 2018 14:30:30 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:34650 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1g1Bag-0008C5-20; Sat, 15 Sep 2018 07:30:30 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g1Baa-0004qu-VF; Sat, 15 Sep 2018 07:30:25 -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 w8FEUNGL024950; Sat, 15 Sep 2018 07:30:23 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g1BaZ-0004qJ-3g; Sat, 15 Sep 2018 07:30:23 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 49388604AD; Sat, 15 Sep 2018 20:00:22 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , , Anurag Kumar Vulisha Subject: [PATCH v5 5/8] usb: dwc3: don't issue no-op trb for stream capable endpoints Date: Sat, 15 Sep 2018 19:59:58 +0530 Message-ID: <1537021801-23896-6-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1537021801-23896-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1537021801-23896-1-git-send-email-anurag.kumar.vulisha@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(346002)(136003)(39860400002)(376002)(2980300002)(438002)(3923003)(199004)(189003)(486006)(336012)(2616005)(36756003)(476003)(36386004)(6666003)(54906003)(356003)(42186006)(52956003)(106466001)(126002)(11346002)(103686004)(446003)(50226002)(305945005)(90966002)(63266004)(81166006)(478600001)(48376002)(81156014)(8936002)(4326008)(2906002)(50466002)(106002)(107886003)(16586007)(316002)(6266002)(8676002)(76176011)(26005)(426003)(110136005)(51416003)(47776003)(14444005)(5660300001)(186003)(39060400002)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BL0PR02MB4466;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;SN1NAM02FT038;1:hiSy7ipEDN8svjgDyU95jzOrWORaTSil0fExjl1B9pclK3udwdhvd1Q2XFVz1OqpPAvTh5GXZvCgQGaQ0gELGeGMw+AahwTakOsy/ndkgGs/gV0HBuQpEuwPWQWGYpax MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7f069c12-286a-43c0-e3d2-08d61b17ca09 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BL0PR02MB4466; X-Microsoft-Exchange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Dg7EohwIuglVb/QuCdEFCw1oDpDcwQe7MVn6+dTNLwTSnQizFpc80lnDQs6ArIwkt/eyxiNuCI7pUEmAWPu5kQ1CRJAz+23j/KdOtrtfTv/pwFwpcxn7BFw+JKXYaOEWN0B2cq4BaJwiq96TTe3F6wuwI6n4LrQ+U3hpX0RWZ1YI3H5ptj9MM0BU7U2f1UbYkuKS5HOp0aAtbHu5TZ0rESmU8yHOGwKFaw5Z0QvTOdPelXEIp3G09KXLlmvcOWxxqMzVSs3rjSf2osige25CdGDBjlDQMG4T3PGDKqUMjftbFbhAaql79zGkadvlwl8P4q2iocD7dVCFgKluAosFkwqy8qIzqZM5XgqLMz/ZOTZZuDlqDiGbjTO8WVYJ+xE5fKh6HS6yhWnCcBoYCB1YwaC2q734MWk7QNpKsz767b6lbDkFQ4qnDzP7BKs03xdfVUxJTrCZOInrSwVb7Nd9UAGbxrldX/aYi 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)(3231355)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699050);SRVR:BL0PR02MB4466;BCL:0;PCL:0;RULEID:;SRVR:BL0PR02MB4466; X-Microsoft-Exchange-Diagnostics: 1;BL0PR02MB4466;4:sjtwrWoeQsZzE/mEMgRDwg27jOSkR63T3uYTtUldx1wpiX3ekySGnJAklosuPTvmbaWtTlfUbii4V++k+z2aI6BK/erWKwgka6YGka8av8KEE4KJAboOaCrhRShXTR7MaF6KCqe8DDDUa0nk3hY3yd5gUqtRCqDx3AsC8Hd+JKHunwEm4wfCPyrT6eV6Br6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Q5mbc8v02r69eeF6WbM/l2hCfbgP3WG2J4E5Jul4LqFJVduOtCkow+E/OFkqXAxW3iWZ+W+Cy1BDahWBm953qLbl7vC5YGfksXe5+wf1spGoA5RhM2Vpyte93G/On7YLeE2nr02VxwSTj5rnDCQn06R2HJa6ClKm6h/RZxK1+WWixkFd4EOJ4sqWhi0ZS5yoRw==;5:tpVQ9Cun7HmG5UHgyhQCn+m0Dovj+wAN0eqd55rJlJMfxKm3HcBkYHNl+RFzJ9/PYo+tULcorVDQDCi/v8dEEuvx+GjyglQR6VGGvO1E5cvKkIj/w0bUi3qDXFoqbhE3+odTkWx/7CyVBXAsqrQXlj/iBbHHyhyun8A7oJMs89M=;7:cdegy8eWK3ewG2GP4bA4cXnErWstRJI8OWovnKjQYfMhBgCykjNB7UyMjCOwBx7IL2bgboUaqKX27fLZ72jZ4ixVdrHBQgrF2k1Ysj6ZwZoblIjHf7NlkONzzUGOVyZzFX+SdcftHfhYnt3amlB4mHkEyhThzyb4kYj1OuHG+hUxlbBWMVm32NlKZGat4jKDORIHO1/EJZgCDx6rLkyGAgw+Clw0tErMSeQpLoTqZk66HvI6jF/2h1P49u5WhdAt SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2018 14:30:30.4534 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7f069c12-286a-43c0-e3d2-08d61b17ca09 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: BL0PR02MB4466 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 v5: 1. None 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 e18f9b9..b2d68f1 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 15 14:29: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: 10601461 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 D021914D6 for ; Sat, 15 Sep 2018 14:31:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0E1E2B7D0 for ; Sat, 15 Sep 2018 14:31:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF0B42B842; Sat, 15 Sep 2018 14:31:06 +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 52C982B7E3 for ; Sat, 15 Sep 2018 14:31:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728078AbeIOTtz (ORCPT ); Sat, 15 Sep 2018 15:49:55 -0400 Received: from mail-bl2nam02on0052.outbound.protection.outlook.com ([104.47.38.52]:2531 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727291AbeIOTty (ORCPT ); Sat, 15 Sep 2018 15:49:54 -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=+a6g0z3IhGz+hFHlwJszfJpzjxTMVuw8QXQm62YGiLU=; b=Xuh18fYxdiuDgGrprtCW7bY1n5Xq6DpR3nVpdmKji8YGRuIj9Sxw3fZfN6WqzMXPDz2/fph1KRcIRkC7wSlx6rE157Y0X4QsWSaJbWQXhfH2JA5QbO4KMB7J00t8pRci0JKLtGVas2SQFSrTs9PgAr872412lWNpHS8YifYri5M= Received: from DM6PR02CA0010.namprd02.prod.outlook.com (2603:10b6:5:1c::23) by DM6PR02MB4474.namprd02.prod.outlook.com (2603:10b6:5:20::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Sat, 15 Sep 2018 14:30:41 +0000 Received: from SN1NAM02FT024.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::209) by DM6PR02CA0010.outlook.office365.com (2603:10b6:5:1c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1143.14 via Frontend Transport; Sat, 15 Sep 2018 14:30:41 +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 SN1NAM02FT024.mail.protection.outlook.com (10.152.72.127) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1164.13 via Frontend Transport; Sat, 15 Sep 2018 14:30:41 +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 1g1Baq-0003U7-TM; Sat, 15 Sep 2018 07:30:40 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g1Bal-0004sf-Pb; Sat, 15 Sep 2018 07:30:35 -0700 Received: from xsj-pvapsmtp01 (mailhost.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w8FEUOWV024958; Sat, 15 Sep 2018 07:30:24 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g1BaZ-0004qO-NK; Sat, 15 Sep 2018 07:30:23 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id DE921604BD; Sat, 15 Sep 2018 20:00:22 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , , Anurag Kumar Vulisha Subject: [PATCH v5 6/8] usb: dwc3: check for requests in started list for stream capable endpoints Date: Sat, 15 Sep 2018 19:59:59 +0530 Message-ID: <1537021801-23896-7-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1537021801-23896-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1537021801-23896-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)(376002)(346002)(39850400004)(136003)(396003)(2980300002)(438002)(199004)(189003)(2906002)(446003)(110136005)(16586007)(186003)(54906003)(90966002)(316002)(126002)(476003)(336012)(486006)(106002)(11346002)(426003)(2616005)(106466001)(63266004)(50466002)(5660300001)(26005)(6666003)(48376002)(42186006)(47776003)(39060400002)(305945005)(107886003)(76176011)(50226002)(81166006)(14444005)(81156014)(36386004)(6266002)(51416003)(8936002)(8676002)(36756003)(4326008)(52956003)(356003)(478600001)(103686004)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR02MB4474;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;SN1NAM02FT024;1:q0U3HFt6dkIetY5UCsw09/tUfTARbOwPaHQQ2Hl4lswRypaN2kLYrgAKfwiBoqwSu37uniwkhqYLVGHP60O8QMBTfPFw6Tg+fia9NiG43lVe+p2GuzB7ZtPyJSdOeTTA MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cd5651f2-0e99-43c1-c0f4-08d61b17d085 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM6PR02MB4474; X-Microsoft-Exchange-Diagnostics: 1;DM6PR02MB4474;3:Y2OyIpkW4buzcwtLKnukmssjPdvWG4zACBe1gX+2mAdpjzTURrMeRKh7jvFDYarg4qGvd7RLjoTj3K5kcno3/i0T9A849f6q2f3hKvj896yQiPfvkzYTaUgIiwt+fguV21AiiCHgpeNl53YXw6C8uoYuF6FWNeP8FmSmScfnhepB8GSsP0Fr6jVjg4YOaw9U8wDocn0KjThRwoEw2xcPoCw6ubz6m/WNlku6CgCSNfqixZ5lRaP5e0nqRUJ62Hl0rb8erM62pKJIRqE4gBJVpTLunv4IIvFiWoS9z8rjKV4S69oeDPUVjTSA3dkRsjbcujksONiugi8YwAB9EswDS/bws3TTxgPyu/lQr8SAruM=;25:6BORBIX/mkohoRS9nYdWzbs79vmgxosX2uOs4mMrIDfCNHO3ZidLXSxI29NQSqFVWYREnBoqUUSxpJ2UgcR2SY0ogk+TPeOTn0fkSEXo3WncBYo8m5IgabVL7NWNjSBQ75tMVq/pwHe9gqBfBuAA0jPAYQqWzNauz6at4GVgW8qN+k8229mUrT2HmNZpx1FwIDKuRTVKqIS/kdyrTHO9TkOI/XOTzIIQzTwLAz0tmEH44lpgj/vL7EW37zj96DD0LAcWo4fbpQxFql/aT2UQaUdB0DAupffJ1kDomlWnYoq1u072Woeu3oVpfRLC18hrW0bzpS0rEQ3DrMeKx2ennw== X-MS-TrafficTypeDiagnostic: DM6PR02MB4474: X-Microsoft-Exchange-Diagnostics: 1;DM6PR02MB4474;31:vki6+dYWxxDUPsjM1jQ6UfrJFx9QD+1KqyGr/ZYOp5hgHopfPqgMe3+7dLt6uLQoJcVQKIy5wOtq8rVgv3wK4CU2CWWs5/lawRy9lqWMnmubLmB0z7nfSei1q6+Ei6zwGbhGBD0ATi/FcNWPTYprYY/unVoxA9J+DnkaNaT8JwBkmB2LGlcCr0frbRWQ2LSq+nOWHNPKLfbf8+NJKgY66SGMHcJZt356TVsaKPCb/0s=;20:mQOHLiIJ9vhiYZFXKb7ig6rj3Ggfvh/IXTqCc0L14yDbEB5ysWkuYJ2qPG1cQk21AHTYPhwG1uaEUp+/Ckr2eQzIXTI4owWiNalL7JAkSzvy68hU2OpEEt0R9oNgpoWuD3lF3mBWlOibMaOl2BuFK0YkHJeWIKUQ2m8qUN90FLuEUfrSR/zfquf7qJEADK8xoXvFa3OV8djkKXFsFPVSpl74Nzp1sQXwt+yNwZMKI2la2utcFFM4ZviX35wiPzp8QdYkhx9nDUC5t6J2tZ9QLrOExqpNY+fxZ10TfUAMmFknQ6xgeTHb0dty0ZwzyhvTqxpWFUFjc0hrPcr+vzw6UXS/VSlNnH4IMRYOzyPwV33je+xrTyYmJIeD99ALblTN8yJYitrbniQeS7l4tV0lgb/goed53y9EYD1HTbIGBbdmSk8Y3zUiiQRebXyyGPvHQKGxwL2s35+ns5UHL8KdpPrWiVzyiKJxdsPwPQpaq2YoxFIjCUTlfpvmjBbepfmP X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93004095)(3231355)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(201708071742011)(7699050);SRVR:DM6PR02MB4474;BCL:0;PCL:0;RULEID:;SRVR:DM6PR02MB4474; X-Microsoft-Exchange-Diagnostics: 1;DM6PR02MB4474;4:QvuybYiHU0udOUSqBsGWeUSMAkBP/M0p7Ah2zVYRGmjMO7Kl33YEdZ+h9mrvDJie8KGiVgjdOX/xQ1MM5w7wmoXgFUhGrISzRlwHPVKNAYy/VCoBg20Hod/PXYm1hP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d60Q5TrHZSCQp7/LLdiZEkgxbeYvS3oRrrqtshTPmPHzaxrgz6GYnhlPfK4swUzSdwBk2Lg24DKRgVe00j7ElWBD32rovsSud8X+9I6dxCP6sOQXmheAJ+2VyS/QEPgHsLfdR4Sq91gdtSgC3exh7+UJJPRFiVY/ntZ9ngA3t1SJcsAhxRzzpeGytNMtM46Mlvyh3SrZjElU7Mg==;5:bF4D+Q8FiFjdrMM5sqixr8aQj8n/Va0GR+y/Z0OwD1XzqTH+crGXI10D3swuwvym98E4NsiIj0xZ7yM4rlN8QFdYV9JuNzxivaxQbZB6LOEdH1rfB0frs5rXSvjhpj/ZRnDj1ccchkC9AaJqW9FXIAH0ezNgJbiWCmI7Hlid8AM=;7:tf0npyW0liXrcCqY/95lg7BiEmuN0eQjKSyr4+jCnSewOIH3zNw7Bq93pRkdVjN850kjMoCCajrsvHmM+ItLFqGC9h4GMhGbm0OdjBOBRNEkfpz6Ay8qsjo6MwZBO6/yVS6zN1rYhKgpN49tAAFFw8bNctdt27na1Rly8nGEoeuOGYdmDvCrG74iE3aPIwj5rNRyAggz/va85sHONKP245g7GFv/rFNMug+rAMjUwVHSGuGsUhk3k0MZtF6tGHyd SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2018 14:30:41.3295 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cd5651f2-0e99-43c1-c0f4-08d61b17d085 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: DM6PR02MB4474 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 v5: 1. None 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 b2d68f1..1cb7df9 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 15 14:30: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: 10601457 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 D915C14D6 for ; Sat, 15 Sep 2018 14:30:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8FB52B858 for ; Sat, 15 Sep 2018 14:30:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C69492B7B3; Sat, 15 Sep 2018 14:30:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B33F2B7B3 for ; Sat, 15 Sep 2018 14:30:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728162AbeIOTuA (ORCPT ); Sat, 15 Sep 2018 15:50:00 -0400 Received: from mail-sn1nam01on0057.outbound.protection.outlook.com ([104.47.32.57]:4224 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728089AbeIOTuA (ORCPT ); Sat, 15 Sep 2018 15:50:00 -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=YR4ZtAMKW5HOR64i5BnkqO7WlwIfsS6Q8T3WMRxy9ws=; b=m3MT0DHOKy68KjjfCTebrZ5Y+8n1a9XZxtsmFBz75/9zE5+k3M14zPP8J3GEOJaSLWze+h37xb4bTnv08sz0gxoOblFjHf2KEek/b6G10F8q/WKF3FE02OdwSQZIy7ES5ZOwV8EBED6IQI6E61zJBXf1aJfUQ+x2lLGAEl55AB0= Received: from MWHPR0201CA0064.namprd02.prod.outlook.com (2603:10b6:301:73::41) by SN6PR02MB5120.namprd02.prod.outlook.com (2603:10b6:805:68::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.14; Sat, 15 Sep 2018 14:30:42 +0000 Received: from SN1NAM02FT022.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::209) by MWHPR0201CA0064.outlook.office365.com (2603:10b6:301:73::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1143.15 via Frontend Transport; Sat, 15 Sep 2018 14:30:41 +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 SN1NAM02FT022.mail.protection.outlook.com (10.152.72.148) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1164.13 via Frontend Transport; Sat, 15 Sep 2018 14:30:41 +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 1g1Baq-0003U6-OO; Sat, 15 Sep 2018 07:30:40 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g1Bal-0004sf-Kx; Sat, 15 Sep 2018 07:30:35 -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 w8FEUOGS031555; Sat, 15 Sep 2018 07:30:24 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g1BaZ-0004qJ-Vc; Sat, 15 Sep 2018 07:30:24 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 9C1F9604AD; Sat, 15 Sep 2018 20:00:23 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , , Anurag Kumar Vulisha Subject: [PATCH v5 7/8] usb: dwc3: Check for IOC/LST bit in both event->status and TRB->ctrl fields Date: Sat, 15 Sep 2018 20:00:00 +0530 Message-ID: <1537021801-23896-8-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1537021801-23896-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1537021801-23896-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)(376002)(346002)(39860400002)(396003)(136003)(2980300002)(438002)(199004)(189003)(6666003)(81156014)(47776003)(305945005)(5660300001)(42186006)(106002)(336012)(16586007)(316002)(51416003)(356003)(8936002)(4326008)(103686004)(106466001)(81166006)(126002)(2616005)(110136005)(39060400002)(50226002)(54906003)(11346002)(8676002)(426003)(6266002)(446003)(76176011)(486006)(476003)(63266004)(107886003)(478600001)(186003)(48376002)(50466002)(36756003)(14444005)(36386004)(26005)(90966002)(2906002)(52956003)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR02MB5120;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;SN1NAM02FT022;1:wFHuneXmt4kNbpeteXPIzl9g5ubpRs9wRrSK+bZttOBvzioAWILD7RxdB19qmPQ2aHm3mtEbB5pgOp+9pfO0Ku2aHeOs2WQ+AQUWo4EOiv3TOh7e2AvX0H+YqctKdq29 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 364d41ed-52c2-42df-e2a4-08d61b17d068 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:SN6PR02MB5120; X-Microsoft-Exchange-Diagnostics: 1;SN6PR02MB5120;3:+BYK2ntAaJV9YFnNeYOhF2rHK6SPDqaifBp8lZEpwckYquZiuH893jI5MDJnx00KS2yIezS7b9u3zo0286gTarVvKHq8uiWeVyreiy7rI+Ka3gsmCfeEhaTCIRtwlNOzl6lCOeL8bkCoVz6V8Jl655JgmxNsnjg4XvmcKHnMxl89VBaE/JEitjGcxFH7iIBrtuq2ayMa1yT+wHAlg67stdzMjitoTWUnwD6nGH0imzl57PDbLRoCA4zCBg40XraWNu6ebEpH8y/aOMKurMerbCWn4Z2uWT3xL4tiUQ7AkrSkFZZkVoFNdSLvVsOj3W87xcrb0R1l6Ikwh5KsXYx1cMcClLJxOVQK3SiTiWCUnus=;25:X6yMPBEWy8u03deucFsF8PYCarUO0ZpbqOfNNLwFpVzyAT6+GTlpws7pQ7u+8lKf6mdG85kF7fRcDf/0WWJ/iFaGHJP3sUGBN8Uj2RsAOFdsUX4hi2AaAY0ka/I8JL4p7L7P0qUgRoVlL1A39jHofckOlkmi4MZLevqqzQJKCsblKhzmRHy6KJDISpDuPUhDMzStp7fyts9JrnQ3f0h7qV7cYPKS1vGqse05XIuhgO1GSbgHjGOWBfzwglyKZ3UQeO990hLvqndff2B2BLTrPONqTklHR8O+H+0KxaG2uKwYngM6SA0HrNJorqp2frRHr1QndGURY8S5YovF6q/q5g== X-MS-TrafficTypeDiagnostic: SN6PR02MB5120: X-Microsoft-Exchange-Diagnostics: 1;SN6PR02MB5120;31:XV/3ET52kuGPXW6vipXaFIBpxazka1k9KTYBSmAs+mQIn1lt3IR6Vuu6O0xnkJnKwjcpsxiYwiMop007x27cjW5ThyBTdAHL5VYU6iaubHBW8dsoL12nJSbQI1ZN7QwrofRG1NwexPtBJKul0jMR0G8VNa20t2F5ZLs/pyCVWzUs3860aH9PTK/yXu1POJtptwiLjz5+fJD4IcfoyfLOO/pUu5coNs6yN0aMZv3FlFE=;20:B7dyp7MKH/3tJ4l2he0pPWiEKwArU6HY3+Tdrjc1SeZ0nRpHzvhi4DaKQ7zrN2Zj0mnHN7owlM3/GBdxkLlp9i1ovhvm0ntqNVXjP+wpuLTjnMplh1pCj2J7SmEC8LP1HbdOzUEcWUk00tuUXoJnph4YQ20Xl0S2liJwvzb/rwFo/3v4sBpSF7Z3h7qRzFE2yTKVC0/6Lj1RLRyqprMpCKZ1QpiI9iuo2HcaSOELxAxnruD0uGxUqMciuv7+34k9G/qu6yiBIkB60qrigrUk3QzI7EZmZGwZkBBIki2piEoFqCNvGxGazDI5yDJJIn+vBvX9+CUfYWud85t/XEekDUIPPpR7YM60u5ICk9CMIl2gbPFw77Sdf98rwktrFZvpPD4UkzAwdrh4Gn1Pu2B0rCssDrRTo+VOUqh5bBCqjNfCMUIR6KlmYg53qC0e6N9KMEePppQSUayb2XYnUSM9pPAtxeXGlWzIYp3JsW0hS9P5duvkBOi6vgiaUOBsWXcn X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93004095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699050);SRVR:SN6PR02MB5120;BCL:0;PCL:0;RULEID:;SRVR:SN6PR02MB5120; X-Microsoft-Exchange-Diagnostics: 1;SN6PR02MB5120;4:ckrfPdxZ15e+k5b9idEct6DRK4VqpCnee2rJQpVYs0Rn6OQ1ufDa7iWRSbaL68WuBE8bt6IEXmBZR9MWPN/HnSXchnv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mlQCd4pKIENrsFCxmQdlAlQh1Xh+KEVS7pO3EV0wi8TIXAUGWB8+6bubBZEf6I0ukn2Nn8VvnhzG/wEUOBXlc6yHqmiqfShIgeRet6ZkFs7N5aLoMvQPtrERIglCBGbifYNMHbOEsoQ5Zyhb8HRNmbkTOOZAXyh9jHO9eUUSi2fQ3UXMyAt0boKNlB8x/36S3tLljyBGtnyFS/s4qyYpAqbiZNLikwHVN8qPhmsttZJdH2nuPpsan9WX0GPQ==;5:Td1/5vYADaNQhK2Z8qPHjIqb5mE1HtgxADUW8MNlG2Tlbci8W8pwvnMcIHi+0YVwGozWdZAmJdndllT5rwBTHi4MFyAgFW/aVPQ/THjqMRdLO5ZwBjgCjQpkkISWdM9FezSkAouWvegzaKsFq+HZ30xoNW6nlZfaoWsJwQkeUCw=;7:HeVFk2Eqkm3Oi/YWVS0d9CoY2BDI5anBzynNNjekD7LFUoAemD9KvsrYJXssYBizPcuvr8Y2f+Duc1tpdkGAmjIB+FkkAdac9QO1wLXLihxSGgR4BQdyqSUGtN+N9izmUgBrOxtL8ytRIKzMC/xC00+IkMOCnPtUpGAGwEcQ6nfOKZC/hWWvuTS2GqRd0mtpPC6UN4fHyMo6vBkUR45hu0Jix3qJ9oB86t8PBkW/x0iPwH1eVrdDM+itf7EXUEsq SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2018 14:30:41.1423 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 364d41ed-52c2-42df-e2a4-08d61b17d068 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: SN6PR02MB5120 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 v5: 1. None 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 1cb7df9..872c956 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 15 14:30: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: 10601459 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 AFFF414BD for ; Sat, 15 Sep 2018 14:31:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A045D2B863 for ; Sat, 15 Sep 2018 14:31:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E3FE2B880; Sat, 15 Sep 2018 14:31:02 +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 2E95E2B870 for ; Sat, 15 Sep 2018 14:31:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728133AbeIOTt6 (ORCPT ); Sat, 15 Sep 2018 15:49:58 -0400 Received: from mail-bl2nam02on0065.outbound.protection.outlook.com ([104.47.38.65]:40320 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728084AbeIOTt5 (ORCPT ); Sat, 15 Sep 2018 15:49:57 -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=VWV8MPJ6lpw7G2tyYwuu+XWCPTqaGoVljnfE6oMMvW4=; b=4cA8OOZ347PeTZ6RPwqJiTlYEwNna/wYl+5NHR9ID4JIzcDUOVmL8B4rVli7MGvQBjNFd6XYXdbeBQ5ZnGgK2NWD7kqlCYgkyN4GQ6LHqUOiwlcmzjccBMiWN7oJ4sjvyea1y5P2qjnma7o6uHCJkJ7Dg1AWD3croACS6zwH3qg= Received: from BN6PR02CA0041.namprd02.prod.outlook.com (2603:10b6:404:5f::27) by BYAPR02MB4469.namprd02.prod.outlook.com (2603:10b6:a03:10::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.17; Sat, 15 Sep 2018 14:30:42 +0000 Received: from BL2NAM02FT033.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::206) by BN6PR02CA0041.outlook.office365.com (2603:10b6:404:5f::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1143.15 via Frontend Transport; Sat, 15 Sep 2018 14:30:41 +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 BL2NAM02FT033.mail.protection.outlook.com (10.152.77.163) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1164.13 via Frontend Transport; Sat, 15 Sep 2018 14:30:41 +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 1g1Baq-0003U5-My; Sat, 15 Sep 2018 07:30:40 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g1Bal-0004sf-JI; Sat, 15 Sep 2018 07:30:35 -0700 Received: from xsj-pvapsmtp01 (xsj-pvapsmtp01.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w8FEUOCQ024962; Sat, 15 Sep 2018 07:30:25 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g1Baa-0004qO-Ln; Sat, 15 Sep 2018 07:30:24 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 53A57604B6; Sat, 15 Sep 2018 20:00:24 +0530 (IST) From: Anurag Kumar Vulisha To: , CC: , , , , , Anurag Kumar Vulisha Subject: [PATCH v5 8/8] usb: dwc3: Check MISSED ISOC bit only for ISOC endpoints Date: Sat, 15 Sep 2018 20:00:01 +0530 Message-ID: <1537021801-23896-9-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1537021801-23896-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1537021801-23896-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)(979002)(136003)(39850400004)(396003)(376002)(346002)(2980300002)(438002)(189003)(199004)(6266002)(47776003)(217873002)(107886003)(14444005)(126002)(2616005)(48376002)(90966002)(476003)(103686004)(486006)(16586007)(39060400002)(446003)(50466002)(11346002)(316002)(478600001)(36386004)(42186006)(4326008)(186003)(8936002)(81166006)(26005)(81156014)(305945005)(50226002)(2906002)(76176011)(63266004)(51416003)(356003)(106466001)(8676002)(5660300001)(36756003)(6666003)(110136005)(106002)(54906003)(426003)(52956003)(336012)(107986001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR02MB4469;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BL2NAM02FT033;1:2zEqVzWYA2UGaNgO/fKO1KqjofhuW6gINACB7rU/UIQokdb02YrTh10cl5SDGA1trsOGcMTqQJmLf5KRkk+guKEkD4DMxlp5bSZtWW2cmmNIHQ7+DbLx/gDF+J0pbsWi MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 67c7b455-cea8-4b1f-de6d-08d61b17d06e X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BYAPR02MB4469; X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4469;3:TFJv5qgPJAZdwMQ7z+OosLsVfac3mV5PYsSg6cDkL6H851Tqy7Ol2eb+puauKJB84EZ24KNjofd5AV5+n6cDhYPg9iATD0V/+IIBwCa6mISnjvjz6aSa7/B/VNVHWmRMf6bcnMZgrrgKr59KHLwp/qv8HHipQpVb3KUlXwqXiCKdvYEmAX1D5S/p7Nomgzm61BqnTseihPeymWciPxch6OYhmru7/CWzf9q7ZYzCGq4x6mwjTFntYB6aTpkQGfHhUYkWtAf8Ow+ozWmADanmM+TaMWjJfJp++osZdO35ANcqcHL5aZTE2CMkaWF/ifzyEz0xxchhMVcpPOtQ4GsQ8m1QKfGSl29evl8MVSjy88c=;25:1eVKV6b0pLliigx/NDiVkF0aolmQiqC3V/Hmmz6j10oUaMcYcx1/8Tj71o+IGBDdxKs15brfhLOA/d6dJBPZDd2TxsdVSTvzqSXhtzo2rr9+EbON2Mscn2b5Q1fbSrqbKWEDs8cg/qNB65wdOUEAcEW1LJAxSib3gwuZDCiXRotTPfQeRE8AqL0oE2mMCrYFcTThU75gulpZJZoLH/+D8urond889njJVKC6QDHvKSP0Q9d0OtGsn08fkobS2fFRSmoBHWqh5TPwiEi7TA3AjAJ1STyJCYlzTt3NY4ACwmiWlxXJWSEJo7YayhDmwMEo9uZ8gN3UfOUCOgnuaH/mMA== X-MS-TrafficTypeDiagnostic: BYAPR02MB4469: X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4469;31:FEcxeWtTa+DMn0BmnhJJl146zk6JYGjmdEX35lebfHgrvIkfhoiKmQf3a6h4yagHuxbOu95j0J99ZqSUJi1oi2nFmfAC85rJmAMY0cP4mHBHqJPWHBgRpXujSdaFy6rMabqVDeC2JNvp0b8w5WNIOnv2yi0MrKUt2fNs/RwhLLnYUOZTUSr+Vyh8xXP1jlu0UXjYJyR9VT40K6E6fukI3Iihymz0jfw16IsZclFp258=;20:ha/ibPvMG+MNP9pdBY0Z84YDZj2ce/CQX5fzC2MRMFCGZhViGHP2TW1rQY20+dtvsmaoZE9UC0nphVKWOCL8ytstgs//zaeoxBlgdllDgqXqRg0l/sGQgymeEV1i38fTKDdXx2PyOvUv6lNu8rKO/PnMRbRlKsjdZ0mKQxt+zn3wMQtQRYYO7i8GcOUx4NneGb3S+pjRVbLFOkKV0ZVRBVq7zp+Koyk9avyKbSzMJ6Oyh/NR2/IFlfvZoHruSfGWldqm+K7kwA1kH5nez3XcpBzTEV+JV+CKt7KsDhlLF6yuhi00PDB8jbZA+lxpCDG8kNc9A2yvCGQY1npmuv8y5Kni8ni+d5GzidzLXdzliJiJp8jeYaiFlcFIMPTUZJblmlg/+NZ3PXN+OitnVcpmB/WHwKAHftJBaiJwgcw0aYodGBt2yXwt/M8dsq06TgqgXyBBj25+bmozx7Pp19NTsNyiDp0E7DyAHyubhkXXBZdFvYmCaUkcFqM3M/noGBF6 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)(3231355)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(201708071742011)(7699050);SRVR:BYAPR02MB4469;BCL:0;PCL:0;RULEID:;SRVR:BYAPR02MB4469; X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4469;4:JndJ/dpo5NwWXpzOhuxNKYYHa60ukurkas9I7503V6tP4aJ+LoopSSnfH6Z7AeLiGyTgT/2RQoL2IuaI6oI+nt6b1Qj9mTE2eSayVihZzWGOdgeK3d/xnDfOjIo98upZzhFG67O3/ZEo0QH3xYUijxr8ffxtWlT5mXvAbywXRhxu1gaEt8vycm1mvwNPacX/Nz9NrGmFsAggzbD6VIwAvlm1brH8xPLtQGPUYlidVDdOtpZlhmyR0n46E3aT7NTTknBqFTeroqzRnF4NG1OufW/nWGpyigxSCtX/FdgnD9krQcOV/grRbjmpueYyjjAG X-Forefront-PRVS: 0796EBEDE1 X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4469;23:3pRJZaklEt0uZtrofVrll0+/quEUgP838GXnXyWy8wDCm5pdl+Y1P/JOTHj58l70Uw2McIXmhWUmIFKstsuNksezBhX9IfiecnqDrKalNwHoZFe5Q8xp4SJcTpsSg49QUZlxuBVPrrREgC+FVJ9B793qAJ91AaHsZ4I9MrY7VAjR9rFvcaxdL8Ou8qBjqHyQwjO0qDaFhiBg5EjN9CbjxPW8AuYNsLT9sLiPNAxQ25nJvVPCo4WpPP75tkGEs6gzRTjuxOWeHOdzZ1zCrutfi8B3i7/Tpd0TsTe4z4OchS+X0n4yrwCjNNlOaa2aeqCnGFX8LzNFb/wAkb9LToifcN+XRV2mJ80qMCtNJ9d3qYZhAANFK61qvwQHrWYSM59NtghLkYyOpqCeio60AKYe3kXDivy1j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S9003Wx1MpC4sqE6vaUo1qxToqooeg3M7s4VosVPPRvMlRYb/wW5ACj74Zpo83ORPA4jZYc+Qrq+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2018 14:30:41.2909 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 67c7b455-cea8-4b1f-de6d-08d61b17d06e 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: BYAPR02MB4469 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 v5: 1. None 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 872c956..0b6d859 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))