generic: 6.1, 6.6: move accepted patches to backport folders
[openwrt/staging/stintel.git] / target / linux / generic / backport-6.6 / 790-53-v6.10-net-dsa-mt7530-do-not-set-MT7530_P5_DIS-when-PHY-.patch
1 From 16e6592cd5c5bd74d8890973489f60176c692614 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: Sun, 28 Apr 2024 12:19:58 +0300
4 Subject: [PATCH] net: dsa: mt7530: do not set MT7530_P5_DIS when PHY muxing is
5 being used
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 DSA initalises the ds->num_ports amount of ports in
11 dsa_switch_touch_ports(). When the PHY muxing feature is in use, port 5
12 won't be defined in the device tree. Because of this, the type member of
13 the dsa_port structure for this port will be assigned DSA_PORT_TYPE_UNUSED.
14 The dsa_port_setup() function calls ds->ops->port_disable() when the port
15 type is DSA_PORT_TYPE_UNUSED.
16
17 The MT7530_P5_DIS bit is unset in mt7530_setup() when PHY muxing is being
18 used. mt7530_port_disable() which is assigned to ds->ops->port_disable() is
19 called afterwards. Currently, mt7530_port_disable() sets MT7530_P5_DIS
20 which breaks network connectivity when PHY muxing is being used.
21
22 Therefore, do not set MT7530_P5_DIS when PHY muxing is being used.
23
24 Fixes: 377174c5760c ("net: dsa: mt7530: move MT753X_MTRAP operations for MT7530")
25 Reported-by: Daniel Golle <daniel@makrotopia.org>
26 Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
27 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
28 Link: https://lore.kernel.org/r/20240428-for-netnext-mt7530-do-not-disable-port5-when-phy-muxing-v2-1-bb7c37d293f8@arinc9.com
29 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
30 ---
31 drivers/net/dsa/mt7530.c | 3 ++-
32 1 file changed, 2 insertions(+), 1 deletion(-)
33
34 --- a/drivers/net/dsa/mt7530.c
35 +++ b/drivers/net/dsa/mt7530.c
36 @@ -1220,7 +1220,8 @@ mt7530_port_disable(struct dsa_switch *d
37 if (priv->id != ID_MT7530 && priv->id != ID_MT7621)
38 return;
39
40 - if (port == 5)
41 + /* Do not set MT7530_P5_DIS when port 5 is being used for PHY muxing. */
42 + if (port == 5 && priv->p5_mode == GMAC5)
43 mt7530_set(priv, MT753X_MTRAP, MT7530_P5_DIS);
44 else if (port == 6)
45 mt7530_set(priv, MT753X_MTRAP, MT7530_P6_DIS);