Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4052108ybg; Fri, 25 Oct 2019 12:37:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxB4nO8Vs3kjMkkIQfUmqdnJPRrWodyO0qh3AX3dyWzfORvxfkamukFnIUaTH8BXCscFJ1m X-Received: by 2002:a17:906:55d1:: with SMTP id z17mr5088616ejp.300.1572032232938; Fri, 25 Oct 2019 12:37:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572032232; cv=none; d=google.com; s=arc-20160816; b=It8Bulnq3e0ma7eCJbGHJZjKIXmhnrZC6rbcd3mbB841FQcjg3ztsaqfybDsgUvdVd dZSRwRylT1tO51eff4PDCgAO56Hjz7AUkewSAR6wbmxajadxDMkBw9QenwE/8stq4ylU Jg1jO9fHhHnZsIeFun+tooJj6o0L2YnvEqdYufa/+J7wKhsDQtByxZEDYs3b2A3IGd9F DwfBLKY/xbEpqGxdglXxNMWtOoEtEPTzwApu8CXZVyh6gv1I+IxZ0MGgtmh2muEhE1v6 444/l4O9v76tOCtkukEBIPHDSo0gOudAHY/KEW2zgXyclQhQPYyud+hIf/yC6+iIKeWT l0/A== 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=V6hOD5dytEB/3BCbaVXsPiwjMD39duocB15Lwiy7XLU=; b=p2c6apwyHdBxSix9xf2Nutn2zeILgeNelNK0DW1Wnnnb85CiumQsyphaDa9pLL714k 4UKPZNjCmjJqfenM4fPvV+iB4EJjMZGCT+X3jhKXCt89UlZ/+YPbUSp6/SLC+WDRXjfR 3wH43A8fYklYbizVrTuAuRR97z0MpS4UeuU2aQmeFyhmj9j23OIup+eNEfD0N4kFfRM2 XGlwQnIXMCMlkf46mw6XvjyJWRWfWmBhK56mduWLS7TGEjfU6WhpsnEK9kcZnYH/zfI+ cOB21QdxDsZ65xjyC+NZmDRZ7nOpaL6qgNKvbBtUHvTZWY3ayzBHiEE0ayGOfFbGyie8 7PzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=hfOx8YhL; 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 n14si1024597ejx.354.2019.10.25.12.36.49; Fri, 25 Oct 2019 12:37:12 -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=hfOx8YhL; 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 S2439098AbfJYJ73 (ORCPT + 99 others); Fri, 25 Oct 2019 05:59:29 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:54864 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408510AbfJYJ72 (ORCPT ); Fri, 25 Oct 2019 05:59:28 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9P9xKrK066500; Fri, 25 Oct 2019 04:59:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1571997560; bh=V6hOD5dytEB/3BCbaVXsPiwjMD39duocB15Lwiy7XLU=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=hfOx8YhLPWRW7wJRbqNBJ5mw+F8j9L+oe9BMdToXpsp09kwVmjN6EZOJvwO2uj7SS cMWaPs07XcDgR7OdghbpebCYu67pTRGMVN64KCF64D2pmOxpLOfLrMvqmb9pPf22a+ JYFM/F5Jg1NPIn9+zkdhTQcIvDJt7VxWtEecH1N4= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x9P9xKuQ077394 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 25 Oct 2019 04:59:20 -0500 Received: from DFLE115.ent.ti.com (10.64.6.36) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 25 Oct 2019 04:59:09 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE115.ent.ti.com (10.64.6.36) 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; Fri, 25 Oct 2019 04:59:09 -0500 Received: from [192.168.2.14] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9P9xHaw053809; Fri, 25 Oct 2019 04:59:18 -0500 Subject: Re: [PATCH] usb: cdns3: gadget: Don't manage pullups To: Peter Chen , Pawel Laszczak CC: "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> From: Roger Quadros Message-ID: <83a1da01-19d6-65a9-aecd-2027fd62a272@ti.com> Date: Fri, 25 Oct 2019 12:59:17 +0300 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: <20191025031343.GA13392@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 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() cheers, -roger > > Peter >> >> Regards, >> Pawel, >> >>> The USB gadget core is supposed to manage pullups >>> of the controller. Don't manage pullups from within >>> the controller driver. Otherwise, function drivers >>> are not able to keep the controller disconnected from >>> the bus till they are ready. (e.g. g_webcam) >>> >>> Signed-off-by: Roger Quadros >>> --- >>> Hi Greg/Felipe, >>> >>> This can be used for -rc as it is a bug fix. >>> >>> cheers, >>> -roger >>> >>> drivers/usb/cdns3/gadget.c | 4 ---- >>> 1 file changed, 4 deletions(-) >>> >>> diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c >>> index 2ca280f4c054..714382d96055 100644 >>> --- a/drivers/usb/cdns3/gadget.c >>> +++ b/drivers/usb/cdns3/gadget.c >>> @@ -2324,8 +2324,6 @@ static void cdns3_gadget_config(struct cdns3_device *priv_dev) >>> writel(USB_CONF_CLK2OFFDS | USB_CONF_L1DS, ®s->usb_conf); >>> >>> cdns3_configure_dmult(priv_dev, NULL); >>> - >>> - cdns3_gadget_pullup(&priv_dev->gadget, 1); >>> } >>> >>> /** >>> @@ -2708,8 +2706,6 @@ static int cdns3_gadget_suspend(struct cdns3 *cdns, bool do_wakeup) >>> /* disable interrupt for device */ >>> writel(0, &priv_dev->regs->usb_ien); >>> >>> - cdns3_gadget_pullup(&priv_dev->gadget, 0); >>> - >>> return 0; >>> } >>> >>> -- >>> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. >>> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki >> > -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki