Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp597900lqp; Fri, 5 Apr 2024 03:21:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWecJjpPv3u5LGRNCklsv942V8pqTOZkvGF+D8e8ME8Dxam+V4NUbboU06XBT5eRi5QnMcAtJXFBR1XtujC6L/fK3iz2LgRP3OZArRbqg== X-Google-Smtp-Source: AGHT+IHoCAyPwJQozNJSTzlFq9VO8Mh0LXaBmwZ5PDOyKHWriuooWcXWDli5K/R3HGcd/rN9QhbS X-Received: by 2002:a17:906:a895:b0:a4e:2a5b:f94 with SMTP id ha21-20020a170906a89500b00a4e2a5b0f94mr844471ejb.6.1712312492835; Fri, 05 Apr 2024 03:21:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712312492; cv=pass; d=google.com; s=arc-20160816; b=W+TkU36yAZQVQufdtF9ormCbZLQhmAe/0G0H9R23euDUyv+DffUs2rWk6FjF3DJdZ7 gQk9JY7DzFZJBk3+6o1mdvaeOB2ZrXNbDfIPO1YIJQS7pXdD0NWe7JxpVtHQ83MMJh5G 5ERm9xMw6g7907ObIIWaMKKkUk4TcaFpd+bgPPtqSp7oayh1c6q5fetgQznt5xRYl6M+ OCXZwdVtPRw8xi1RQnKiH13Smx4nz1MksfAZGFnyfDX3/3Ma0zoxJwyfgclUYYnw+S7g 6O918vcbi295nc0bxu9S0DYXFchyj70wJXwVGPrR6caH3vZjAJjEwfo3XT7kp55NCYiF yxJw== ARC-Message-Signature: i=2; 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=h6ooeeo3yUb6+TuxcE/grwqLZtdIxPaR752SVlSVmKQ=; fh=31zKWmGXgCHrbr1u+Rm9d+TZ2H4wSZ2Ld7bh5pqpqaw=; b=rFCULwpc8/ldfzBpRoX3u5eOQZkJ71bqnvxNaOHUzCBGATVqIe4rFWvCbmFsrSfbEt 5r3RyLIudVnAewEth6lTEho1mHYJ7pO86Q83kxQ8mUsChxva+JoanT/PXwW2u2UPEz79 /LQKq/1KCBxL13O217h5p8gM45MDvjJkPNbgWhSahnQupkSTSK/s945NbOs2VRNJhPnw rlXOK63jblc9sEXcM2hWibsPqdc1wI28OlNaiLFJQdAWiUz4GicFQZ3df7bwBh1VgHJO chkXdcXwzytqBBUDvyxGU9AiNtO4iMOGntRGO13hDK4WqxAYc+yX6eetsexWxCat1ryr Bcow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=XxhDIG9x; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-132815-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132815-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 am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id dc23-20020a170906c7d700b00a4e2a10b9d9si565250ejb.91.2024.04.05.03.21.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 03:21:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132815-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=XxhDIG9x; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-132815-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132815-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8B4F71F25748 for ; Fri, 5 Apr 2024 10:21:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 76FEB16ABC3; Fri, 5 Apr 2024 10:21:14 +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="XxhDIG9x" 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 C18F0160798; Fri, 5 Apr 2024 10:21:10 +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=1712312473; cv=none; b=Yv3hYd9Expuo95jSPfV5yGpg+5ffTzUfNBPdKojHpiBSNuQ4o6eLeuyD61IcpdE7u1lCYC/ouVbWSdXSaVaXef5PMnGxMlvKVPx5f5/sM7e0VCC7ojcDjEaSq7dkORC2RRRukhVAVPBiMq1W3uGvMJKigtI/yaQhkl3wtTSyNuo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712312473; c=relaxed/simple; bh=8OTcYbM5BXtHpjptecVPfKlc9zekT5TkSATwQT2nhFg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=foCApdi0hU3JecENYDeQ4+vC0RIeK0KLhPyhqzQ35SxLBRykJXQ2xIhlBtH2O3sHG85aN6MP3kJmZ2NcW7c1bk2GbiwVQyrfaB37tj6W1ANxDjS8II9T4WaHsD5ta5RFX17ixbY4C3QI+h9639MRQJizv0KkGOAVcTI+iq+0vcw= 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=XxhDIG9x; 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 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> 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: <20240405-link-mode-reconfiguration-fix-v1-1-c1480bc2346a@microchip.com> Sender: Russell King (Oracle) 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!