Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1502539pxu; Tue, 24 Nov 2020 01:42:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhj08WXt7B0c0zz7xw+S9/ldjh32UhwK9Qvhm/B98jeTWuR5WNbI/LAoQxvrIWc0nU0IYX X-Received: by 2002:aa7:d2c4:: with SMTP id k4mr3272836edr.367.1606210966266; Tue, 24 Nov 2020 01:42:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606210966; cv=none; d=google.com; s=arc-20160816; b=TRGqrsLHoSX2B2og1CL++SFCCWE+kpxDlzMZEcpWhgXw0FsENb6tOkNAlWIUXy0aMb plJxca/GNL9oHBFQB6DVRPTWq8Rc+mI1GyAlplVm2tiJNWI7PTiHZamQyv9se4KeZjTZ 8Lv6I7FqHISEfEkNQUAiO28P53od/2UYAWwlA7hlIA36jC9Lat9OZm8t2PUcVcvyINO/ Je4CNRoYqwBRw2Dmkuhh5/NsvWjmrGBDdiRFttWUdhmc3gV2PaQgdKrtLDqLkzcUzYPw rOhAOoiQUhFcvDuZ/lpyF04KCZvOGejTYAmbomsWARdi8NIU/nWgVFE8v5KrjGzDSnyg nDmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=/UZqV0080zJ5hCt/MnjxSlJyTTwEADKbUBDSNEH9IAA=; b=Z1zOWUNAgww09qqP6S/02Uxnw2O+p7TYn5LD/ikOAWt/dnaG3hVYDybDK3qw3pWq0Z aiLM4LO2NKO1gxg1ineDaV1CBY0xBTVml1BJmjEQPvJVGAA1d+Nl0Kr5omEmew9XNkBg kx3BDF29Pok8DWLQ09NuMJ3ooeUMk1gND9CH5WPVgcWtOaD64UimrX1fg5dKpCSWcnyl 6zZA/Oo2AKB5a1HtPHjs4bHzY6l9IuWgLH6cb3TPrjRxmAip/oRmIs4ArkCZaiaZ9E8B N79VGBifOjbYsTdTEI6ABNwF29PD+IhMJk0d11B75hFZVtiOFazn9soEqY1nv15VTLbv 3zrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=GK2Z1qn9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id f5si8098620ejr.411.2020.11.24.01.42.23; Tue, 24 Nov 2020 01:42:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=GK2Z1qn9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1731576AbgKXJjf (ORCPT + 99 others); Tue, 24 Nov 2020 04:39:35 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:60168 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731175AbgKXJjf (ORCPT ); Tue, 24 Nov 2020 04:39:35 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0AO9dMKr102139; Tue, 24 Nov 2020 03:39:22 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1606210762; bh=/UZqV0080zJ5hCt/MnjxSlJyTTwEADKbUBDSNEH9IAA=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=GK2Z1qn9A4QjTNtkh1EuMuIv9d1b40cJR8S9+R5ire2qR8swMI92C9nPqbEjSQftp 3NHajRxYhNxQ06HK4nPKZrIbKaUjdnoGOzROo9fY8kermyKrbMmtyXbaSM0RGlf/ai jO6ZLRr7WZTGZAnn2fAjHf79cOF05340LRN2nsZs= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0AO9dLYL027179 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 24 Nov 2020 03:39:21 -0600 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Tue, 24 Nov 2020 03:39:21 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Tue, 24 Nov 2020 03:39:21 -0600 Received: from [192.168.2.14] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0AO9dJUE112679; Tue, 24 Nov 2020 03:39:20 -0600 Subject: Re: [PATCH] Revert "usb: cdns3: core: quit if it uses role switch class" To: Peter Chen CC: "pawell@cadence.com" , "gregkh@linuxfoundation.org" , "balbi@kernel.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20201123115051.30047-1-rogerq@ti.com> <20201124064242.GA32310@b29397-desktop> From: Roger Quadros Message-ID: <89067b6a-5b94-d7d2-b07a-f434c9e5e2bd@ti.com> Date: Tue, 24 Nov 2020 11:39:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201124064242.GA32310@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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Peter, On 24/11/2020 08:43, Peter Chen wrote: > On 20-11-23 13:50:51, Roger Quadros wrote: >> This reverts commit 50642709f6590fe40afa6d22c32f23f5b842aed5. >> >> This commit breaks hardware based role switching on TI platforms. >> cdns->role_sw is always going to be non-zero as it is a pointer >> to the usb_role_switch instance. Some other means needs to be used >> if hardware based role switching is not required by the platform. >> >> Signed-off-by: Roger Quadros >> --- >> drivers/usb/cdns3/core.c | 4 ---- >> 1 file changed, 4 deletions(-) >> >> diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c >> index a0f73d4711ae..4c1445cf2ad0 100644 >> --- a/drivers/usb/cdns3/core.c >> +++ b/drivers/usb/cdns3/core.c >> @@ -280,10 +280,6 @@ int cdns3_hw_role_switch(struct cdns3 *cdns) >> enum usb_role real_role, current_role; >> int ret = 0; >> >> - /* Depends on role switch class */ >> - if (cdns->role_sw) >> - return 0; >> - >> pm_runtime_get_sync(cdns->dev); >> >> current_role = cdns->role; >> -- > > Hi Roger, > > I am sorry about that. Do you use role switch /sys entry, if you have > used, I prefer using "usb-role-switch" property at dts to judge if > SoC OTG signals or external signals for role switch. If you have not > used it, I prefer only setting cdns->role_sw for role switch use cases. > We use both hardware role switch and /sys entries for manually forcing a certain role. We do not set any "usb-role-switch" property at DTS. Currently cdns->role_sw is being always set by driver irrespective of any DT property, so this patch is clearly wrong and needs to be reverted. What do you think? cheers, -roger -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki