From patchwork Thu May 2 10:20:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anurag Kumar Vulisha X-Patchwork-Id: 10926497 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 A9AE81395 for ; Thu, 2 May 2019 10:21:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98D1628FEF for ; Thu, 2 May 2019 10:21:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D71E2903C; Thu, 2 May 2019 10:21: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 2C58028FEF for ; Thu, 2 May 2019 10:21:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726491AbfEBKVB (ORCPT ); Thu, 2 May 2019 06:21:01 -0400 Received: from mail-eopbgr760055.outbound.protection.outlook.com ([40.107.76.55]:20903 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726282AbfEBKUn (ORCPT ); Thu, 2 May 2019 06:20: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=uHWm5odc+KcTZH3YI654YZlYvxAInG4O9tjEbPeZFu0=; b=4xCgCWRd4/pPCxVm0gCy4/cDF6lt9HdhIIHAvGuSDyXD0FlySgwlLc8Rf+MM58c6pTDyAoENk0Q3VsUMTf27yMF375CvMbMNeg7rntOHMd/L77P/vo1ReH29+9NvUfm+MSpYu38fPW2OwhpNz50AuQHdbSifgdZ8T6IpUX3aXJ4= Received: from MWHPR02CA0056.namprd02.prod.outlook.com (2603:10b6:301:60::45) by SN1PR02MB1664.namprd02.prod.outlook.com (2a01:111:e400:5230::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.15; Thu, 2 May 2019 10:20:40 +0000 Received: from BL2NAM02FT019.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::208) by MWHPR02CA0056.outlook.office365.com (2603:10b6:301:60::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1856.11 via Frontend Transport; Thu, 2 May 2019 10:20:39 +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 BL2NAM02FT019.mail.protection.outlook.com (10.152.77.166) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Thu, 2 May 2019 10:20:39 +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 1hM8pS-0004RY-Ay; Thu, 02 May 2019 03:20:38 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1hM8pN-0001np-7G; Thu, 02 May 2019 03:20:33 -0700 Received: from xsj-pvapsmtp01 (smtp-fallback.xilinx.com [149.199.38.66] (may be forged)) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x42AKPPE023310; Thu, 2 May 2019 03:20:26 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1hM8pF-0001mh-JY; Thu, 02 May 2019 03:20:25 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id C4B46604DB; Thu, 2 May 2019 15:50:24 +0530 (IST) From: Anurag Kumar Vulisha To: Greg Kroah-Hartman , Rob Herring , Mark Rutland , Felipe Balbi CC: , , , , Anurag Kumar Vulisha Subject: [PATCH 1/3] doc: dt: bindings: usb: dwc3: Update entries for disabling U1 and U2 Date: Thu, 2 May 2019 15:50:21 +0530 Message-ID: <1556792423-4833-2-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1556792423-4833-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1556792423-4833-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)(396003)(346002)(136003)(39860400002)(2980300002)(199004)(189003)(356004)(36386004)(316002)(81166006)(126002)(16586007)(81156014)(5660300002)(50466002)(42186006)(486006)(6666004)(110136005)(106002)(54906003)(70586007)(11346002)(446003)(476003)(2616005)(76176011)(426003)(51416003)(4326008)(103686004)(48376002)(36756003)(50226002)(70206006)(15650500001)(63266004)(478600001)(6266002)(305945005)(26005)(107886003)(186003)(47776003)(2906002)(8676002)(90966002)(52956003)(336012)(14444005)(8936002)(42866002);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR02MB1664;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;A:1;MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8ca6bb95-c26a-48ce-0140-08d6cee7d31b X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:SN1PR02MB1664; X-MS-TrafficTypeDiagnostic: SN1PR02MB1664: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-Forefront-PRVS: 0025434D2D X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: L0ifOevl715FSUgfmpVK2RxLYaIiY2JxpzOrIMt/TExFnELyfOhBEpPSPPcdzt8za94CPjG3qpUq3Bj6jhcLVt97h9QycX1yi6WcZBsMCFMcMrnZw06oAqTny5n3H6OI9fOad9zW4EvkiJ80lVz38CW8stkb5/nB8jKg4aTAvgrtGSUGzE4ZVpAMxOsxM763zrR1PCb9MMq8tl6g3GPLlkBFUPbwIE74mke8oNfnACwat+WKz9LfNUvCbnAp4GkDhIc2RQ4jyG88jWvK+KfeI+m23/SwWNHWa+3dlK/CV0Ic5QdJYVjRzLTWMX1huSvEeSCoYpEVqzPW5LaMUnSI0boTPePGTFADgcMN8+pGzm/Rzc7F2oujCVlcM4Yd/DQ+WHLZrOuUbYHEabsK0FWb2QdYt2fOY/3aNmHPF5cBylM= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2019 10:20:39.2312 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8ca6bb95-c26a-48ce-0140-08d6cee7d31b 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: SN1PR02MB1664 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 This patch updates the documentation with the information related to the quirks that needs to be added for disabling the link entering into the U1 and U2 states Signed-off-by: Anurag Kumar Vulisha --- Documentation/devicetree/bindings/usb/dwc3.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt index 8e5265e..b087248 100644 --- a/Documentation/devicetree/bindings/usb/dwc3.txt +++ b/Documentation/devicetree/bindings/usb/dwc3.txt @@ -64,6 +64,8 @@ Optional properties: - snps,dis_u2_susphy_quirk: when set core will disable USB2 suspend phy. - snps,dis_enblslpm_quirk: when set clears the enblslpm in GUSB2PHYCFG, disabling the suspend signal to the PHY. + - snps,dis_u1_entry_quirk: set if link entering into U1 needs to be disabled. + - snps,dis_u2_entry_quirk: set if link entering into U2 needs to be disabled. - snps,dis_rxdet_inp3_quirk: when set core will disable receiver detection in PHY P3 power state. - snps,dis-u2-freeclk-exists-quirk: when set, clear the u2_freeclk_exists From patchwork Thu May 2 10:20:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anurag Kumar Vulisha X-Patchwork-Id: 10926495 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 2592F1395 for ; Thu, 2 May 2019 10:21:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 138D628FE9 for ; Thu, 2 May 2019 10:21:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0762929026; Thu, 2 May 2019 10:21:01 +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 9F17428FE9 for ; Thu, 2 May 2019 10:21:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726378AbfEBKUn (ORCPT ); Thu, 2 May 2019 06:20:43 -0400 Received: from mail-eopbgr820081.outbound.protection.outlook.com ([40.107.82.81]:11320 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726231AbfEBKUm (ORCPT ); Thu, 2 May 2019 06:20:42 -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=nErA9Gi6a7HA1SvAFAogtav2olwJyC7a2e/Rk7IhEIs=; b=jMW4EVCXWFxihYtLlJzkv6s+qWWV7OV69nsd3DiaxuQ3x1Ditk27Kf5fxTj4cUNnBHkfcMk8YnVzW7VXsSiRUuWoceew9mpSiDHvIvr5Gn3kLICubVULW9nqqN3o+z+BMLw+pVmVd1w5c2Y1NK350WF8irfm7vQTRAQXymGZ3Ls= Received: from BL0PR02CA0021.namprd02.prod.outlook.com (2603:10b6:207:3c::34) by SN4PR0201MB3406.namprd02.prod.outlook.com (2603:10b6:803:48::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.15; Thu, 2 May 2019 10:20:39 +0000 Received: from CY1NAM02FT054.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::202) by BL0PR02CA0021.outlook.office365.com (2603:10b6:207:3c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1856.10 via Frontend Transport; Thu, 2 May 2019 10:20:39 +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 CY1NAM02FT054.mail.protection.outlook.com (10.152.74.100) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Thu, 2 May 2019 10:20:38 +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 1hM8pS-0004RX-4Y; Thu, 02 May 2019 03:20:38 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1hM8pN-0001np-0j; Thu, 02 May 2019 03:20:33 -0700 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x42AKQf6023314; Thu, 2 May 2019 03:20:26 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1hM8pF-0001mk-W2; Thu, 02 May 2019 03:20:26 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id 2AEA6604FE; Thu, 2 May 2019 15:50:25 +0530 (IST) From: Anurag Kumar Vulisha To: Greg Kroah-Hartman , Rob Herring , Mark Rutland , Felipe Balbi CC: , , , , Anurag Kumar Vulisha Subject: [PATCH 2/3] usb: gadget: send usb_gadget as an argument in get_config_params Date: Thu, 2 May 2019 15:50:22 +0530 Message-ID: <1556792423-4833-3-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1556792423-4833-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1556792423-4833-1-git-send-email-anurag.kumar.vulisha@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(2980300002)(189003)(199004)(478600001)(50466002)(70586007)(48376002)(6666004)(90966002)(356004)(36386004)(76176011)(51416003)(5660300002)(305945005)(14444005)(19627235002)(47776003)(107886003)(11346002)(2616005)(4326008)(446003)(476003)(126002)(486006)(426003)(336012)(103686004)(16586007)(42186006)(6266002)(81166006)(8936002)(81156014)(8676002)(316002)(50226002)(2906002)(70206006)(36756003)(63266004)(54906003)(52956003)(110136005)(26005)(106002)(186003);DIR:OUT;SFP:1101;SCL:1;SRVR:SN4PR0201MB3406;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;MX:1;A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b3108167-edd3-4529-6b40-08d6cee7d2e2 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:SN4PR0201MB3406; X-MS-TrafficTypeDiagnostic: SN4PR0201MB3406: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1468; X-Forefront-PRVS: 0025434D2D X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: QQM7kJygwgnO04EBTOf9RsshmV8HDCqssKdkH1c/3qSH5hkuMSiRZ8ZQ2sB+tAa84K9rvSbLyVBzJauxM1Q8S42jbLNXcg8ZTUp3yNTCj2OdXD+rfyxcUfvmmEl1eih6lX+XBNjwGY0OV3URIPyo8hRjXxQXFwQXWRRTwzJwxk2NSemlpYaVA1PLpuFonoPPPSG1oXYQwBjQ8ZTWxuI5P6cUYLjJLbkBDIoWp2ag5+vp19Vrh8FoUZ6R4xjGDTjfxgS7k8hlk8VbPv/tWwCxaNHbbSGRiswEu9FpLWAczE3/M3GRyBs5/YdUJuWzMhzfFQwrJoWJGUGN75RFOe1BOo8mPaw650SHguowsrIvSoU/76li8R3T+Jq2/t5OVKFTiuJj9+ZuLreDs8/uuGxGG2JOxbx+l1ebRVBL31dJRBw= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2019 10:20:38.6131 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b3108167-edd3-4529-6b40-08d6cee7d2e2 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: SN4PR0201MB3406 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 Passing struct usb_gadget * as an extra argument in get_config_params makes gadget drivers to easily update the U1DevExitLat & U2DevExitLat values based on the values passed from the device tree. This patch does the same Signed-off-by: Anurag Kumar Vulisha --- drivers/usb/gadget/composite.c | 2 +- include/linux/usb/gadget.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index b8a1584..9118b42 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -653,7 +653,7 @@ static int bos_desc(struct usb_composite_dev *cdev) /* Get Controller configuration */ if (cdev->gadget->ops->get_config_params) { - cdev->gadget->ops->get_config_params( + cdev->gadget->ops->get_config_params(cdev->gadget, &dcd_config_params); } else { dcd_config_params.bU1devExitLat = diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 7595056..fb19141 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -310,7 +310,8 @@ struct usb_gadget_ops { int (*pullup) (struct usb_gadget *, int is_on); int (*ioctl)(struct usb_gadget *, unsigned code, unsigned long param); - void (*get_config_params)(struct usb_dcd_config_params *); + void (*get_config_params)(struct usb_gadget *, + struct usb_dcd_config_params *); int (*udc_start)(struct usb_gadget *, struct usb_gadget_driver *); int (*udc_stop)(struct usb_gadget *); From patchwork Thu May 2 10:20:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anurag Kumar Vulisha X-Patchwork-Id: 10926491 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 43583933 for ; Thu, 2 May 2019 10:20:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3050128FE9 for ; Thu, 2 May 2019 10:20:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23B4229011; Thu, 2 May 2019 10:20:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E831728FE9 for ; Thu, 2 May 2019 10:20:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726444AbfEBKUo (ORCPT ); Thu, 2 May 2019 06:20:44 -0400 Received: from mail-eopbgr680042.outbound.protection.outlook.com ([40.107.68.42]:12258 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726266AbfEBKUn (ORCPT ); Thu, 2 May 2019 06:20: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=DelSUgzr2E2GjnnLNTRfI/axJe2JT9QGJ4FoqYHMZz4=; b=AdrPn6VfK+fJHyC/8FiOw1LcqX/Z+IhUNsEuxKnSl+TV4jJtuozqf7V6fak018b7i5hO2H8DF//5lRsgGj23hBlIH5cWGa8lKp9mzckAbKsjdEsg1G06F6VxUcgTrk0sHR2twD90M1JiUsjMCJCJrJvz+xQWGeQyIUDtBGFG2ZU= Received: from MWHPR02CA0014.namprd02.prod.outlook.com (2603:10b6:300:4b::24) by DM5PR0201MB3397.namprd02.prod.outlook.com (2603:10b6:4:76::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.11; Thu, 2 May 2019 10:20:40 +0000 Received: from BL2NAM02FT003.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::209) by MWHPR02CA0014.outlook.office365.com (2603:10b6:300:4b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1856.10 via Frontend Transport; Thu, 2 May 2019 10:20:39 +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 BL2NAM02FT003.mail.protection.outlook.com (10.152.76.204) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Thu, 2 May 2019 10:20:38 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:60481 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1hM8pS-0006co-7J; Thu, 02 May 2019 03:20:38 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1hM8pN-0001np-46; Thu, 02 May 2019 03:20:33 -0700 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x42AKRAu023324; Thu, 2 May 2019 03:20:27 -0700 Received: from [172.23.64.8] (helo=xhdvnc108.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1hM8pG-0001mn-Gb; Thu, 02 May 2019 03:20:26 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 15427) id A950A604BC; Thu, 2 May 2019 15:50:25 +0530 (IST) From: Anurag Kumar Vulisha To: Greg Kroah-Hartman , Rob Herring , Mark Rutland , Felipe Balbi CC: , , , , Anurag Kumar Vulisha Subject: [PATCH 3/3] usb: dwc3: gadget: Add support for disabling U1 and U2 entries Date: Thu, 2 May 2019 15:50:23 +0530 Message-ID: <1556792423-4833-4-git-send-email-anurag.kumar.vulisha@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1556792423-4833-1-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1556792423-4833-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)(136003)(346002)(376002)(396003)(2980300002)(189003)(199004)(8936002)(76176011)(36756003)(8676002)(81156014)(81166006)(90966002)(26005)(316002)(51416003)(14444005)(63266004)(106002)(5660300002)(54906003)(356004)(478600001)(50226002)(305945005)(336012)(2616005)(476003)(4326008)(126002)(107886003)(70206006)(426003)(70586007)(103686004)(6266002)(52956003)(36386004)(11346002)(446003)(486006)(48376002)(50466002)(186003)(47776003)(2906002)(16586007)(110136005)(42186006)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR0201MB3397;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com;MX:1;A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7eb54a25-3e62-4eb9-cecc-08d6cee7d2f4 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:DM5PR0201MB3397; X-MS-TrafficTypeDiagnostic: DM5PR0201MB3397: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 0025434D2D X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: nlpRceHzRqY81nsIdArFOZrKAbu0duob81PEVYCiBesWiHvq2kZUPW4EiJAbhoOB0MiNisXntrs4M1cEbvcUtdZqF5Wg97me2C371migSCs2HLVRgIVaompXOpIAfEA+sXQRD0e06Go2Bi7mtJvLOalRMxLhUGisqg+J4yHimRQl9S0ztdY12BINKmuEkL68pY/uMFNAd1zNLiv+zyuU2aZgCanKOmvIuedKYb24k++R9S5/4jNEgEyDU3fBxBbETDPkVWquwoad5lpVfScMk/c4rSBdFtTHBvotsiS2Q8Gt7zu9EhAmUPXU7EN+OvIiMSaN7g9xNmMj9W9J3btnMncUD1wD+AzsQ8hOjJhav7Cc1gti4aIcqV10+Ns9qZZS9mlbFlwd05o6LHODa2cAVsohdGoYMCCeB745AH/kPlU= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2019 10:20:38.9118 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7eb54a25-3e62-4eb9-cecc-08d6cee7d2f4 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: DM5PR0201MB3397 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 Gadget applications may have a requirement to disable the U1 and U2 entry based on the usecase. For example, when performing performance benchmarking on mass storage gadget the U1 and U2 entries can be disabled. Another example is when periodic transfers like ISOC transfers are used with bInterval of 1 which doesn't require the link to enter into U1 or U2 state (since ping is issued from host for every uframe interval). In this case the U1 and U2 entry can be disabled. This can be done by setting U1DevExitLat and U2DevExitLat values to 0 in the BOS descriptor. Host on seeing 0 value for U1DevExitLat and U2DevExitLat, it doesn't send SET_SEL commands to the gadget. Thus entry of U1 and U2 states can be avioded. This patch updates the same Signed-off-by: Anurag Kumar Vulisha --- drivers/usb/dwc3/core.c | 4 ++++ drivers/usb/dwc3/core.h | 4 ++++ drivers/usb/dwc3/gadget.c | 19 +++++++++++++++++++ drivers/usb/dwc3/gadget.h | 6 ++++++ 4 files changed, 33 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index a1b126f..4f0912c 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1285,6 +1285,10 @@ static void dwc3_get_properties(struct dwc3 *dwc) "snps,dis_u2_susphy_quirk"); dwc->dis_enblslpm_quirk = device_property_read_bool(dev, "snps,dis_enblslpm_quirk"); + dwc->dis_u1_entry_quirk = device_property_read_bool(dev, + "snps,dis_u1_entry_quirk"); + dwc->dis_u2_entry_quirk = device_property_read_bool(dev, + "snps,dis_u2_entry_quirk"); dwc->dis_rxdet_inp3_quirk = device_property_read_bool(dev, "snps,dis_rxdet_inp3_quirk"); dwc->dis_u2_freeclk_exists_quirk = device_property_read_bool(dev, diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 1528d39..fa398e2 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -1015,6 +1015,8 @@ struct dwc3_scratchpad_array { * @dis_u2_susphy_quirk: set if we disable usb2 suspend phy * @dis_enblslpm_quirk: set if we clear enblslpm in GUSB2PHYCFG, * disabling the suspend signal to the PHY. + * @dis_u1_entry_quirk: set if link entering into U1 state needs to be disabled. + * @dis_u2_entry_quirk: set if link entering into U2 state needs to be disabled. * @dis_rxdet_inp3_quirk: set if we disable Rx.Detect in P3 * @dis_u2_freeclk_exists_quirk : set if we clear u2_freeclk_exists * in GUSB2PHYCFG, specify that USB2 PHY doesn't @@ -1206,6 +1208,8 @@ struct dwc3 { unsigned dis_u3_susphy_quirk:1; unsigned dis_u2_susphy_quirk:1; unsigned dis_enblslpm_quirk:1; + unsigned dis_u1_entry_quirk:1; + unsigned dis_u2_entry_quirk:1; unsigned dis_rxdet_inp3_quirk:1; unsigned dis_u2_freeclk_exists_quirk:1; unsigned dis_del_phy_power_chg_quirk:1; diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index e293400..f2d3112 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2073,6 +2073,24 @@ static int dwc3_gadget_stop(struct usb_gadget *g) return 0; } +static void dwc3_gadget_config_params(struct usb_gadget *g, + struct usb_dcd_config_params *params) +{ + struct dwc3 *dwc = gadget_to_dwc(g); + + /* U1 Device exit Latency */ + if (dwc->dis_u1_entry_quirk) + params->bU1devExitLat = 0; + else + params->bU1devExitLat = DWC3_DEFAULT_U1_DEV_EXIT_LAT; + + /* U2 Device exit Latency */ + if (dwc->dis_u2_entry_quirk) + params->bU2DevExitLat = 0; + else + params->bU2DevExitLat = DWC3_DEFAULT_U2_DEV_EXIT_LAT; +} + static void dwc3_gadget_set_speed(struct usb_gadget *g, enum usb_device_speed speed) { @@ -2142,6 +2160,7 @@ static const struct usb_gadget_ops dwc3_gadget_ops = { .udc_start = dwc3_gadget_start, .udc_stop = dwc3_gadget_stop, .udc_set_speed = dwc3_gadget_set_speed, + .get_config_params = dwc3_gadget_config_params, }; /* -------------------------------------------------------------------------- */ diff --git a/drivers/usb/dwc3/gadget.h b/drivers/usb/dwc3/gadget.h index 3ed738e..5faf4d1 100644 --- a/drivers/usb/dwc3/gadget.h +++ b/drivers/usb/dwc3/gadget.h @@ -48,6 +48,12 @@ struct dwc3; /* DEPXFERCFG parameter 0 */ #define DWC3_DEPXFERCFG_NUM_XFER_RES(n) ((n) & 0xffff) +/* U1 Device exit Latency */ +#define DWC3_DEFAULT_U1_DEV_EXIT_LAT 0x0A /* Less then 10 microsec */ + +/* U2 Device exit Latency */ +#define DWC3_DEFAULT_U2_DEV_EXIT_LAT 0x1FF /* Less then 511 microsec */ + /* -------------------------------------------------------------------------- */ #define to_dwc3_request(r) (container_of(r, struct dwc3_request, request))