From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C8C81772C; Tue, 2 Jan 2024 23:13:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96.2) (envelope-from ) id 1rKnx0-0001EK-1z; Tue, 02 Jan 2024 23:13:35 +0000 Date: Wed, 3 Jan 2024 00:10:54 +0100 From: Daniel Golle To: Eric Woudstra Cc: "Russell King (Oracle)" , Alexander Couzens , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Frank Wunderlich , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH RFC net-next] net: pcs: pcs-mtk-lynxi fix mtk_pcs_lynxi_get_state() for 2500base-x Message-ID: References: <20240102074408.1049203-1-ericwouds@gmail.com> <92190426-3614-4774-9E9F-18F121622788@gmail.com> <74223164-ab50-4d6d-a4f4-561b0a70d396@gmail.com> <6666EB36-984E-4898-A41A-2D9713DE4DB0@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6666EB36-984E-4898-A41A-2D9713DE4DB0@gmail.com> On Tue, Jan 02, 2024 at 11:13:58PM +0100, Eric Woudstra wrote: > I believe the general idea is that phylink should be aware wether to use inband or outband negotiation in order to setup the hardware correctly. Speaking of a situation where there is a PHY attached. Well, SGMII speed/duplex AN is not defined for 2500Base-X by any standard and not supported by the hardware (unlike e.g. RealTek which came up with their own proprietary extension called HiSGMII). So we should simply never set the SGMII_SPEED_DUPLEX_AN bit if using 2500Base-X on MediaTek LynxI PCS -- in-band link status will still work, and as 2500Base-X anyway only supports 2500M speed at full duplex it is not a problem that speed and duplex are hard-coded in the driver in this case imho. And that works fine for SFPs with and without present/discoverable/accessible PHY. Surely, having phylink take care whether SGMII_SPEED_DUPLEX_AN should be set would be even nicer. I believe that source of confusion here is simply that in-band-status != SGMII_SPEED_DUPLEX_AN We *do* have in-band-status even without having SGMII_SPEED_DUPLEX_AN set with 2500Base-X link mode (as in: link being up or down and link, duplex and speed is fixed anyway for 2500Base-X). > > On January 2, 2024 9:01:23 PM GMT+01:00, Daniel Golle wrote: > >On Tue, Jan 02, 2024 at 08:33:32PM +0100, Eric Woudstra wrote: > >> [...] > >> > >> So if phylink_mii_c22_pcs_decode_state() should not set the speed, then it is not correctly set somewhere else. > > > >Yes, but the fix should go to pcs-mtk-lynxi.c and you don't need to > >change phylink for it to work. > >This should be enough: > >https://patchwork.kernel.org/project/netdevbpf/patch/091e466912f1333bb76d23e95dc6019c9b71645f.1699565880.git.daniel@makrotopia.org/ > >