diff mbox series

[net,v4,4/5] net: dsa: microchip: use collision based back pressure mode

Message ID 20240531142430.678198-5-enguerrand.de-ribaucourt@savoirfairelinux.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series Add Microchip KSZ 9897 Switch CPU PHY + Errata | expand

Checks

Context Check Description
netdev/series_format warning Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 902 this patch: 902
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers fail 1 blamed authors not CCed: f.fainelli@gmail.com; 5 maintainers not CCed: pabeni@redhat.com kuba@kernel.org edumazet@google.com f.fainelli@gmail.com olteanv@gmail.com
netdev/build_clang success Errors and warnings before: 906 this patch: 906
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: 906 this patch: 906
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
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

Commit Message

Enguerrand de Ribaucourt May 31, 2024, 2:24 p.m. UTC
Errata DS80000758 states that carrier sense back pressure mode can cause
link down issues in 100BASE-TX half duplex mode. The datasheet also
recommends to always use the collision based back pressure mode.

Fixes: b987e98e50ab ("dsa: add DSA switch driver for Microchip KSZ9477")
Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
---
v4:
 - rebase on net/main
 - add Fixes tag
v3: https://lore.kernel.org/all/20240530102436.226189-5-enguerrand.de-ribaucourt@savoirfairelinux.com/
---
 drivers/net/dsa/microchip/ksz9477.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Arun Ramadoss June 3, 2024, 3:23 a.m. UTC | #1
Hi Enguerrand,

> 
> diff --git a/drivers/net/dsa/microchip/ksz9477.c
> b/drivers/net/dsa/microchip/ksz9477.c
> index f8ad7833f5d9..343b9d7538e9 100644
> --- a/drivers/net/dsa/microchip/ksz9477.c
> +++ b/drivers/net/dsa/microchip/ksz9477.c
> @@ -1299,6 +1299,9 @@ int ksz9477_setup(struct dsa_switch *ds)
>         /* Enable REG_SW_MTU__2 reg by setting SW_JUMBO_PACKET */
>         ksz_cfg(dev, REG_SW_MAC_CTRL_1, SW_JUMBO_PACKET, true);
> 
> +       /* Use collision based back pressure mode. */
> +       ksz_cfg(dev, REG_SW_MAC_CTRL_1, SW_BACK_PRESSURE, false);

nitpick: Comment says use collision based back pressure mode, but in
the register write we are clearing it (false). From the datasheet, it
mentions 1 - Carrier based back pressure 0 - Collision based back
pressure. Instead of false, we can have macros like below or something
similar

#define SW_BACK_PRESSURE_COLLISION 0

> +
>         /* Now we can configure default MTU value */
>         ret = regmap_update_bits(ksz_regmap_16(dev), REG_SW_MTU__2,
> REG_SW_MTU_MASK,
>                                  VLAN_ETH_FRAME_LEN + ETH_FCS_LEN);
> --
> 2.34.1
>
diff mbox series

Patch

diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c
index f8ad7833f5d9..343b9d7538e9 100644
--- a/drivers/net/dsa/microchip/ksz9477.c
+++ b/drivers/net/dsa/microchip/ksz9477.c
@@ -1299,6 +1299,9 @@  int ksz9477_setup(struct dsa_switch *ds)
 	/* Enable REG_SW_MTU__2 reg by setting SW_JUMBO_PACKET */
 	ksz_cfg(dev, REG_SW_MAC_CTRL_1, SW_JUMBO_PACKET, true);
 
+	/* Use collision based back pressure mode. */
+	ksz_cfg(dev, REG_SW_MAC_CTRL_1, SW_BACK_PRESSURE, false);
+
 	/* Now we can configure default MTU value */
 	ret = regmap_update_bits(ksz_regmap_16(dev), REG_SW_MTU__2, REG_SW_MTU_MASK,
 				 VLAN_ETH_FRAME_LEN + ETH_FCS_LEN);