diff mbox series

[net,v1,1/1] net: dsa: microchip: Correct initialization order for KSZ88x3 ports

Message ID 20240516070852.1953381-1-o.rempel@pengutronix.de (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net,v1,1/1] net: dsa: microchip: Correct initialization order for KSZ88x3 ports | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 920 this patch: 920
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 11 of 11 maintainers
netdev/build_clang success Errors and warnings before: 925 this patch: 925
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 925 this patch: 925
netdev/checkpatch warning WARNING: line length of 81 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-05-17--00-00 (tests: 1034)

Commit Message

Oleksij Rempel May 16, 2024, 7:08 a.m. UTC
Adjust the initialization sequence of KSZ88x3 switches to enable
802.1p priority control on Port 2 before configuring Port 1. This
change ensures the apptrust functionality on Port 1 operates
correctly, as it depends on the priority settings of Port 2. The
prior initialization sequence incorrectly configured Port 1 first,
which could lead to functional discrepancies.

Fixes: a1ea57710c9d ("net: dsa: microchip: dcb: add special handling for KSZ88X3 family")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/net/dsa/microchip/ksz_dcb.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Hariprasad Kelam May 16, 2024, 7:28 a.m. UTC | #1
> Adjust the initialization sequence of KSZ88x3 switches to enable 802.1p
> priority control on Port 2 before configuring Port 1. This change ensures the
> apptrust functionality on Port 1 operates correctly, as it depends on the
> priority settings of Port 2. The prior initialization sequence incorrectly
> configured Port 1 first, which could lead to functional discrepancies.
> 
> Fixes: a1ea57710c9d ("net: dsa: microchip: dcb: add special handling for
> KSZ88X3 family")
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  drivers/net/dsa/microchip/ksz_dcb.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/net/dsa/microchip/ksz_dcb.c
> b/drivers/net/dsa/microchip/ksz_dcb.c
> index a971063275629..19b228b849247 100644
> --- a/drivers/net/dsa/microchip/ksz_dcb.c
> +++ b/drivers/net/dsa/microchip/ksz_dcb.c
> @@ -805,5 +805,18 @@ int ksz_dcb_init(struct ksz_device *dev)
>  	if (ret)
>  		return ret;
> 
> +	/* Enable 802.1p priority control on Port 2 during switch initialization.
> +	 * This setup is critical for the apptrust functionality on Port 1, which
> +	 * relies on the priority settings of Port 2. Note: Port 1 is naturally
> +	 * configured before Port 2, necessitating this configuration order.
> +	 */
> +	if (ksz_is_ksz88x3(dev)) {
> +		ret = ksz_prmw8(dev, KSZ_PORT_2,
Nit :  instead, just call return ksz_prmw8();
Reviewed-by: Hariprasad Kelam <hkelam@marvell.com>



> KSZ8_REG_PORT_1_CTRL_0,
> +				KSZ8_PORT_802_1P_ENABLE,
> +				KSZ8_PORT_802_1P_ENABLE);
> +		if (ret)
> +			return ret;

Thanks,
Hariprasad k
> +	}
> +
>  	return 0;
>  }
> --
> 2.39.2
>
diff mbox series

Patch

diff --git a/drivers/net/dsa/microchip/ksz_dcb.c b/drivers/net/dsa/microchip/ksz_dcb.c
index a971063275629..19b228b849247 100644
--- a/drivers/net/dsa/microchip/ksz_dcb.c
+++ b/drivers/net/dsa/microchip/ksz_dcb.c
@@ -805,5 +805,18 @@  int ksz_dcb_init(struct ksz_device *dev)
 	if (ret)
 		return ret;
 
+	/* Enable 802.1p priority control on Port 2 during switch initialization.
+	 * This setup is critical for the apptrust functionality on Port 1, which
+	 * relies on the priority settings of Port 2. Note: Port 1 is naturally
+	 * configured before Port 2, necessitating this configuration order.
+	 */
+	if (ksz_is_ksz88x3(dev)) {
+		ret = ksz_prmw8(dev, KSZ_PORT_2, KSZ8_REG_PORT_1_CTRL_0,
+				KSZ8_PORT_802_1P_ENABLE,
+				KSZ8_PORT_802_1P_ENABLE);
+		if (ret)
+			return ret;
+	}
+
 	return 0;
 }