From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B103C433EF for ; Thu, 7 Jul 2022 11:01:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234737AbiGGLB3 (ORCPT ); Thu, 7 Jul 2022 07:01:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235052AbiGGLBW (ORCPT ); Thu, 7 Jul 2022 07:01:22 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E12D357238 for ; Thu, 7 Jul 2022 04:01:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=meTVCLauPT8tVIXdbiSRm0UrVZwGUwqcYXp+qq9WOhg=; b=QhwPrliKQE2sX6Vo81x5t3GmUz 0frJ+45A0xAQG6fYJLL30EAE34Z0C1AYKNqxRPXZ+ef79FpNVuTwQsh5ZboleolRvK/oGX5nrzXaK PJOdM2/Qb2fSfCDJqlWMDbBWLPd3lxHanjKIaxsvmeMcPw3babpGJtx+xYvXyKqVWZQvwIX+feRdi MCJbvK+C/xLcWMuCOhxMc6qo5cWypGaxY41SM3xLEmy9GfbrXETZpT1yCd3LDrPJpLgIg4aThM96V HU3NsH7a+JFN3T7O5hJ3YGgO1nafpbH1UyVWhMncs78DpHT7fut8WIV1lAufurr4W3WK+vkKeHNaT tyjHpQTA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:33218) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1o9PFk-0003nU-T9; Thu, 07 Jul 2022 12:01:00 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1o9PFe-0005Db-VO; Thu, 07 Jul 2022 12:00:54 +0100 Date: Thu, 7 Jul 2022 12:00:54 +0100 From: "Russell King (Oracle)" To: Vladimir Oltean Cc: Andrew Lunn , Heiner Kallweit , Alexandre Belloni , Alvin __ipraga , Claudiu Manoil , "David S. Miller" , DENG Qingfang , Eric Dumazet , Florian Fainelli , George McCollister , Hauke Mehrtens , Jakub Kicinski , Kurt Kanzenbach , Landen Chao , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger , netdev@vger.kernel.org, Paolo Abeni , Sean Wang , UNGLinuxDriver@microchip.com, Vivien Didelot , Woojung Huh , Marek =?iso-8859-1?Q?Beh=FAn?= Subject: Re: [PATCH RFC net-next 5/5] net: dsa: always use phylink for CPU and DSA ports Message-ID: References: <20220706102621.hfubvn3wa6wlw735@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220706102621.hfubvn3wa6wlw735@skbuf> Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Jul 06, 2022 at 01:26:21PM +0300, Vladimir Oltean wrote: > Hello, > > On Tue, Jul 05, 2022 at 10:48:07AM +0100, Russell King (Oracle) wrote: > > diff --git a/net/dsa/port.c b/net/dsa/port.c > > index 35b4e1f8dc05..34487e62eb03 100644 > > --- a/net/dsa/port.c > > +++ b/net/dsa/port.c > > @@ -1525,6 +1525,7 @@ int dsa_port_phylink_create(struct dsa_port *dp) > > { > > struct dsa_switch *ds = dp->ds; > > phy_interface_t mode, def_mode; > > + struct device_node *phy_np; > > int err; > > > > /* Presence of phylink_mac_link_state or phylink_mac_an_restart is > > @@ -1559,6 +1560,13 @@ int dsa_port_phylink_create(struct dsa_port *dp) > > return PTR_ERR(dp->pl); > > } > > > > + if (dp->type == DSA_PORT_TYPE_CPU || dp->type == DSA_PORT_TYPE_DSA) { > > + phy_np = of_parse_phandle(dp->dn, "phy-handle", 0); > > + of_node_put(phy_np); > > + if (!phy_np) > > + err = phylink_set_max_fixed_link(dp->pl); > > Can we please limit phylink_set_max_link_speed() to just the CPU ports > where a fixed-link property is also missing, not just a phy-handle? > Although to be entirely correct, we can also have MLO_AN_INBAND, which > wouldn't be covered by these 2 checks and would still represent a valid > DT binding. More importantly, we need your input on Ocelot, which you are listed as a maintainer for, and Ocelot is the only DSA driver that does stuff differently (due to the rate adapting PCS). It doesn't set mac_capabilities, and therefore phylink_set_max_fixed_link() will not work here. Has Ocelot ever made use of this DSA feature where, when nothing is specified for a CPU or DSA port, we use an effective fixed-link setup with an interface mode that gives the highest speed? Or does this not apply to this DSA driver? Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5916C433EF for ; Thu, 7 Jul 2022 11:02:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=P5Q6ryxIO2uPpMiBbhuJ9bJnDpj81hxA29OcDQR1H0o=; b=cw8Xpn7QY/VW+9 7NT7VfxDpZk5NN/TNP02jH+GxIjcoX8ooosIQXbtWESOdUO3oAvWk2rSDwjCbyc4+8EXZJ495/re/ 0nBJl8ycvFhLtBaoJhvQelvcUyMVQJtEwVGCcXebFK8/5o2G/37QeA0NrJt+INahRa16Em99/wTc2 py4+D1q1ytItLoytzBWHipexs2YWpSuFIxQvS6AtxH4pP9CR26FEZZD2GITGT90DR2k5F3X97iT1k mavOWlcUCq/tT8R/FaF4wzuXrkyrt+XpOPkN4EQC+biTsCA2NjibVgnMDJu8eJo+P6RaS8v9vvMss HQgXPxOPNFQiEtdR2dHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9PG4-00FilW-1b; Thu, 07 Jul 2022 11:01:20 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9PG1-00FikI-Hk; Thu, 07 Jul 2022 11:01:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=meTVCLauPT8tVIXdbiSRm0UrVZwGUwqcYXp+qq9WOhg=; b=QhwPrliKQE2sX6Vo81x5t3GmUz 0frJ+45A0xAQG6fYJLL30EAE34Z0C1AYKNqxRPXZ+ef79FpNVuTwQsh5ZboleolRvK/oGX5nrzXaK PJOdM2/Qb2fSfCDJqlWMDbBWLPd3lxHanjKIaxsvmeMcPw3babpGJtx+xYvXyKqVWZQvwIX+feRdi MCJbvK+C/xLcWMuCOhxMc6qo5cWypGaxY41SM3xLEmy9GfbrXETZpT1yCd3LDrPJpLgIg4aThM96V HU3NsH7a+JFN3T7O5hJ3YGgO1nafpbH1UyVWhMncs78DpHT7fut8WIV1lAufurr4W3WK+vkKeHNaT tyjHpQTA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:33218) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1o9PFk-0003nU-T9; Thu, 07 Jul 2022 12:01:00 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1o9PFe-0005Db-VO; Thu, 07 Jul 2022 12:00:54 +0100 Date: Thu, 7 Jul 2022 12:00:54 +0100 From: "Russell King (Oracle)" To: Vladimir Oltean Cc: Andrew Lunn , Heiner Kallweit , Alexandre Belloni , Alvin __ipraga , Claudiu Manoil , "David S. Miller" , DENG Qingfang , Eric Dumazet , Florian Fainelli , George McCollister , Hauke Mehrtens , Jakub Kicinski , Kurt Kanzenbach , Landen Chao , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger , netdev@vger.kernel.org, Paolo Abeni , Sean Wang , UNGLinuxDriver@microchip.com, Vivien Didelot , Woojung Huh , Marek =?iso-8859-1?Q?Beh=FAn?= Subject: Re: [PATCH RFC net-next 5/5] net: dsa: always use phylink for CPU and DSA ports Message-ID: References: <20220706102621.hfubvn3wa6wlw735@skbuf> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220706102621.hfubvn3wa6wlw735@skbuf> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220707_040117_632182_1E9CC512 X-CRM114-Status: GOOD ( 18.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jul 06, 2022 at 01:26:21PM +0300, Vladimir Oltean wrote: > Hello, > > On Tue, Jul 05, 2022 at 10:48:07AM +0100, Russell King (Oracle) wrote: > > diff --git a/net/dsa/port.c b/net/dsa/port.c > > index 35b4e1f8dc05..34487e62eb03 100644 > > --- a/net/dsa/port.c > > +++ b/net/dsa/port.c > > @@ -1525,6 +1525,7 @@ int dsa_port_phylink_create(struct dsa_port *dp) > > { > > struct dsa_switch *ds = dp->ds; > > phy_interface_t mode, def_mode; > > + struct device_node *phy_np; > > int err; > > > > /* Presence of phylink_mac_link_state or phylink_mac_an_restart is > > @@ -1559,6 +1560,13 @@ int dsa_port_phylink_create(struct dsa_port *dp) > > return PTR_ERR(dp->pl); > > } > > > > + if (dp->type == DSA_PORT_TYPE_CPU || dp->type == DSA_PORT_TYPE_DSA) { > > + phy_np = of_parse_phandle(dp->dn, "phy-handle", 0); > > + of_node_put(phy_np); > > + if (!phy_np) > > + err = phylink_set_max_fixed_link(dp->pl); > > Can we please limit phylink_set_max_link_speed() to just the CPU ports > where a fixed-link property is also missing, not just a phy-handle? > Although to be entirely correct, we can also have MLO_AN_INBAND, which > wouldn't be covered by these 2 checks and would still represent a valid > DT binding. More importantly, we need your input on Ocelot, which you are listed as a maintainer for, and Ocelot is the only DSA driver that does stuff differently (due to the rate adapting PCS). It doesn't set mac_capabilities, and therefore phylink_set_max_fixed_link() will not work here. Has Ocelot ever made use of this DSA feature where, when nothing is specified for a CPU or DSA port, we use an effective fixed-link setup with an interface mode that gives the highest speed? Or does this not apply to this DSA driver? Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel