Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1452580pxj; Sat, 8 May 2021 18:34:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoeGIvlkmpxPep/EsqGsB/iDTuvsuyWATEeeBaDI8ABlod1wh5VAAoggdNkLp55wfSxGJD X-Received: by 2002:a17:906:1e49:: with SMTP id i9mr17999067ejj.536.1620524055326; Sat, 08 May 2021 18:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620524055; cv=none; d=google.com; s=arc-20160816; b=Bo91WG8yvH8aWmAQC1u3WZzaOl0D0UsPO8I7PXhS3p8YmOb/OwQsVWzitktnak05qm WL2dA7rOzOqmUf9Krfo4fT8cXDY41QlEa9ApVNlOS2c1OfkRgIYU4GmPINb9/THP/kL7 iWNCj+xjqdCdsa7I2Dwuzax8Z+HxPvNDdRGfCr5woHmHE+e5I3Wk3X8CUQabAsDnX5ql pzRbEIbOJQsq8D3pH+5McYvgd8P1Jdq3kZo5aP2axa9m1Y9IUuUKqqnaAA4JyQ4QDXYM lxiiLrQh6aWCBqWMf8hat2v0dzimtFCpthVrWYu7+pwu+BBsTV0niAcEEZa6BVTiB6aO A51Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9vnwAiyYXa2oP0JBeWRiWYLgvxr2IUcGmZqGCZAaZXo=; b=ZNk4C0pgVYpED5OCANMZh/DSXC2cmYx3ZinvxhTUHMlRAikta5Rqg4iQ1hlncZwWYB 5TXwK/cKiy7spxh8A2xzTys2gg6cWVrI37roWlRFAhNtEsjyLzI8/xQiwZsRT+BzOXjH A+BuU2XNWZvLOzQpcE+YS1XhrK4ZDYebaaUzD4Y0VPv9AwgAahRxI/rH7kyjgim5C5Id xyuEkm579l/HXTr1FOdVvs2nTxKDPxrAPSOOx2cA5KTXdc51bi6jYdSlG1Mg+u3H21o4 G1Qtb8DQVJ+U9QfWrlGpB4KHiwNibEe09pV4acy0+MVFz3mdu+wW53k2AyG4pDOLSyav UMKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="RWosHT/q"; 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 g6si9535479edb.247.2021.05.08.18.33.49; Sat, 08 May 2021 18:34:15 -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=20161025 header.b="RWosHT/q"; 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 S229712AbhEIBSi (ORCPT + 99 others); Sat, 8 May 2021 21:18:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbhEIBSg (ORCPT ); Sat, 8 May 2021 21:18:36 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFD51C061573; Sat, 8 May 2021 18:17:32 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id l13so12921131wru.11; Sat, 08 May 2021 18:17:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9vnwAiyYXa2oP0JBeWRiWYLgvxr2IUcGmZqGCZAaZXo=; b=RWosHT/qHPR+nKtfWZ+oJfy+thE+RKq6tBYUQdjph0TG/Ij6yWbhmaxU1WStegt+GZ B9vn/+XeRX4PpNbWo72TMIym6ny7HxAJ8CI4fQVdxpD0/OpYwzmALkQlenTWIZNfP+Hd OvFrLyfH6y71IHQnSR9hcCBZ/UODb8K3b6XHAGeHoNxLz6cS3A2ovM7T313wFuXy+ZrU XtwqQx4+EQQNquJx1LceyNMAL2InVRH1F5G7DwuYIkvT5jxAaBa51i8q9yJ+ln2ldPM2 LksXWk6Oa41rY4SJpG4/Pb4aW1G03EH1kAuI1DOmhM/5FsYIpa4Z0h1r/5dKMgLfXVLY DxhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9vnwAiyYXa2oP0JBeWRiWYLgvxr2IUcGmZqGCZAaZXo=; b=DmTxNmjBdrhpGrKf68c1QBgh3mv6euE0MZ3xzAyAW7df2Tdt15F0MR8rjaToTCj9Fx exacHaSJOx4dDVb8h9XqU54QPzvHQQUNcAy/OtsrWDbWRORRkyjjYx9fNQPF1NTxeUoQ 0EuXdpZm6zJn/TFjwZpRiSH42w6f+aW61lXgmh6Z1gKJTlz7LmN15nzSkOv/w0GuMwGa zNCy1QC/fXy3sTKLuRxuXIqWJ7kCnHzLHIMjRM3mBHeV/3dEpHT4ZrdNiX67iA83Re7d mokqTlQNJUxZnpnp6kc3Xw6wIGUKJF8/KV+D/y+Vqg5O79UzWF2Fvx4xpemmuIAnHxtS PQCA== X-Gm-Message-State: AOAM531q0ywGqaBi57DtVGS0e8IdxDvQErCmSWc0mRzdkwEuv/VWHv0K +ww0hLDtuVlJyEkfWxyE1m4= X-Received: by 2002:adf:f3cd:: with SMTP id g13mr14869742wrp.94.1620523051512; Sat, 08 May 2021 18:17:31 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-35-189-2.ip56.fastwebnet.it. [93.35.189.2]) by smtp.gmail.com with ESMTPSA id b7sm16414063wri.83.2021.05.08.18.17.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 May 2021 18:17:31 -0700 (PDT) Date: Sun, 9 May 2021 03:17:23 +0200 From: Ansuel Smith To: Andrew Lunn Cc: Florian Fainelli , Vivien Didelot , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Russell King , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH net-next v4 19/28] net: dsa: qca8k: make rgmii delay configurable Message-ID: References: <20210508002920.19945-1-ansuelsmth@gmail.com> <20210508002920.19945-19-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 09, 2021 at 03:07:15AM +0200, Andrew Lunn wrote: > On Sun, May 09, 2021 at 01:58:07AM +0200, Ansuel Smith wrote: > > On Sat, May 08, 2021 at 08:12:26PM +0200, Andrew Lunn wrote: > > > > + > > > > + /* Assume only one port with rgmii-id mode */ > > > > > > Since this is only valid for the RGMII port, please look in that > > > specific node for these properties. > > > > > > Andrew > > > > Sorry, can you clarify this? You mean that I should check in the phandle > > pointed by the phy-handle or that I should modify the logic to only > > check for one (and the unique in this case) rgmii port? > > Despite there only being one register, it should be a property of the > port. If future chips have multiple RGMII ports, i expect there will > be multiple registers. To avoid confusion in the future, we should > make this a proper to the port it applies to. So assuming the RGMII > port is port 0: > > #address-cells = <1>; > #size-cells = <0>; > port@0 { > reg = <0>; > label = "cpu"; > ethernet = <&gmac1>; > phy-mode = "rgmii"; > fixed-link { > speed = 1000; > full-duplex; > }; > rx-internal-delay-ps = <2000>; > tx-internal-delay-ps = <2000>; > }; > > port@1 { > reg = <1>; > label = "lan1"; > phy-handle = <&phy_port1>; > }; > > port@2 { > reg = <2>; > label = "lan2"; > phy-handle = <&phy_port2>; > }; > > port@3 { > reg = <3>; > label = "lan3"; > phy-handle = <&phy_port3>; > }; > > port@4 { > reg = <4>; > label = "lan4"; > phy-handle = <&phy_port4>; > }; > > port@5 { > reg = <5>; > label = "wan"; > phy-handle = <&phy_port5>; > }; > }; > }; > }; > > You also should validate that phy-mode is rgmii and only rgmii. You > get into odd situations if it is any of the other three rgmii modes. > > Andrew And that is the intention of the port. I didn't want the binding to be set on the switch node but on the rgmii node. Correct me if I'm wrong but isn't what this patch already do? In of_rgmii_delay I get the ports node of the current switch, iterate every port, find the one with the phy-mode set to "rgmii-id" and check if it's present any value. And save the value in the priv struct. The actual delay is applied in the phylink_mac_config only if the mode is set to rgmii-id. (the current code set by default a delay of 3000 with rgmii-id, so this is just to make this value configurable)