]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/6.6.28/net-sparx5-fix-wrong-config-being-used-when-reconfig.patch
Linux 6.6.28
[thirdparty/kernel/stable-queue.git] / releases / 6.6.28 / net-sparx5-fix-wrong-config-being-used-when-reconfig.patch
1 From 7b27272df5a59b34fcc3e96cbdf12becdce7e0ce Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Tue, 9 Apr 2024 12:41:59 +0200
4 Subject: net: sparx5: fix wrong config being used when reconfiguring PCS
5
6 From: Daniel Machon <daniel.machon@microchip.com>
7
8 [ Upstream commit 33623113a48ea906f1955cbf71094f6aa4462e8f ]
9
10 The wrong port config is being used if the PCS is reconfigured. Fix this
11 by correctly using the new config instead of the old one.
12
13 Fixes: 946e7fd5053a ("net: sparx5: add port module support")
14 Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
15 Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
16 Link: https://lore.kernel.org/r/20240409-link-mode-reconfiguration-fix-v2-1-db6a507f3627@microchip.com
17 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
18 Signed-off-by: Sasha Levin <sashal@kernel.org>
19 ---
20 drivers/net/ethernet/microchip/sparx5/sparx5_port.c | 4 ++--
21 1 file changed, 2 insertions(+), 2 deletions(-)
22
23 diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_port.c b/drivers/net/ethernet/microchip/sparx5/sparx5_port.c
24 index 3a1b1a1f5a195..60dd2fd603a85 100644
25 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_port.c
26 +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_port.c
27 @@ -731,7 +731,7 @@ static int sparx5_port_pcs_low_set(struct sparx5 *sparx5,
28 bool sgmii = false, inband_aneg = false;
29 int err;
30
31 - if (port->conf.inband) {
32 + if (conf->inband) {
33 if (conf->portmode == PHY_INTERFACE_MODE_SGMII ||
34 conf->portmode == PHY_INTERFACE_MODE_QSGMII)
35 inband_aneg = true; /* Cisco-SGMII in-band-aneg */
36 @@ -948,7 +948,7 @@ int sparx5_port_pcs_set(struct sparx5 *sparx5,
37 if (err)
38 return -EINVAL;
39
40 - if (port->conf.inband) {
41 + if (conf->inband) {
42 /* Enable/disable 1G counters in ASM */
43 spx5_rmw(ASM_PORT_CFG_CSC_STAT_DIS_SET(high_speed_dev),
44 ASM_PORT_CFG_CSC_STAT_DIS,
45 --
46 2.43.0
47