Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2059055pxb; Sun, 17 Oct 2021 04:57:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOQivqJ3Crw6yx+cwLM/WjmEMXYEpJlNtPi3XsHDbhZOvMwDzLplROqcEyTfDcTx6EJURg X-Received: by 2002:a17:90b:3910:: with SMTP id ob16mr26552006pjb.234.1634471862611; Sun, 17 Oct 2021 04:57:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634471862; cv=none; d=google.com; s=arc-20160816; b=tq/hktyf8YxIBfFJX+9q2sWs+anfmeVsRdawOn3NrNjUtP2zySY7N/siP+X9/uvv1i RHk2/Aor3a6zP7ft15A3TadcbTT3j56WZ70UTRXwzg/Bwuag3u++fhtYumu8m3Yh5/SH 9ZFXmduHISj8caFs+hb3Sopqmupy10HQ/xfnqBKzxGdB2X9kH2//V+yxb2AWlZ/6XyJJ UJmcnVszNu5MUqBkoG5HCz9r+tC7k+IntFYfMIMtmfXhvkH6pEsx9ReKYQ1abERCmcQS UI11DlSYE09jdPb5FvCJWu+sVF6F18QiKJ7exkF5x8z/0uq3KiNakldEI9cqtr0QEbZw ZsUQ== 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=WBU+852C24LCvIYpivfs9O8LFGGPFOo7ZH8BtmCdNC4=; b=p01sEKjs4uapNlvtv+FJUqizaNheTwbXEQmPAw8atYpqrBEsPIr2QlfnNpDkJiNebF dzISrdKEqIuZ2gDbyBB0V5w/6zkgR3eJ/a+11tSWmn6VJqkt3Zbv4PQjZRQjzn+ArF96 tPabax/jjIPagGMtBnM9VseVX0i6BwtO055Fq8CDat2GvQzRhM8oWsopVDLbAdtRQPoK HQkMvu8zRupzavVpXLUDni37iaG+iteDLoxcQZWgD9thMa9BcKkSv1OlxPNYnCmu97ri ld2Z0qz0jfVg16YaclOKCj1USqZmrjP1Ev2xpxz3chSqIUBzcRu75BV0EdxG3Uyy/T5w A3fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TGfr9USt; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y7si13695724plr.189.2021.10.17.04.57.30; Sun, 17 Oct 2021 04:57:42 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=TGfr9USt; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242114AbhJORSF (ORCPT + 99 others); Fri, 15 Oct 2021 13:18:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238023AbhJORSE (ORCPT ); Fri, 15 Oct 2021 13:18:04 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4419C061570; Fri, 15 Oct 2021 10:15:57 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id d23so9158272pgh.8; Fri, 15 Oct 2021 10:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=WBU+852C24LCvIYpivfs9O8LFGGPFOo7ZH8BtmCdNC4=; b=TGfr9UStHYoJqjhC96U1rii6CH1JoT64eerkCrevRB1+VHlvfdxYw+8k5YsPgefD12 /TUetV2v90RArPFFuGLnBJhmQO0NgmWGz9GVNWDpTleRdoVEos9skunFO9pizdcwAFRB Gz1r7xFlXZgc+/WUTiyvQ5E7sGUwrYY7XJDB7bN08DQigYuXipQD8BLHQfASkybG84bJ yAi3sQmD+V6h2bHSc+PB9DP1PxsEHZ3xr0RcQiXXKJphtJezEefUd/A0pL2JvyG7nNjb Inz5ZBhrcTRXe2xtG9ZnnReUUJ6Q2AjwG3K65OLbDoBUdxisCC5niKKp9QIVZJQs+H0b EqdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WBU+852C24LCvIYpivfs9O8LFGGPFOo7ZH8BtmCdNC4=; b=NMru2sTLSJku5LrXQcoXwRz0qUshsbxqxtzoeeLFIvQASiinGqAbBTZygjILcDTlLS OHBoJ0ychyahc1/yzfadtDqvyB8cr6boqJ7NL9FPVBmBmVWAY4av1VnVXtsw0n4hkkhT pAaqr+Ar0EINQspss64OFNd//ch9YDPVbdrKRKveUwlXBALpkxaW/4J88VuZEgY60v2t 38Ti1nss6HQMrBckWuw+HvyWdzQoiJO5nbJhVVtuROA5Sc811ACjmwC4N4bfHS3cZGGB r2no4Yb4HP8MRxMXaFrAo47PzIg7/Rg32pe0clLJakpnZdGwxowDUXNSwZCvYvX5bTNx PADg== X-Gm-Message-State: AOAM533L4Pyc8i+1UKuim7mbkP1NpEZDv+QfRB9V7ROToaUHZWfpyc2k rqNLQ5IhcIy5Ux8f/+wtqPU= X-Received: by 2002:a62:5297:0:b0:3f4:263a:b078 with SMTP id g145-20020a625297000000b003f4263ab078mr12524004pfb.20.1634318157160; Fri, 15 Oct 2021 10:15:57 -0700 (PDT) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id bb12sm1837350pjb.0.2021.10.15.10.15.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Oct 2021 10:15:56 -0700 (PDT) Subject: Re: [PATCH net-next 6/6] net: dsa: sja1105: parse {rx,tx}-internal-delay-ps properties for RGMII delays To: Vladimir Oltean , "David S . Miller" , Jakub Kicinski , netdev@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rob Herring , Shawn Guo , Andrew Lunn , Heiner Kallweit , Russell King , Vivien Didelot , Vladimir Oltean , Prasanna Vengateshan , Ansuel Smith , =?UTF-8?Q?Alvin_=c5=a0ipraga?= References: <20211013222313.3767605-1-vladimir.oltean@nxp.com> <20211013222313.3767605-7-vladimir.oltean@nxp.com> From: Florian Fainelli Message-ID: Date: Fri, 15 Oct 2021 10:15:41 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211013222313.3767605-7-vladimir.oltean@nxp.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/13/21 3:23 PM, Vladimir Oltean wrote: > This change does not fix any functional issue or address any real life > use case that wasn't possible before. It is just a small step in the > process of standardizing the way in which Ethernet MAC drivers may apply > RGMII delays (traditionally these have been applied by PHYs, with no > clear definition of what to do in the case of a fixed-link). > > The sja1105 driver used to apply MAC-level RGMII delays on the RX data > lines when in fixed-link mode and using a phy-mode of "rgmii-rxid" or > "rgmii-id" and on the TX data lines when using "rgmii-txid" or "rgmii-id". > But the standard definitions don't say anything about behaving > differently when the port is in fixed-link vs when it isn't, and the new > device tree bindings are about having a way of applying the delays in a > way that is independent of the phy-mode and of the fixed-link property. > > When the {rx,tx}-internal-delay-ps properties are present, use them, > otherwise fall back to the old behavior and warn. > > One other thing to note is that the SJA1105 hardware applies a delay > value in degrees rather than in picoseconds (the delay in ps changes > depending on the frequency of the RGMII clock - 125 MHz at 1G, 25 MHz at > 100M, 2.5MHz at 10M). I assume that is fine, we calculate the phase > shift of the internal delay lines assuming that the device tree meant > gigabit, and we let the hardware scale those according to the link speed. > > Link: https://patchwork.kernel.org/project/netdevbpf/patch/20210723173108.459770-6-prasanna.vengateshan@microchip.com/ > Link: https://patchwork.ozlabs.org/project/netdev/patch/20200616074955.GA9092@laureti-dev/#2461123 > Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli FWIW, this is definitively a step in the right direction, and this is a good way to deal with the phy-mode RGMII mess that has plagued us, thanks! -- Florian