Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp400471pxu; Tue, 1 Dec 2020 14:17:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJwhgohsMkWQt8/7WlKLo3BMARHbXfGSdRCvrr43RbAGGekOJ8lgmZhxYk82BQb6s+SHMZFY X-Received: by 2002:a50:d5c4:: with SMTP id g4mr5166759edj.334.1606861076087; Tue, 01 Dec 2020 14:17:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861076; cv=none; d=google.com; s=arc-20160816; b=EW9W9AoHw4pAfN9fPyas6g6i2hgZRXTDe1eRpcKJaTS4JRxPxicjWL325AicLYQQUe VMMLjyBvbRcsD4I5N2fGrzNf1giH7CV09kAocESUWIfFAwIYovq72uIGFez4UM12C/o8 y8Jtsy4Z7LfdGiksRHcxk6fbx5oZX8LcEIerWfKWog9d9mWLLzxjN5MyN8xiTztW+qFL QindeAbk3JnlW4SpH0AMEISIPQfOinZkKpRJfOx4FE3xFGCYSygzg3dSR4MpqbBzrh10 uIT/mmBAWBT0oTnqPpaPTnR61Rlt4SJ9EjFdZg39if0Vqs24OKlyOUw7V9u+VAnRytKg hecQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version :dkim-signature; bh=vZodXyawqfmhzApkl+PJz1fcLX5uRiTYHumDpkFd5hs=; b=SkmVOZAq0wAVrVaJ5U+imbcwTR976JpMCNzTD+rcaVlfDW/XGWxsPDllYz2Z/lYeSi Ug+daWtAkcHhoKutT2HJROlM+OTxcwkbD5Cx4FWILFrhS0YEG9EJkU/WPd/Nd93HGv2k 4qV3Ajn5H1SVl09E1xVnmyvF3D6aCzIFCl3cF4UaR0osDp4PDL5H7YPx2yC7TqrzAqgj pPDbrTRUaookRa6bMfU0V10MmDrDqgzXNV/BTJ2MbI5TJULtnITdyz5DG30EWKSHmBkz zoSsWW0N4WlKD1v140zb/jEXQ43wQmfAakTjVm8aI3iemJ/djjUvv5goQsBhHIlG4d/S KCLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=HyZ5RtOi; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h18si811810ejb.131.2020.12.01.14.17.33; Tue, 01 Dec 2020 14:17:56 -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=@agner.ch header.s=dkim header.b=HyZ5RtOi; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727065AbgLAIxK (ORCPT + 99 others); Tue, 1 Dec 2020 03:53:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbgLAIxI (ORCPT ); Tue, 1 Dec 2020 03:53:08 -0500 Received: from mail.kmu-office.ch (mail.kmu-office.ch [IPv6:2a02:418:6a02::a2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D6B7C0613CF; Tue, 1 Dec 2020 00:52:27 -0800 (PST) Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id ADAB25C0930; Tue, 1 Dec 2020 09:52:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1606812744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vZodXyawqfmhzApkl+PJz1fcLX5uRiTYHumDpkFd5hs=; b=HyZ5RtOinN2JFcNOxIy7mUwszPE8yBz2bTjXwSg7YI9AYhS48fwqgF7k63oSRljnqgXwaZ yDM7I0Ezu53i6IXgVoVE0eZFMFMFkcQymy1HHV3Sqee1tAq8d9Kxj0U3OKt6BrFtW0+VOT JtZ84kbZotnZ6EBMS1pT37Hz4VDeoMw= MIME-Version: 1.0 Date: Tue, 01 Dec 2020 09:52:24 +0100 From: Stefan Agner To: Jerome Brunet Cc: robh+dt@kernel.org, khilman@baylibre.com, narmstrong@baylibre.com, martin.blumenstingl@googlemail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: dts: meson: fix PHY deassert timing requirements In-Reply-To: <1j8sai7wr0.fsf@starbuckisacylon.baylibre.com> References: <1j8sai7wr0.fsf@starbuckisacylon.baylibre.com> User-Agent: Roundcube Webmail/1.4.9 Message-ID: X-Sender: stefan@agner.ch Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-12-01 09:31, Jerome Brunet wrote: > On Tue 01 Dec 2020 at 01:25, Stefan Agner wrote: > >> According to the datasheet (Rev. 1.4, page 30) the RTL8211F requires >> at least 50ms "for internal circuits settling time" before accessing >> the PHY registers. This fixes an issue where the Ethernet link doesn't >> come up when using ip link set down/up: >> [ 29.360965] meson8b-dwmac ff3f0000.ethernet eth0: Link is Down >> [ 34.569012] meson8b-dwmac ff3f0000.ethernet eth0: PHY [0.0:00] driver [RTL8211F Gigabit Ethernet] (irq=31) >> [ 34.676732] meson8b-dwmac ff3f0000.ethernet: Failed to reset the dma >> [ 34.678874] meson8b-dwmac ff3f0000.ethernet eth0: stmmac_hw_setup: DMA engine initialization failed >> [ 34.687850] meson8b-dwmac ff3f0000.ethernet eth0: stmmac_open: Hw setup failed >> >> Fixes: 658e4129bb81 ("arm64: dts: meson: g12b: odroid-n2: add the Ethernet PHY reset line") >> Signed-off-by: Stefan Agner >> --- >> arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi >> index 6982632ae646..a5652caacb27 100644 >> --- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi >> +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi >> @@ -413,7 +413,7 @@ external_phy: ethernet-phy@0 { >> max-speed = <1000>; >> >> reset-assert-us = <10000>; >> - reset-deassert-us = <30000>; >> + reset-deassert-us = <50000>; >> reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; >> >> interrupt-parent = <&gpio_intc>; > > Thanks for sharing this is Stefan, > The title of your patch should probably be modified to show that it > addresses the odroid n2 only, as it stands. Yes make sense. Hm, are there other boards with RTL8211F? From the comments in the DT it seems several other boards use the same PHY. Some however do not have any reset timing data at all currently it seems. > > I have checked the RTL8211F doc I have, v1.9, and this one mention > "72ms at least - not including the 1.0V supply rise time" before > accessing the PHY registers :/ ... so 80ms maybe ? Uh interesting, so it seems they increased it over documentation revisions. Yeah agreed 80ms is the safer value then. FWIW, I did test it with 50ms in a continuous loop for an hour or so without seeing any failure, but that was room temperature only. -- Stefan