kernel: bump 6.1 to 6.1.89
[openwrt/staging/pepe2k.git] / target / linux / generic / backport-6.1 / 790-51-v6.10-net-dsa-mt7530-fix-port-mirroring-for-MT7988-SoC-swi.patch
1 From 019a17a5e76940ea86114838d1d638d4dc8d3750 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <arinc.unal@arinc9.com>
3 Date: Sat, 13 Apr 2024 16:01:40 +0300
4 Subject: [PATCH 3/5] net: dsa: mt7530: fix port mirroring for MT7988 SoC
5 switch
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 The "MT7988A Wi-Fi 7 Generation Router Platform: Datasheet (Open Version)
11 v0.1" document shows bits 16 to 18 as the MIRROR_PORT field of the CPU
12 forward control register. Currently, the MT7530 DSA subdriver configures
13 bits 0 to 2 of the CPU forward control register which breaks the port
14 mirroring feature for the MT7988 SoC switch.
15
16 Fix this by using the MT7531_MIRROR_PORT_GET() and MT7531_MIRROR_PORT_SET()
17 macros which utilise the correct bits.
18
19 Fixes: 110c18bfed41 ("net: dsa: mt7530: introduce driver for MT7988 built-in switch")
20 Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
21 Acked-by: Daniel Golle <daniel@makrotopia.org>
22 Signed-off-by: David S. Miller <davem@davemloft.net>
23 ---
24 drivers/net/dsa/mt7530.c | 10 ++++++----
25 1 file changed, 6 insertions(+), 4 deletions(-)
26
27 --- a/drivers/net/dsa/mt7530.c
28 +++ b/drivers/net/dsa/mt7530.c
29 @@ -1890,14 +1890,16 @@ mt7530_port_vlan_del(struct dsa_switch *
30
31 static int mt753x_mirror_port_get(unsigned int id, u32 val)
32 {
33 - return (id == ID_MT7531) ? MT7531_MIRROR_PORT_GET(val) :
34 - MIRROR_PORT(val);
35 + return (id == ID_MT7531 || id == ID_MT7988) ?
36 + MT7531_MIRROR_PORT_GET(val) :
37 + MIRROR_PORT(val);
38 }
39
40 static int mt753x_mirror_port_set(unsigned int id, u32 val)
41 {
42 - return (id == ID_MT7531) ? MT7531_MIRROR_PORT_SET(val) :
43 - MIRROR_PORT(val);
44 + return (id == ID_MT7531 || id == ID_MT7988) ?
45 + MT7531_MIRROR_PORT_SET(val) :
46 + MIRROR_PORT(val);
47 }
48
49 static int mt753x_port_mirror_add(struct dsa_switch *ds, int port,