From patchwork Fri Apr 5 09:53:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Machon X-Patchwork-Id: 13618795 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 8FF68CD11C2 for ; Fri, 5 Apr 2024 09:54:51 +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:CC:To:Message-ID:MIME-Version:Subject: Date:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=7v7C3FJvew5uWCbZbTfCtNHOlugrvD7NxYKYYXvS3r8=; b=N4nUM+fmEwLzxX 8nU2xZzVFSJNfnzyrQS/2k1xilqVMk+rw0cKAu51fHv+dJbeG3vItHfqQ6/Y4tTA5oZxtjN6k2aE8 JUzlbHvTmTY2QIBkH8W3k9zm2dtm8fiEIzfa+fdwQdpmjK8rdwx6P/vyqY5yQjJ97n1Kt4tLb1JJZ 2hmIhBokl7Jx6xagZSTLS/KVw0N8ynSuAJnsFypqhUSrkKMb3y8wUwYWswQHeT0LERzHgq3LvegDI xpBLo/DmWvxFSELg4EXS++r+6r7Y5SiKB1m76gGYyEQH/7V9nkeruY2RMPNf9vvwId3EmVKVJTNiY 8eDpnpbR0MzTZdg5ZVAQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rsgHR-00000006HrK-1V8r; Fri, 05 Apr 2024 09:54:41 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rsgHM-00000006HnS-2sW6 for linux-arm-kernel@lists.infradead.org; Fri, 05 Apr 2024 09:54:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1712310876; x=1743846876; h=from:date:subject:mime-version:content-transfer-encoding: message-id:to:cc; bh=Jcma1Bkmpn4Xfp/xZhIBVU0xAUREIn9xkPWZ8Dn7Qlc=; b=WuYXBkSb31Sgzz7C77M2sUV6LmvdbC2oP30rkqaqA2LL3tGL9iLSA86S snmiPwmLHlr2jnDjIhC0tg00vt4du6PMP/RdUAJJGp2Sp4zsEmpMizj+1 8yqgNVhrARaxv6IGO+5oKSIXhdA6SzECJTzjHTqcz2mAR9VcZthhW9KiK o5S14iIk9pedBLWUBbyw6ekpwA6mVTsFQxFT4edVW4vGY9PMzEuC3Gv4w Y6TmmZqJ1MLGdz3fXedK1AmiHqk0bLofdZe5eEsT85WHUVrEK20bYbSCN ILhwUNwOzbzsOuuvt6E0MLz8SGWKW+zczaFrK8l1nKEfEnJqqU5/SeH1D w==; X-CSE-ConnectionGUID: 1vip42wHS0yTUSEiMowacg== X-CSE-MsgGUID: RvUkIgroQcSLUOvJQ5lDEg== X-IronPort-AV: E=Sophos;i="6.07,181,1708412400"; d="scan'208";a="20163440" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 05 Apr 2024 02:54:32 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 5 Apr 2024 02:53:52 -0700 Received: from DEN-DL-M70577.microchip.com (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Fri, 5 Apr 2024 02:53:49 -0700 From: Daniel Machon Date: Fri, 5 Apr 2024 11:53:15 +0200 Subject: [PATCH net] net: sparx5: fix reconfiguration of PCS on link mode change MIME-Version: 1.0 Message-ID: <20240405-link-mode-reconfiguration-fix-v1-1-c1480bc2346a@microchip.com> X-B4-Tracking: v=1; b=H4sIAArKD2YC/x2MwQrCQAwFf6XkbGBbXUF/RTyU7ksNalayVYTSf zd4nIGZlRpc0ejcreT4aNNqAf2uo+k22gzWEkxDGg5pnzI/1O78rAXsmKqJzm8fl6hY9MtFTsd eIDmnTPF4OUL//xcyLHTdth8IFnkldAAAAA== To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , "Steen Hegelund" , , Bjarni Jonasson CC: , , , Steen Hegelund , Daniel Machon X-Mailer: b4 0.14-dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240405_025436_818459_DD1A0433 X-CRM114-Status: GOOD ( 14.10 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Fix this by correctly using the new port configuration instead of the old one. [1] https://lore.kernel.org/netdev/ZIxQIBfO9dH5xFlg@shell.armlinux.org.uk/ Fixes: 946e7fd5053a ("net: sparx5: add port module support") Signed-off-by: Daniel Machon --- drivers/net/ethernet/microchip/sparx5/sparx5_port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- base-commit: d76c740b2eaaddc5fc3a8b21eaec5b6b11e8c3f5 change-id: 20240305-link-mode-reconfiguration-fix-df961fef5505 Best regards, diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_port.c b/drivers/net/ethernet/microchip/sparx5/sparx5_port.c index 3a1b1a1f5a19..60dd2fd603a8 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_port.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_port.c @@ -731,7 +731,7 @@ static int sparx5_port_pcs_low_set(struct sparx5 *sparx5, bool sgmii = false, inband_aneg = false; int err; - if (port->conf.inband) { + if (conf->inband) { if (conf->portmode == PHY_INTERFACE_MODE_SGMII || conf->portmode == PHY_INTERFACE_MODE_QSGMII) inband_aneg = true; /* Cisco-SGMII in-band-aneg */ @@ -948,7 +948,7 @@ int sparx5_port_pcs_set(struct sparx5 *sparx5, if (err) return -EINVAL; - if (port->conf.inband) { + if (conf->inband) { /* Enable/disable 1G counters in ASM */ spx5_rmw(ASM_PORT_CFG_CSC_STAT_DIS_SET(high_speed_dev), ASM_PORT_CFG_CSC_STAT_DIS,