Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp711476pxb; Sun, 10 Oct 2021 09:18:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxOAye64PKa5NekzX17ircJE6SzqQX5eYBi7QON3W6XQz62PplHTXE03+KLUd06yic5o1l X-Received: by 2002:a17:90a:3b49:: with SMTP id t9mr25041326pjf.218.1633882680483; Sun, 10 Oct 2021 09:18:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633882680; cv=none; d=google.com; s=arc-20160816; b=0BuOZsL3k13wOEoKz6ZL6dqhQBfc+gVpt/WWOCoeAcJk/AOquZbcaIXIDahj195j29 o/zXIV2akjk3GETUEzQGw5LD2mVcdVs/NWn99C1btuHS+j+h3KI9ZhK9sAg7QZrGtJGO bMgluClqUVF5buSj4CEGMfh0Yop2oMEhrTDMOLVu1oAyGfVCo3yhR1VO0oqWtevseApW L9kSPKh6j7vBMJj6MIchWWoOIKk4GXplE7SnBVP9zIQj1N3uHmbGbcl62c5MBROCHC9e TYJe2NstQqsiaimYEP2LubhUCDcTJEPpmKJierJDScc4IZ7xTZBwnOjYLWFgA8EFpHBL 8HXg== 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=H1FlB6h8c3CqipFaPQqaP8QMAtjkuQBI+zm5aKB+zwU=; b=FijCyYJ2jcBzolVS0DUzhERc5uaxk6/lIJMGEn96s0wscwH/xHvHNjWwJ23MldOTYj eCLzwVHFTdGRL/3upbyokFz2/FJBYNROXRi4Z8V5RJONhpxJKhWIN8S4k+d+XcMx335g Nw+8lrFbSLfSXDO7RhAcfv6UUUc04/DDYZYBi0j3YMuVVBkBBh/KrflV5TfILg7fSDFF naLAXTwEr9WY9BIP+F7IU/Zx6f5Fpoi6J1AMZHDcff3mBA20bdUrbOkg0VEYjtwBoUsi cXj3LmY/qdNp0bWr9HpONOYy9r/hrdYfjvRV4DmLjLRBOC9NjQBdBeiKO8blmZr8I84L RzAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=U2p1M6eC; 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 g65si6818804pgc.559.2021.10.10.09.17.43; Sun, 10 Oct 2021 09:18:00 -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=@lunn.ch header.s=20171124 header.b=U2p1M6eC; 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 S232707AbhJJPUU (ORCPT + 99 others); Sun, 10 Oct 2021 11:20:20 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:59576 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231663AbhJJPUT (ORCPT ); Sun, 10 Oct 2021 11:20:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=H1FlB6h8c3CqipFaPQqaP8QMAtjkuQBI+zm5aKB+zwU=; b=U2p1M6eCNWOhrLXdNiPMtKWI7Q Gh3LwOluONq6NWP10EbXZ8hnUqJEEuVlQleBVqNLSJwQGOSYcJzdd9Yb7rUjJYGj326XZxztqh/eW 0uum/+DWMl+oLNMvmElSCfpGrZHgJ9E/VOGWXwcvtPX5PGcNcocXkoIXKoXAoWmNkfaE=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mZaae-00AF1d-8j; Sun, 10 Oct 2021 17:18:16 +0200 Date: Sun, 10 Oct 2021 17:18:16 +0200 From: Andrew Lunn To: Vladimir Oltean Cc: Ansuel Smith , Vivien Didelot , Florian Fainelli , "David S. Miller" , Jakub Kicinski , Rob Herring , Russell King , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [net-next PATCH v4 06/13] net: dsa: qca8k: move rgmii delay detection to phylink mac_config Message-ID: References: <20211010111556.30447-1-ansuelsmth@gmail.com> <20211010111556.30447-7-ansuelsmth@gmail.com> <20211010124732.fageoraoweqqfoew@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211010124732.fageoraoweqqfoew@skbuf> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > -{ > > - struct device_node *port_dn; > > - phy_interface_t mode; > > - struct dsa_port *dp; > > - u32 val; > > - > > - /* CPU port is already checked */ > > - dp = dsa_to_port(priv->ds, 0); > > - > > - port_dn = dp->dn; > > - > > - /* Check if port 0 is set to the correct type */ > > - of_get_phy_mode(port_dn, &mode); > > - if (mode != PHY_INTERFACE_MODE_RGMII_ID && > > - mode != PHY_INTERFACE_MODE_RGMII_RXID && > > - mode != PHY_INTERFACE_MODE_RGMII_TXID) { > > - return 0; > > - } > > - > > - switch (mode) { > > - case PHY_INTERFACE_MODE_RGMII_ID: > > - case PHY_INTERFACE_MODE_RGMII_RXID: > > Also, since you touch this area. > There have been tons of discussions on this topic, but I believe that > your interpretation of the RGMII delays is wrong. > Basically a MAC should not apply delays based on the phy-mode string (so > it should treat "rgmii" same as "rgmii-id"), but based on the value of > "rx-internal-delay-ps" and "tx-internal-delay-ps". > The phy-mode is for a PHY to use. There is one exception to this, when the MAC is taking the place of a PHY, i.e. CPU port. You need delays added somewhere, and the mv88e6xxx driver will look at the phy-mode in this case. And i think in general, a DSA driver needs this for the CPU port. Andrew