Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9A952C433EF for ; Wed, 8 Jun 2022 07:01:10 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4897D842DC; Wed, 8 Jun 2022 09:01:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=foss.st.com header.i=@foss.st.com header.b="7CqKEssy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ECE08842C2; Wed, 8 Jun 2022 09:01:05 +0200 (CEST) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0D02A842F9 for ; Wed, 8 Jun 2022 09:01:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=21588a4f72=patrice.chotard@foss.st.com Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 257MH9WA014237; Wed, 8 Jun 2022 09:00:59 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=nYvX331WeFyAiDHWDMTVnpcmTodUPoWmcpEmVqlBTGo=; b=7CqKEssyNyJ/75qT2kuThKcjoowBuqJSaY6l+iVlfuJF74475S/w8R7soEVPm3NexwD/ AnHVcOHHXGRYSPaNbGzhjZxj4pQoSo3u82/s0NTkzc8qiO+RUVaRpP+dvEiZaabhWlCl +/L9cDlxmTCryWVZNVE1uKAo3fV8gFs0GpPHh3nMbWJlTbR2uTDrhNHYw5Fe+Hvx6oyc vNEthzUA20N1yuDCgzikWDWHVK6+A8zy5H5LdvlTsxFfZehf9yO3b6bWtE6MbaLmMXuv ymSVWH1/zG1B0NOinSEKBgiSqksoBYWP49EJ+9Ul/ZBQsDDir7TI3JzWwI2KFuFb/qCr Mw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3gj3ctpxjb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jun 2022 09:00:59 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A762010002A; Wed, 8 Jun 2022 09:00:58 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 9697B210F89; Wed, 8 Jun 2022 09:00:58 +0200 (CEST) Received: from [10.201.20.162] (10.75.127.51) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.20; Wed, 8 Jun 2022 09:00:58 +0200 Message-ID: <98aa3e61-ffbf-73d3-befe-50e1d1fea4ae@foss.st.com> Date: Wed, 8 Jun 2022 09:00:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] usb: host: ehci-generic: Make resets and clocks optional Content-Language: en-US To: Andre Przywara , Tom Rini , Marek Vasut CC: , References: <20220607234222.2252-1-andre.przywara@arm.com> From: Patrice CHOTARD In-Reply-To: <20220607234222.2252-1-andre.przywara@arm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-08_02,2022-06-07_02,2022-02-23_01 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Hi Andre On 6/8/22 01:42, Andre Przywara wrote: > The generic EHCI binding does not *require* resets and clocks > properties, and indeed for instance the Allwinner A20 SoCs does not > need or define any resets in its DT. > > Don't easily give up if clk_get_bulk() or reset_get_bulk() return an > error, but check if that is due to the DT simply having no entries for > either of them. > > This fixes USB operation on all boards with an Allwinner A10 or A20 SoC, > which were reporting an error after commit ba96176ab70e2999: > ======================= > Bus usb@1c14000: ehci_generic usb@1c14000: Failed to get resets (err=-2) > probe failed, error -2 > ======================= > > Signed-off-by: Andre Przywara > --- > drivers/usb/host/ehci-generic.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c > index 4734af03962..15267e9a05a 100644 > --- a/drivers/usb/host/ehci-generic.c > +++ b/drivers/usb/host/ehci-generic.c > @@ -69,7 +69,7 @@ static int ehci_usb_probe(struct udevice *dev) > > err = 0; > ret = clk_get_bulk(dev, &priv->clocks); > - if (ret) { > + if (ret && ret != -ENOENT) { > dev_err(dev, "Failed to get clocks (ret=%d)\n", ret); > return ret; > } > @@ -81,7 +81,7 @@ static int ehci_usb_probe(struct udevice *dev) > } > > err = reset_get_bulk(dev, &priv->resets); > - if (err) { > + if (ret && ret != -ENOENT) { > dev_err(dev, "Failed to get resets (err=%d)\n", err); > goto clk_err; > } Reviewed-by: Patrice Chotard Thanks Patrice