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 38B6CCD1296 for ; Fri, 5 Apr 2024 10:23:27 +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=eanFUV7zHEt+kg6HLGbL8+pPOkvZ9by2qlKusEK9SrU=; b=iub1thbqyT7IW3 NgtFfRTO5y/djwFvFgvermIdR4yYHEccF+y/CfWXSP2nlPYGKUVXiiJ+EONY1RCLa6+K68lNb/Vw6 IncNjih0tWzouioWo3x/psFQLzTuh+s96iaeyhAXbgmnBiYSC9hGYKSnCv3hXdUzR2iRL5gvIdDTN UfzAeCVFVH+qM9pVQw5QA1O84A1aoF6TGi8MyjIwAMaahv3V8W7cjPtxNkpDJRFvcfXoEUoY1weBx ZCza57LZqF1MZe8zASWpUWSrCQshM6LdQEvdsgMsBPU7BE82pk6A9HhgDKyvS4fuNLx983y0xy6ty V4nXod33V3FRY9Ehn2hA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rsgj5-00000006Q44-0Cuz; Fri, 05 Apr 2024 10:23:15 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rsgj1-00000006PUZ-1SgO for linux-arm-kernel@lists.infradead.org; Fri, 05 Apr 2024 10:23:13 +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=h6ooeeo3yUb6+TuxcE/grwqLZtdIxPaR752SVlSVmKQ=; b=XxhDIG9xuOitAMHCbDFb0BlB6B DiryAlmDMJmtwZ815XVyY3qDkdkswFq9dqYmkmXWhgDCmegsEGEdYMyBVsHM7khh2WLVp9LoJ8jjP NE9D52HkUhK2rYVojzqgnHMNzNg0Gj/hegRy7OrJ2+04Tg0M6eah+L9bZBNXqjNTKYlh+XUxTC5tl nGyxozXpq0JW9Y7Un7dWNZy/1jryTfstjW4/EJAW9T6k5HHWt4IJIfsAmWmDDcfdF/Pz52Zldcryh kcaOb7C+cjctXDi4/isMSf+shwF5twQzHYBItIZcIOh7bFSfxIc5pgsi0TLwgNQLlw5EyUPDaFjJR fjLiabFw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:47700) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rsggk-0002HW-22; Fri, 05 Apr 2024 11:20:50 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rsggh-0001Jq-Nk; Fri, 05 Apr 2024 11:20:47 +0100 Date: Fri, 5 Apr 2024 11:20:47 +0100 From: "Russell King (Oracle)" To: Daniel Machon Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , Steen Hegelund , UNGLinuxDriver@microchip.com, Bjarni Jonasson , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] net: sparx5: fix reconfiguration of PCS on link mode change Message-ID: References: <20240405-link-mode-reconfiguration-fix-v1-1-c1480bc2346a@microchip.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240405-link-mode-reconfiguration-fix-v1-1-c1480bc2346a@microchip.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240405_032311_476228_5B2646DD X-CRM114-Status: GOOD ( 15.89 ) 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 Fri, Apr 05, 2024 at 11:53:15AM +0200, Daniel Machon wrote: > It was observed that the PCS would be misconfigured on link mode change, > if the negotiated link mode went from no-inband capabilities to in-band > capabilities. This bug appeared after the neg_mode change of phylink [1], > but is really due to the wrong config being used when reconfiguring the PCS. I don't see how the change you point to could have changed the behaviour. Old code: conf.inband = phylink_autoneg_inband(mode); conf.autoneg = phylink_test(advertising, Autoneg); New code: conf.inband = neg_mode == PHYLINK_PCS_NEG_INBAND_DISABLED || neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED; conf.autoneg = neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED; where, for SGMII or 802.3z modes, neg_mode will be one of PHYLINK_PCS_NEG_INBAND_DISABLED or PHYLINK_PCS_NEG_INBAND_ENABLED if phylink_autoneg_inband(mode) is true, or PHYLINK_PCS_NEG_OUTBAND if not. It does change conf.autoneg slightly in that this will always be true for SGMII, but will only be true for Autoneg + 802.3z modes. As far as your code change goes, it looks correct to me, but I think it's fixing a bug that goes back long before the commit you have identified. However, I think there's another issue here which is more relevant to the problem you describe in your commit message. If you look at port_conf_has_changed(), you will notice that it fails to compare conf.inband, and thus fails to notice any change in the setting of that configuration item. This will result in sparx5_port_pcs_set() not even being called if only conf.inband changes state. Thus, changing from in-band to out-of-band or vice versa won't have any effect if this is the only change that occurs, and this also exists prior to my change. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps 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