diff mbox series

[net,2/2] net: dsa: mt7530: fix port mirroring for MT7988 SoC switch

Message ID 20240413-b4-for-net-mt7530-fix-mirroring-to-local-port-and-mt7988-v1-2-476deff8cc06@arinc9.com (mailing list archive)
State Accepted
Commit 2c606d138518cc69f09c35929abc414a99e3a28f
Delegated to: Netdev Maintainers
Headers show
Series Fix port mirroring on MT7530 DSA subdriver | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
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: 926 this patch: 926
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 15 of 15 maintainers
netdev/build_clang success Errors and warnings before: 937 this patch: 937
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: 937 this patch: 937
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 20 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
netdev/contest success net-next-2024-04-15--15-00 (tests: 961)

Commit Message

Arınç ÜNAL via B4 Relay April 13, 2024, 1:01 p.m. UTC
From: Arınç ÜNAL <arinc.unal@arinc9.com>

The "MT7988A Wi-Fi 7 Generation Router Platform: Datasheet (Open Version)
v0.1" document shows bits 16 to 18 as the MIRROR_PORT field of the CPU
forward control register. Currently, the MT7530 DSA subdriver configures
bits 0 to 2 of the CPU forward control register which breaks the port
mirroring feature for the MT7988 SoC switch.

Fix this by using the MT7531_MIRROR_PORT_GET() and MT7531_MIRROR_PORT_SET()
macros which utilise the correct bits.

Fixes: 110c18bfed41 ("net: dsa: mt7530: introduce driver for MT7988 built-in switch")
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
---
 drivers/net/dsa/mt7530.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Daniel Golle April 14, 2024, 3:41 a.m. UTC | #1
On Sat, Apr 13, 2024 at 04:01:40PM +0300, Arınç ÜNAL via B4 Relay wrote:
> From: Arınç ÜNAL <arinc.unal@arinc9.com>
> 
> The "MT7988A Wi-Fi 7 Generation Router Platform: Datasheet (Open Version)
> v0.1" document shows bits 16 to 18 as the MIRROR_PORT field of the CPU
> forward control register. Currently, the MT7530 DSA subdriver configures
> bits 0 to 2 of the CPU forward control register which breaks the port
> mirroring feature for the MT7988 SoC switch.
> 
> Fix this by using the MT7531_MIRROR_PORT_GET() and MT7531_MIRROR_PORT_SET()
> macros which utilise the correct bits.
> 
> Fixes: 110c18bfed41 ("net: dsa: mt7530: introduce driver for MT7988 built-in switch")
> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>

Acked-by: Daniel Golle <daniel@makrotopia.org>

> ---
>  drivers/net/dsa/mt7530.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
> index b84e1845fa02..8090390edaf9 100644
> --- a/drivers/net/dsa/mt7530.c
> +++ b/drivers/net/dsa/mt7530.c
> @@ -1883,14 +1883,16 @@ mt7530_port_vlan_del(struct dsa_switch *ds, int port,
>  
>  static int mt753x_mirror_port_get(unsigned int id, u32 val)
>  {
> -	return (id == ID_MT7531) ? MT7531_MIRROR_PORT_GET(val) :
> -				   MIRROR_PORT(val);
> +	return (id == ID_MT7531 || id == ID_MT7988) ?
> +		       MT7531_MIRROR_PORT_GET(val) :
> +		       MIRROR_PORT(val);
>  }
>  
>  static int mt753x_mirror_port_set(unsigned int id, u32 val)
>  {
> -	return (id == ID_MT7531) ? MT7531_MIRROR_PORT_SET(val) :
> -				   MIRROR_PORT(val);
> +	return (id == ID_MT7531 || id == ID_MT7988) ?
> +		       MT7531_MIRROR_PORT_SET(val) :
> +		       MIRROR_PORT(val);
>  }
>  
>  static int mt753x_port_mirror_add(struct dsa_switch *ds, int port,
> 
> -- 
> 2.40.1
> 
>
diff mbox series

Patch

diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index b84e1845fa02..8090390edaf9 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -1883,14 +1883,16 @@  mt7530_port_vlan_del(struct dsa_switch *ds, int port,
 
 static int mt753x_mirror_port_get(unsigned int id, u32 val)
 {
-	return (id == ID_MT7531) ? MT7531_MIRROR_PORT_GET(val) :
-				   MIRROR_PORT(val);
+	return (id == ID_MT7531 || id == ID_MT7988) ?
+		       MT7531_MIRROR_PORT_GET(val) :
+		       MIRROR_PORT(val);
 }
 
 static int mt753x_mirror_port_set(unsigned int id, u32 val)
 {
-	return (id == ID_MT7531) ? MT7531_MIRROR_PORT_SET(val) :
-				   MIRROR_PORT(val);
+	return (id == ID_MT7531 || id == ID_MT7988) ?
+		       MT7531_MIRROR_PORT_SET(val) :
+		       MIRROR_PORT(val);
 }
 
 static int mt753x_port_mirror_add(struct dsa_switch *ds, int port,