Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp274226ybx; Tue, 29 Oct 2019 18:18:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqz35oPq3IfXiIU/Q5mUWiVo4m4N20kwKnwuthTfq4xHzgX6v4bUx3SrM4EqO+s2uMAa8rna X-Received: by 2002:aa7:dc1a:: with SMTP id b26mr29154800edu.139.1572398281150; Tue, 29 Oct 2019 18:18:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1572398281; cv=pass; d=google.com; s=arc-20160816; b=SCMB3sOkx1Qu/BVFx0kJK9y9HXi+rFv3oglZGJXhs852DHW4utDAVOf1RHVpbuKNDe 9BGYkCKcLrwqw8FtYc62eZ93SqAA4yrQBWAmyMz5MIddoPqCfGcEzkUeDQYLfEEi8fwO kcDb3k0HXMp1RZJt5fdzBZFqkK6u+0Wn/+VzgWjPwbMXmbJtv3c5EDB8Xk420kVgMboF zSajrileiopUtQHjgNgKiJEYHkgiFbHrydJjO4S6cCLB+2NU0gkLLjmLi5S41mtAXo/1 XvIwKr7jdDXDgVtwjXP4PCsWW9uqLOtNDKOuQ3/tnA8/FY/9545n8BsoGSyp6Q0ergL2 j8lA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=QUGPifLCn6bsyDm9Tyd3pA/5K+/MlveA4djzpNIYqII=; b=fpJ5Rot3eTxTseZKc54L2qW6b8c0j6OGBpODg/Xz6J6SMXXZT/U/PWFl8wcV0mrsPg e8ku7NayCsQ6dH9vk1NOCr7GSuSyrUd5jV1RFTBZQiXdf6p48fwMOCclZoaoCPc/qge2 AvSkfBVu2OcYZ/s8alAwjDjOEBZBBJLCk0mfD7B4GulDiSuiM2y7LM5yH2p4ru0aPVxt JP7ololFvm53ZOUcDDd6jntUDqnfBuAxmxvaMUasXUdVWTQZVqe/AnlmTBEAuQCgc0Ov De8nNwO6rqbnR1sG6OJTkaLad0HgSO1fLx6aChQRGyIEiI3nE5nvta7GJKGvhvXMghe/ 3Uyw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=NGRociia; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nr20si213663ejb.387.2019.10.29.18.17.36; Tue, 29 Oct 2019 18:18:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=NGRociia; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726875AbfJ3BPV (ORCPT + 99 others); Tue, 29 Oct 2019 21:15:21 -0400 Received: from mail-eopbgr140043.outbound.protection.outlook.com ([40.107.14.43]:30725 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725870AbfJ3BPV (ORCPT ); Tue, 29 Oct 2019 21:15:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fzhF9xs+RLzdXLGKKa/IrPcI2NQRhXPcUFIz6OkkTwWKxiV0vPfY70qq0pfUunAB0IfcGYXGL0qqhLO+FZ6xLCjkbR3x9qNoqdYLEYNyg7rnW79xQpfMYm5ftlCnERjEr4RJ8PIMQx1UsVyy7ZBxL/mUVDyIMQgV+FzEwYtLEkWX6J+vMBnDpuFatJtcK9fvsk/szfCMDMURPQIDH2K/1ApnY0QkIBHizYkv0CpZJbGfR9dqV2sU1kmp/7s41Mrt9a7WzOCEQcnxBWU75aHTNUUUhPNE9zE7Rfs7PEZxZziAauy+tZ8UQRzYI5OvoBELjWOXqdeIamN4wmeuWIN/lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QUGPifLCn6bsyDm9Tyd3pA/5K+/MlveA4djzpNIYqII=; b=l8ne3uetq/FTBIp9MF/+jBCtnuciNFw59WnlwuXf5rxmdQQ9OB83gG/dQ+phahrxvPn7+0Xw7xB3c5F7xevYtbKmE7+FBxA2YzyBahkE8r/IJ0OrYRl/ukRKWuiqoxlhNfxKT/ObY5PEP08rmpWCmsprSSIxD9+FHyFu7SMYP7MAZnGDt9HelakRiwKUbj0DINELtNATS01fxLlG/fsMM7+SxL5LnuzEKgKb0V64STUFy6y/tHIcAmUdjkm7wyN/XThtp69fUePZbxzgfEj3yr+fMFEDCPMM3+tIHQQob/B1xhG8ob98gXNiTdxFTK6zA9BaYmzg4J+gDEvEhXQBkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QUGPifLCn6bsyDm9Tyd3pA/5K+/MlveA4djzpNIYqII=; b=NGRociia6sQOTu08DUF4K4nZA21fD3I7IcBo350av/mI8fXPv4w5Mv/Wp/FyJHMJxoRuDQrK/SXn2JKbV9uxsNG3/+8sGFegRIWpfIvFFrpZz+pAzeRddX1FTdx31930nLATu9AxHZ5+DXb+9poizW7/j+wwmHYI2b2mVfSgDNQ= Received: from VI1PR04MB5327.eurprd04.prod.outlook.com (20.177.51.23) by VI1PR04MB5582.eurprd04.prod.outlook.com (20.178.123.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.22; Wed, 30 Oct 2019 01:15:16 +0000 Received: from VI1PR04MB5327.eurprd04.prod.outlook.com ([fe80::68e3:e1a6:78fd:7133]) by VI1PR04MB5327.eurprd04.prod.outlook.com ([fe80::68e3:e1a6:78fd:7133%3]) with mapi id 15.20.2387.023; Wed, 30 Oct 2019 01:15:16 +0000 From: Peter Chen To: Roger Quadros CC: Pawel Laszczak , "felipe.balbi@linux.intel.com" , "gregkh@linuxfoundation.org" , "nsekhar@ti.com" , Rahul Kumar , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] usb: cdns3: gadget: Don't manage pullups Thread-Topic: [PATCH] usb: cdns3: gadget: Don't manage pullups Thread-Index: AQHViYCigHhLS+QXN0CJz1D+9q4PbKdn8nSAgAK+9ICAAHFQgIAF16UAgABrmoCAAQX0gA== Date: Wed, 30 Oct 2019 01:15:16 +0000 Message-ID: <20191030011505.GB26815@b29397-desktop> References: <20191023090232.27237-1-rogerq@ti.com> <20191025031343.GA13392@b29397-desktop> <83a1da01-19d6-65a9-aecd-2027fd62a272@ti.com> <20191029031223.GA26815@b29397-desktop> <0c2c901c-a6f2-a81b-f5b1-e3f442d7c1ae@ti.com> In-Reply-To: <0c2c901c-a6f2-a81b-f5b1-e3f442d7c1ae@ti.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=peter.chen@nxp.com; x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 5092abc9-f471-4356-47b2-08d75cd69f93 x-ms-traffictypediagnostic: VI1PR04MB5582: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 02065A9E77 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(7916004)(4636009)(376002)(39860400002)(366004)(136003)(396003)(346002)(189003)(199004)(2906002)(3846002)(66476007)(53546011)(66556008)(5660300002)(66446008)(8936002)(6246003)(33656002)(6506007)(316002)(76176011)(54906003)(64756008)(4326008)(14444005)(76116006)(256004)(102836004)(26005)(1076003)(66946007)(71200400001)(186003)(71190400001)(91956017)(25786009)(9686003)(86362001)(14454004)(7736002)(33716001)(44832011)(476003)(446003)(486006)(6486002)(478600001)(6512007)(305945005)(66066001)(6916009)(8676002)(99286004)(81156014)(81166006)(229853002)(11346002)(6436002)(6116002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB5582;H:VI1PR04MB5327.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Ambccwu2mWMmkD2Rj49i3tnPmMATT6G9eG6D5i33RU8GzAK5wSqM7hYWVE29R5swPcdIFTywo4FDRcVwErnhn+DziZNdMjCEWT4pKYu1gGfsvuq04yeT5rLF6pA+gp3dCge5mUiM2rG1YeAwqrzgc0kqMxeWOF+yE75OvCWmL2258Ku3t73bvyL3GeJrDDzCvlXkdzq91hoVq96vjn5Hf5M5iNRG1c0CH1YFrRUp+CbVujzet3uDeKMrHbZU2ZwoY0hGizIejCU/dICpJoFYqiHA784Pk87Y85vS3mjBlA9gnsdfKGh54XYId4gXlbAfjpQ5HwVPMC5WW7KA1Rne5f6LYbUaXKInZ4iFPvwp05vssW1FlX/8OF9GbDewsj6Z2KJapGDw6jnyV77nuge4GmfsXei7eGjPF0jdgbvVvqizw9zDuU2hsQjpzv6iQon/ x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5092abc9-f471-4356-47b2-08d75cd69f93 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Oct 2019 01:15:16.4901 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: beDBP8QifVANxz1VbMFyAWYnoY3nZ31QmiFCdL0ASahhLyYyO3JJISWj5wOX8ih00Tod8q2wweVqhGiv/3uW1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5582 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19-10-29 11:37:31, Roger Quadros wrote: >=20 >=20 > On 29/10/2019 05:12, Peter Chen wrote: > > On 19-10-25 12:59:17, Roger Quadros wrote: > > > Peter, > > >=20 > > > On 25/10/2019 06:13, Peter Chen wrote: > > > > On 19-10-23 09:17:45, Pawel Laszczak wrote: > > > > > Hi, > > > > >=20 > > > > > Reviewed-by: Pawel Laszczak > > > >=20 > > > > Hi Roger & Pawel, > > > >=20 > > > > Assume gadget function has already enabled, if you switch host mode > > > > to device mode, with your changes, where the device mode will be en= abled > > > > again? > > >=20 > > > When it switches from device mode to host the UDC is removed. When we= switch > > > back from host to device mode the UDC is added, so, > > >=20 > > > usb_add_gadget_udc_release()-> check_pending_gadget_drivers()-> > > > udc_bind_to_driver()->usb_udc_connect_control()->usb_gadget_connect()= -> > > > gadget->ops->pullup() > >=20 > > Thanks. I have another question how you decide when to store UDC name > > to /sys/kernel/config/usb_gadget/g1/UDC? Do you have a user daemon prog= ram > > to monitor VBUS or external connector? At host mode, the store operatio= n > > will fail due to there is NO UDC. > >=20 >=20 > Yes, user space needs to monitor /sys/class/usb_role/6000000.usb-role-swi= tch/role >=20 > When it becomes "device" the UDC is available and it can prepare to confi= gure > the UDC. >=20 > Could you please give your Ack for this patch if it is OK? Thanks. >=20 Acked-by: Peter Chen --=20 Thanks, Peter Chen=