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 CBE6BC636CD for ; Fri, 10 Feb 2023 12:53:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231970AbjBJMxa (ORCPT ); Fri, 10 Feb 2023 07:53:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231609AbjBJMx2 (ORCPT ); Fri, 10 Feb 2023 07:53:28 -0500 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64B1F6BD1A; Fri, 10 Feb 2023 04:53:25 -0800 (PST) Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1pQStm-0007XU-0V; Fri, 10 Feb 2023 13:53:06 +0100 Date: Fri, 10 Feb 2023 12:52:56 +0000 From: Daniel Golle To: "Russell King (Oracle)" Cc: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Heiner Kallweit , Lorenzo Bianconi , Mark Lee , John Crispin , Felix Fietkau , AngeloGioacchino Del Regno , Matthias Brugger , DENG Qingfang , Landen Chao , Sean Wang , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Vladimir Oltean , Florian Fainelli , Andrew Lunn , Jianhui Zhao , =?iso-8859-1?Q?Bj=F8rn?= Mork Subject: Re: [PATCH v2 11/11] net: dsa: mt7530: use external PCS driver Message-ID: References: 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 Fri, Feb 10, 2023 at 10:56:57AM +0000, Russell King (Oracle) wrote: > On Tue, Feb 07, 2023 at 02:24:17PM +0000, Daniel Golle wrote: > > @@ -2728,11 +2612,11 @@ mt753x_phylink_mac_select_pcs(struct dsa_switch *ds, int port, > > > > switch (interface) { > > case PHY_INTERFACE_MODE_TRGMII: > > + return &priv->pcs[port].pcs; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > case PHY_INTERFACE_MODE_SGMII: > > case PHY_INTERFACE_MODE_1000BASEX: > > case PHY_INTERFACE_MODE_2500BASEX: > > - return &priv->pcs[port].pcs; > > - > > + return priv->ports[port].sgmii_pcs; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > My only concern here is that we also use the PCS when in TRGMII mode in > this driver, but the mtk pcs code from mtk_eth_soc doesn't handle > TRGMII (and getting the link timer will fail for this mode, causing > the pcs_config() method to fail.) > > Thus, this driver will stop working in TRGMII mode. But in TRGMII mode we return &priv->pcs[port].pcs which is not the PCS code from mtk_eth_soc now moved to the new pcs-mtk-lynxi driver, but rather the old existing codepath from mt7530.c. The new PCS driver only replaces mt7531_sgmii_pcs_* functions, which were all nearly identical with what is now in pcs-mtk-lynxi.c. Or do I miss something here?