Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6509539rdb; Tue, 2 Jan 2024 04:37:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IH5m5sM9GKibGiddy+UE3KVdik6rw7+cwOagu/HKbx1vKBWlFDKK3VF65t2k4n9wuHiW+ED X-Received: by 2002:a05:6870:558d:b0:1fb:851:bc2b with SMTP id qj13-20020a056870558d00b001fb0851bc2bmr7767668oac.57.1704199025195; Tue, 02 Jan 2024 04:37:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704199025; cv=none; d=google.com; s=arc-20160816; b=0ICbMlrY4rfLHkb2KsCEFuEec7vqMzcIgdJ67pMJbfi8aJuzHPZVLwxIdups9lipk9 HG1fNYqNuguAiwQZjHviPYsDOm6ze9DHF8/2qRFTXJzfQ2fd4HrgY0z5VBbH1m38miCm b+PFh6WRDY11PbFL1qmunRia5P6WrQAGMDr+sHDv3J06JqNVP8PjoSaNB8/+8RcBg4ZE Fl8hiWhQjU/nndX7yVNnBmpPcwgkOEuSkoPw4aAkG6nwnLiPBwyfrpW78kDyZxRNuodE M4jBV5aPGkTY/y7WSbVd/6SZaSxLOX/8VthkD17a4j4wkjdyn6j/+sMZnpRiyR7OqP6F WvUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=EKt6waYkREQSl8TOEPwS+m4Ybyc4+NtjQUDV5bNbQWs=; fh=mkPEXdWst9rIHdTmkkh2ufTVhIz6a+LJ/aifHOVH1Z0=; b=or/cyaswQdg+kW99GmQ5cVnyj7fZdnEU3cZvbu2acd3P0VcVnLQcoG8xb1new37nmz 9b+rM2SfpgPvTHXLXYedzB2+w2w3EIMInb57tcLIM8/z1PwXS/7Qs1lVoPyYapnDQ2fA LcdJDw7bdKMzDlk/RGqn6wbyfl1Z94HnDAp8aNfOnNviwNCL4hN7qWjSdSljN7TCNAEQ xN9Ef6biYf+QX/1VoqFyTtuHqDytnA2+esb341dLcK0GqkFilCu3X2tlgXXsC8jUF5kH +wWx2cOJRZRk4aqyIr/TuFwekG+qyJCq+uvPIwmcVicWRRkhcCY+9bPBJBqVGs3qjnb/ lx3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=S0UnOMij; spf=pass (google.com: domain of linux-kernel+bounces-14347-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14347-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 24-20020a631858000000b005cdb49a80adsi18096227pgy.144.2024.01.02.04.37.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 04:37:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-14347-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=S0UnOMij; spf=pass (google.com: domain of linux-kernel+bounces-14347-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14347-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D2E6928304E for ; Tue, 2 Jan 2024 12:37:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C7C84F512; Tue, 2 Jan 2024 12:36:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="S0UnOMij" X-Original-To: linux-kernel@vger.kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 0C6DFF4F4; Tue, 2 Jan 2024 12:36:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk 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=EKt6waYkREQSl8TOEPwS+m4Ybyc4+NtjQUDV5bNbQWs=; b=S0UnOMijCUX3JsRUr+wAE4YgUf eE9RQMlrBh1t9kmigzTWvhMhi71gOETUnZhO+58XxWphtoXyw3uthVlbhWzEuqXTEH/jKgMnD9XJl lmE+XNhJUHF4E+87DAc3z6ASZSw1QTFP9k1pURiHfE7GXVyX6QCvE5yYzFQFA03Pl1dvr00fH2EKx nBHnIgIodzNv0e3nV/Ki3wMSXzEzYEgkbAW2gSB0cLcZblTqgz3Tv1j2/V/gJBR6BYrQEw/n9ow2V vaC8ZxRUMlczXMv27GBH+Q9orgljB4nUEdNR/Og6ySj5CmdbIGo1dWgr4RNBOe0t3c2yxxdiiNp1p eywa18Ig==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:34188) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rKe0f-0006Xv-27; Tue, 02 Jan 2024 12:36:41 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rKe0h-0005IC-OE; Tue, 02 Jan 2024 12:36:43 +0000 Date: Tue, 2 Jan 2024 12:36:43 +0000 From: "Russell King (Oracle)" To: Eric Woudstra Cc: Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Daniel Golle , 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: phylink: add quirk for disabling in-band-status for mediatek pcs at 2500base-x Message-ID: References: <20240102074326.1049179-1-ericwouds@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@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: <20240102074326.1049179-1-ericwouds@gmail.com> Sender: Russell King (Oracle) On Tue, Jan 02, 2024 at 08:43:26AM +0100, Eric Woudstra wrote: > In follow up to: net: pcs: pcs-mtk-lynxi: use 2500Base-X without AN > > MediaTek LynxI PCS, 2500Base-X will only work without inband status due to > hardware limitation. Yes, we need better support for 2500base-X connected to a PHY. Currently, we treat both base-X interface modes as _media_ side modes by looking at the Autoneg bit. However, given that 2500base-X has been around for ages in vendor-specific forms, we need to do better. The introduction of the PHYLINK_PCS_NEG_* enum and phylink_pcs_neg_mode() is a step towards resolving this (as well as ensuring consistency of implementation so we _can_ start to address it in phylink rather than having different PCS drivers doing weird stuff.) I am _not_ of the opinion that we should be dealing with this based on compatibles or anything like that. As 6.6 was declared LTS, I think we can now move phylink_pcs_neg_mode() into phylink.c, and thus think about what we should do with: + /* 1000base-X is designed for use media-side for Fibre + * connections, and thus the Autoneg bit needs to be + * taken into account. We also do this for 2500base-X + * as well, but drivers may not support this, so may + * need to override this. + */ + if (!phylink_autoneg_inband(mode)) + neg_mode = PHYLINK_PCS_NEG_OUTBAND; + else if (linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, + advertising)) + neg_mode = PHYLINK_PCS_NEG_INBAND_ENABLED; + else + neg_mode = PHYLINK_PCS_NEG_INBAND_DISABLED; + break; Specifically, the linkmode_test_bit() bit. When there is a PHY present, the link between the PCS and PHY should _not_ depend on Autoneg as that is indicates what we want for the _media_ side, and in the case of a PCS-to-PHY link, that is not the media. The next issue is the one that you refer to, and there's several issues: 1. some implementations of 2500base-X do not support inband 2. some implementations of 2500base-X appear to require inband (e.g. mvneta, mvpp2) I have some thoughts on this, but I don't have the time to express them in email at the moment (too much to get through post-Christmas post- Covid.) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!