Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4238244ybg; Tue, 29 Oct 2019 04:18:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqytRGeOcs4dCNUFACgrE8ro2avKLwTi56bbyYXdCeNaXK+AOmruoIQ1n7QbMKnVQ6Q/YIeY X-Received: by 2002:aa7:d38e:: with SMTP id x14mr23214027edq.102.1572347917647; Tue, 29 Oct 2019 04:18:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572347917; cv=none; d=google.com; s=arc-20160816; b=v0x217BsXLPN7Onv7xIH8YPXhQyCgngE0erG/upCnQ2SA3QQQBlv6qPIqxCOaLFAT4 4aonklixfDh0MUMTpkmcDeEq52F7JEyMUU8F21S7Y+W1l+apmxru0kuOzKiYHlSmfDMq ShCaUCBX9ayFQ0IFRjfHJx3PLtSYrjPhB/Mb818lKDa512Yu9uXVTduh4tHeTb0XK+cv XPp4MifLS4RyU6fJ3bvyfViqYFnDYrPWzCWU3QypHhMhw3cWozY77bdDNqO49rD0IP+b XmCcSlly+iwBpJjJ+dc8BjhC0Nxx4JIZX5aBPbLV77sB8xrhQ3nxk8kVB71hOZbOIb3O F6dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=6V6X8T/9T9wXbkz0KkoeSxiaFxhQthmfAa6hbB7Tu7I=; b=LgJ0Oqf1Plj3ZpdrlGH4SDOaXtNy2aOdxO9N609GJ7qfkUjs2dHiWpz/IMS1xumnD+ 7u1PaXWLDoou/4e3XvAnelAsBo3krY2DN49TP5QP69dJEyi93j7raY0yHVwswJfr9P79 PF79GGP0N2wqJVj/tJH2icoENkblbAmHZHdm+lIW2F4jyfxHcf0F4L8aKp3P0iaDz42+ BBaGou9IIsb1iHLZJRVX35Lesy2IQM2wByNZMXevJUpfGrDEARPBsBXaxpTTkFhHKUzx ZQIbTNtHJj/uCFLQ7W7JbGB5OKmXyDtu29QZ59SX7z3k3raGxnmhTpw61GzzRwITdYm3 NJDA== ARC-Authentication-Results: i=1; mx.google.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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e47si10222530eda.73.2019.10.29.04.18.14; Tue, 29 Oct 2019 04:18:37 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728039AbfJ2KeD (ORCPT + 99 others); Tue, 29 Oct 2019 06:34:03 -0400 Received: from mga11.intel.com ([192.55.52.93]:9190 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726716AbfJ2KeD (ORCPT ); Tue, 29 Oct 2019 06:34:03 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Oct 2019 03:34:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,243,1569308400"; d="asc'?scan'208";a="198884160" Received: from pipin.fi.intel.com (HELO pipin) ([10.237.72.175]) by fmsmga007.fm.intel.com with ESMTP; 29 Oct 2019 03:33:59 -0700 From: Felipe Balbi To: Roger Quadros , Peter Chen Cc: Pawel Laszczak , "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 In-Reply-To: <0c2c901c-a6f2-a81b-f5b1-e3f442d7c1ae@ti.com> 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> Date: Tue, 29 Oct 2019 12:33:56 +0200 Message-ID: <875zk7j0x7.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Roger Quadros writes: > On 29/10/2019 05:12, Peter Chen wrote: >> On 19-10-25 12:59:17, Roger Quadros wrote: >>> Peter, >>> >>> On 25/10/2019 06:13, Peter Chen wrote: >>>> On 19-10-23 09:17:45, Pawel Laszczak wrote: >>>>> Hi, >>>>> >>>>> Reviewed-by: Pawel Laszczak >>>> >>>> Hi Roger & Pawel, >>>> >>>> Assume gadget function has already enabled, if you switch host mode >>>> to device mode, with your changes, where the device mode will be enabl= ed >>>> again? >>> >>> When it switches from device mode to host the UDC is removed. When we s= witch >>> back from host to device mode the UDC is added, so, >>> >>> 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 progr= am >> to monitor VBUS or external connector? At host mode, the store operation >> will fail due to there is NO UDC. >>=20 > > Yes, user space needs to monitor /sys/class/usb_role/6000000.usb-role-swi= tch/role > > When it becomes "device" the UDC is available and it can prepare to confi= gure > the UDC. > > Could you please give your Ack for this patch if it is OK? Thanks. this is already in its way to Linus' tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?h=3D= usb-linus&id=3Df3fb802efaef3662744a2215a51294d52a7cfc0e =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAl24FZQACgkQzL64meEa mQb8GxAAkVg88x3zxLiaMlbDSwSkB6A3rUU+t+PeKfW2HC4iQGxWsl3UU34sr1uk Lz/vit0HLb11mjHDt3J66hI7gxyqucMjsadiOy6e2H0dk3ehb2GKCEABPTho89l7 flKFU1cZWqYDUreoL0C7Y2OFMkCU8L9kGUwP6RLinEhleGytnRXxF0IVitWDJYda qviXiOFLiAydkwriy1pVTU6gpdK4a8GDUfaoofsS792TD8jy/sOKnHEzLc918/f6 a82W+Htz9wWuUokddvmw5nlpIE6IVQVWU1RpPnn5d19ZhIORGMg2fq3VEeh7n3s3 C0np+xS5Re0UIbLoaXGgBjRCKdraCdaM92ODBx4e9HWpBuUwHPbFWY8aSLzerRSz kG8CXyN5eWfucdcVCHq9XUuesZwwB0wc+b/I67ayI+rD3wqK9+RV5MGyjdvMwlyG f/fZ41Y67JWqUzCAooYLTmdrxjSdSy/TQCbkiV8ghwGYUcUp6VPLxT3qABK+sX95 3IoSmnIa+oH9ykFTBNLt14v3dKNU/WKdFdSyp6YQKAvUVX7EVQoQFud7+/M4HZi2 3NlJpenqjvs68T4XmIeonF0/GxNCGFFdFH0DBrYTcWZ+2k2n/rbPNSDcBtpQ2/hF ZnSDN1clFqtkAbz5q7JohSYc1ZTjLCTbDa0drHYW97Lh0ylZ5nM= =je1a -----END PGP SIGNATURE----- --=-=-=--