From patchwork Tue Apr 9 10:41:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Machon X-Patchwork-Id: 13622237 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 1E4EFCD1284 for ; Tue, 9 Apr 2024 10:43:05 +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=UK0awMq4u1nUUkqSLUroSmEQrj6bpj7NEq0duqkgVj8=; b=vrSeO4piUWGtvg 9l5izHPVRUY49KXSxd5i/N8xjlg6JwjnDx6hTI0mwIPXlS5GO/MiRsOTGGimucGeVdJ59MyHkbr1P pHyboR9BmoCCwjfpFbtsU6m6GiU5oGNKFyTFHGhOwq5gL/xfO8y8t1Aqe55NyQRYbIBVfo2T8SbAv XeSM2og59qgoZICXjkj4V/BgvdcyPtsYrYq26xyB9htyzAJ776hssfq7CGDNfyHCY5+kdRTkbU4CL Vi+Lwiz2EeUjT0dCpbb58SfKcuI6xltru4S6fT7MRA79QniWX4w2XKFL6At2GkasmKZwtILd3zb7/ 3Y6utVH17QmWVPy+nIyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ru8wH-00000001VFv-42ua; Tue, 09 Apr 2024 10:42:53 +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 1ru8wD-00000001VEb-1yWb for linux-arm-kernel@lists.infradead.org; Tue, 09 Apr 2024 10:42:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1712659369; x=1744195369; h=from:date:subject:mime-version:content-transfer-encoding: message-id:to:cc; bh=zXZk78fX6ey/HH5mcDYS5WkqMHv4YbyQDlNsKpS0w5c=; b=MkrDI6rPVQmPHPrcP5boQtMm/fp7np0h99EA6xbc7W9nAfgahr5DMH5B 1ukzI3akZPaqKcgLY+lU7sBPPdc1hWL3M2xQYp9dyt4YYxJAhAsf3xhEt SRbvEnzCq/mZXBMKGuVteSag7+b1Fj1sAKORmdccDFc7SgaW+waZD0UKi mWlXFiokPQ3oTuTk8GCKNPpuIrannLoIUJmCHV1TowJH2OD7VnlqP8tTD PZeVBLIq0aPsIYZpl1TBwMZZju3TTvKyIcFT4bJ7QVMSODZvkptP46pQ0 Vh9F0AvsrSup2ZzJ1HjI+y9+KYZ7grfq2iII8uADIK7/+jMu00rKHAvLl g==; X-CSE-ConnectionGUID: aYh2mCPPSBCKJQPimdsGEw== X-CSE-MsgGUID: /BbIteXrSF+o5/uMVSDuLw== X-IronPort-AV: E=Sophos;i="6.07,189,1708412400"; d="scan'208";a="187446254" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 09 Apr 2024 03:42:45 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 9 Apr 2024 03:42:11 -0700 Received: from DEN-DL-M70577.microchip.com (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Tue, 9 Apr 2024 03:42:09 -0700 From: Daniel Machon Date: Tue, 9 Apr 2024 12:41:59 +0200 Subject: [PATCH net v2] net: sparx5: fix wrong config being used when reconfiguring PCS MIME-Version: 1.0 Message-ID: <20240409-link-mode-reconfiguration-fix-v2-1-db6a507f3627@microchip.com> X-B4-Tracking: v=1; b=H4sIAHYbFWYC/4WNQQ6CMBBFr0Jm7Zi2tERdcQ/DAssUJkpLWiQaw t1tegGX//3893dIFJkS3KodIm2cOPgc1KkCO/V+JOQhZ1BCaVELgy/2T5zDQBjJBu94fMd+zSt 0/MHBXRvpyBkjDGTHEinj4r+DpxW6DCdOa4jf8rnJUhW9/qvfJEq0Ul/Ew6paN307s43BTrycb ZihO47jB7PHJFHTAAAA 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-20240409_034249_609953_B0BE474D X-CRM114-Status: GOOD ( 14.22 ) 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 The wrong port config is being used if the PCS is reconfigured. Fix this by correctly using the new config instead of the old one. Fixes: 946e7fd5053a ("net: sparx5: add port module support") Signed-off-by: Daniel Machon Reviewed-by: Jacob Keller --- Changes in v2: - Rewrite subject and commit description - Link to v1: https://lore.kernel.org/r/20240405-link-mode-reconfiguration-fix-v1-1-c1480bc2346a@microchip.com --- drivers/net/ethernet/microchip/sparx5/sparx5_port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- base-commit: 1c25fe9a044d5334153a3585754b26553f8287b9 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,