Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4197810ybg; Tue, 29 Oct 2019 03:41:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxzk1A0h5KFb5Byu6PsGxKaiY+frnf/L40jVcae+9kU/0M9i0XLc9tUYBrOK7Gh5ffj2f0p X-Received: by 2002:aa7:d397:: with SMTP id x23mr16359759edq.75.1572345670849; Tue, 29 Oct 2019 03:41:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572345670; cv=none; d=google.com; s=arc-20160816; b=c4nUkx5tmLAwQMKR7S6ymQwN/6rNNqgzdYJliN+cgVaGkDZUN/8o5R8G6mOFMCAg3F YwqMUvNW8kEzq6rdCAkguCEMGgBTrtwy4hTQdXK4T6NgMuBrsryOEFvJeNzBCawHGsSm dp9ckfe6FoU0yuvC5QG15le5qET7pKQ3Gs2yknXRmxmfV5R9JxK0gOozDQkkyy8UOGAq EMUXEyHHU8bRvni6+aP7xarVwF889pHcMQjIlnnH7uKruXttf/x6U+F8Qi4CGOact693 Uj0q6jzJ/p68E0evkuBX/BnW6miM0vt3ypEOkuhV3osgvNIFPtMEjuxyrsZbw2DzPejB sqXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=qx0+Boyw2DO4/fAggbJagSOI/nOtPK72Y21e3pUEeAg=; b=C0GONVPMqekW8+mMx+MnDr7y4Ueum5198rdjQsjn91PSX7VcYCVeGshEpeszE9YBR8 m0vhI14HxCFOV7sjbAYGzCcIV0dmJh+2KjLr54qin1YN0V2G1aFdzhVO3cdlR/OfD1vG DSSWm5UzYbR3DHgeRQHG3rPl8KTKl6j/JbfozS0x9loX9Ef8C4T51EaIWlyw5MLi4tG/ YFjFwsgjyjYDpfg15TMQoZFYd+48FQ71fKtS3Mk1ASsiDVEr4ekVEyVlUozZegRcbrTB +vGkMCQi45jnOyMsNGo0eiIG30wo0eeGvOC/RtvlIDsthAv1Lf2OT2FlUCUpZc07ZS+i OZgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=T5xpMM0l; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d22si2960361ejj.347.2019.10.29.03.40.47; Tue, 29 Oct 2019 03:41:10 -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=@ti.com header.s=ti-com-17Q1 header.b=T5xpMM0l; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728148AbfJ2Jhn (ORCPT + 99 others); Tue, 29 Oct 2019 05:37:43 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:36698 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726025AbfJ2Jhm (ORCPT ); Tue, 29 Oct 2019 05:37:42 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9T9bZaK092543; Tue, 29 Oct 2019 04:37:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1572341855; bh=qx0+Boyw2DO4/fAggbJagSOI/nOtPK72Y21e3pUEeAg=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=T5xpMM0ld45ZVNOOYNeji7q/Km5OIyOk1Gb56lArOS+LUzzQXHxrPOkqRKy/xgL6J efbsrEs7SlmMKJxedgv6KVmO2vZp6RadAuEkU317S2111BJr2yfQkwiZFtp1w8VuF9 Qfe2Rj+ucAnM0e2oSgEMZ12/Ng/zqjgR0UOMSMkI= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x9T9bZHC030105 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 29 Oct 2019 04:37:35 -0500 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 29 Oct 2019 04:37:34 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 29 Oct 2019 04:37:34 -0500 Received: from [192.168.2.14] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9T9bVO6119682; Tue, 29 Oct 2019 04:37:32 -0500 Subject: Re: [PATCH] usb: cdns3: gadget: Don't manage pullups To: Peter Chen 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" References: <20191023090232.27237-1-rogerq@ti.com> <20191025031343.GA13392@b29397-desktop> <83a1da01-19d6-65a9-aecd-2027fd62a272@ti.com> <20191029031223.GA26815@b29397-desktop> From: Roger Quadros Message-ID: <0c2c901c-a6f2-a81b-f5b1-e3f442d7c1ae@ti.com> Date: Tue, 29 Oct 2019 11:37:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191029031223.GA26815@b29397-desktop> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 enabled >>> again? >> >> 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, >> >> usb_add_gadget_udc_release()-> check_pending_gadget_drivers()-> >> udc_bind_to_driver()->usb_udc_connect_control()->usb_gadget_connect()-> >> gadget->ops->pullup() > > 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 program > to monitor VBUS or external connector? At host mode, the store operation > will fail due to there is NO UDC. > Yes, user space needs to monitor /sys/class/usb_role/6000000.usb-role-switch/role When it becomes "device" the UDC is available and it can prepare to configure the UDC. Could you please give your Ack for this patch if it is OK? Thanks. cheers, -roger -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki