From mboxrd@z Thu Jan 1 00:00:00 1970 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 7B462240223 for ; Tue, 14 Jan 2025 11:15:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736853322; cv=none; b=jPFZtnGVM7983oUupJvXR9h48kfjiNdfkVBP/l2bM7/eKOF0rcixRjFX2VTFHQX+ITbfeRQCeW1/87PxWCvDtlN38w2VrCXbMhyQ4PKQ8no/IvOCfa3iuLPgQA+T84x9IrBhafuUSGzFNCcYg11ofMdMapmLc/fOkB9KFCPAjyk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736853322; c=relaxed/simple; bh=AHAYJtYLNi2WVuSK9ldR8/CoDuaQ0eI+FUTX1wm9rec=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=paNC03YkebNmSXRtvwiQo8FYMLfmsDrBFNN3Vha5DPP5ixhMM46Z8tzIKRN9wmvDI5JlX9U55I+g8hhUVLLvs3VRsAQdWahw1v3UsoMZ/rcPfiQrFuRIQy1oQQgQB54UqQJpoQxJHRoVU1MZcNOuySY2ijisfcuNXLp4TFUUlPA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=jM6R8gP4; arc=none smtp.client-ip=78.32.30.218 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="jM6R8gP4" 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=JZBQIV1rRjI0xYXaCOtBy163ScPwbEBWMDHXyIm/YjI=; b=jM6R8gP4ktl0i842LQaaCmoj98 6Ff1EZ9aNhz4IzmwA6RXLfKqZ9bwN+vaYZHmD8wxjrWoS/Onmro4a8iii2dLVgVAQ0hDnL69WjM8w PVqxKHPtT4k7gxC1dtM/u3ex9NcN7gqXCt4l3NBuHjY/QiueQ9hCNSC94uM89fABajHYWv9EIww54 LYKaas5cyWh20ZG5V4NYuILSG8oZHLK2LBsWvuVykDq2HRO0zLTMdMu1CewCdOtxJr0LjSFWSqnKw 1pq63da8L2iVNQgqmwem41MgHO1QPsxWroRJTPSk82toIc2nU2RL+M+JXlnVY1AWJtSM1FAiIPn5Q xhSc19VQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:55932) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tXesa-0007xA-2e; Tue, 14 Jan 2025 11:14:41 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.96) (envelope-from ) id 1tXesS-00052V-1M; Tue, 14 Jan 2025 11:14:32 +0000 Date: Tue, 14 Jan 2025 11:14:32 +0000 From: "Russell King (Oracle)" To: Eric Woudstra Cc: Heiner Kallweit , Andrew Lunn , Alexander Couzens , Alexander Duyck , Andrew Lunn , AngeloGioacchino Del Regno , =?utf-8?B?QXLEsW7DpyDDnE5BTA==?= , Claudiu Beznea , Daniel Golle , Daniel Machon , "David S. Miller" , DENG Qingfang , Eric Dumazet , Florian Fainelli , Horatiu Vultur , Ioana Ciornei , Jakub Kicinski , Jose Abreu , kernel-team@meta.com, Lars Povlsen , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Madalin Bucur , Marcin Wojtas , Matthias Brugger , Michal Simek , netdev@vger.kernel.org, Nicolas Ferre , Paolo Abeni , Radhey Shyam Pandey , Sean Anderson , Sean Wang , Steen Hegelund , Taras Chornyi , UNGLinuxDriver@microchip.com, Vladimir Oltean Subject: Re: [PATCH net-next v2 0/5] net: phylink: fix PCS without autoneg Message-ID: References: <29240b2d-8a34-47d6-8b99-a371668b0bef@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: <29240b2d-8a34-47d6-8b99-a371668b0bef@gmail.com> Sender: Russell King (Oracle) On Tue, Jan 14, 2025 at 11:59:06AM +0100, Eric Woudstra wrote: > On 1/13/25 10:21 AM, Russell King (Oracle) wrote: > > Hi, > > > > Eric Woudstra reported that a PCS attached using 2500base-X does not > > see link when phylink is using in-band mode, but autoneg is disabled, > > despite there being a valid 2500base-X signal being received. We have > > these settings: > > > > act_link_an_mode = MLO_AN_INBAND > > pcs_neg_mode = PHYLINK_PCS_NEG_INBAND_DISABLED > > > > Eric diagnosed it to phylink_decode_c37_word() setting state->link > > false because the full-duplex bit isn't set in the non-existent link > > partner advertisement word (which doesn't exist because in-band > > autoneg is disabled!) > > > > The test in phylink_mii_c22_pcs_decode_state() is supposed to catch > > this state, but since we converted PCS to use neg_mode, testing the > > Autoneg in the local advertisement is no longer sufficient - we need > > to be looking at the neg_mode, which currently isn't provided. > > > > We need to provide this via the .pcs_get_state() method, and this > > will require modifying all PCS implementations to add the extra > > argument to this method. > > > > Patch 1 uses the PCS neg_mode in phylink_mac_pcs_get_state() to correct > > the now obsolute usage of the Autoneg bit in the advertisement. > > > > Patch 2 passes neg_mode into the .pcs_get_state() method, and updates > > all users. > > > > Patch 3 adds neg_mode as an argument to the various clause 22 state > > decoder functions in phylink, modifying drivers to pass the neg_mode > > through. > > > > Patch 4 makes use of phylink_mii_c22_pcs_decode_state() rather than > > using the Autoneg bit in the advertising field. > > > > Patch 5 may be required for Eric's case - it ensures that we report > > the correct state for interface types that we support only one set > > of modes for when autoneg is disabled. > > > > Changes in v2: > > - Add test for NULL pcs in patch 1 > > > > I haven't added Eric's t-b because I used a different fix in patch 1. > > So I tested this V2 patch and with the first link up command, I get the > link up which is functional end to end. > > Tested-by: Eric Woudstra > > PS, FYI: I do however still have the difference in phylink_mac_config(). > > At first the link is up with (before phy attached): > phylink_mac_config: mode=inband/2500base-x > > When the phy is attached, phylink_mac_config() is not called, but we > have functional link. > > When I do: ethtool -s eth1 advertise 0x28, then: > phylink_mac_config: mode=inband/sgmii > > And back again: ethtool -s eth1 advertise 0x800000000028, then: > phylink_mac_config: mode=phy/2500base-x > > I can share more log entries if needed. I'm not worried - there's a sixth patch that I need to send once this set of five are merged that will fix the above weirdness. Thanks for testing. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!