generic: v6.1, v6.6: add patch to fix PHY-muxing on MT7530
[openwrt/openwrt.git] / target / linux / generic / pending-6.1 / 795-01-net-dsa-mt7530-do-not-set-MT7530_P5_DIS-when-PHY-.patch
1 From patchwork Sat Apr 27 11:24:42 2024
2 Content-Type: text/plain; charset="utf-8"
3 MIME-Version: 1.0
4 Content-Transfer-Encoding: 8bit
5 X-Patchwork-Submitter: =?utf-8?b?QXLEsW7DpyDDnE5BTCB2aWEgQjQgUmVsYXk=?=
6 <devnull+arinc.unal.arinc9.com@kernel.org>
7 X-Patchwork-Id: 13645655
8 From: =?utf-8?b?QXLEsW7DpyDDnE5BTCB2aWEgQjQgUmVsYXk=?=
9 <devnull+arinc.unal.arinc9.com@kernel.org>
10 Date: Sat, 27 Apr 2024 14:24:42 +0300
11 Subject: [PATCH net-next] net: dsa: mt7530: do not set MT7530_P5_DIS when
12 PHY muxing is being used
13 Precedence: bulk
14 X-Mailing-List: netdev@vger.kernel.org
15 List-Id: <netdev.vger.kernel.org>
16 List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
17 List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
18 MIME-Version: 1.0
19 Message-Id:
20 <20240427-for-netnext-mt7530-do-not-disable-port5-when-phy-muxing-v1-1-793cdf9d7707@arinc9.com>
21 To: Daniel Golle <daniel@makrotopia.org>, DENG Qingfang <dqfext@gmail.com>,
22 Sean Wang <sean.wang@mediatek.com>, Andrew Lunn <andrew@lunn.ch>,
23 Florian Fainelli <f.fainelli@gmail.com>,
24 Vladimir Oltean <olteanv@gmail.com>,
25 "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>,
26 Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
27 Matthias Brugger <matthias.bgg@gmail.com>,
28 AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
29 Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
30 linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org,
31 =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= <arinc.unal@arinc9.com>
32 X-Mailer: b4 0.13.0
33 X-Patchwork-Delegate: kuba@kernel.org
34
35 From: Arınç ÜNAL <arinc.unal@arinc9.com>
36
37 When the PHY muxing feature is in use, port 5 won't be defined in the
38 device tree. Because of this, the type member of the dsa_port structure for
39 this port will be assigned DSA_PORT_TYPE_UNUSED. The dsa_port_setup()
40 function calls ds->ops->port_disable() when the port type is
41 DSA_PORT_TYPE_UNUSED.
42
43 The MT7530_P5_DIS bit is unset when PHY muxing is being used.
44 mt7530_port_disable() which is assigned to ds->ops->port_disable() is
45 called afterwards. Currently, mt7530_port_disable() sets MT7530_P5_DIS
46 which breaks network connectivity when PHY muxing is being used.
47
48 Therefore, do not set MT7530_P5_DIS when PHY muxing is being used.
49
50 Fixes: 377174c5760c ("net: dsa: mt7530: move MT753X_MTRAP operations for MT7530")
51 Reported-by: Daniel Golle <daniel@makrotopia.org>
52 Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
53 ---
54 Hello.
55
56 I've sent this to net-next as the patch it fixes is on the current
57 development cycle.
58 ---
59 drivers/net/dsa/mt7530.c | 2 +-
60 1 file changed, 1 insertion(+), 1 deletion(-)
61
62
63 ---
64 base-commit: 5c4c0edca68a5841a8d53ccd49596fe199c8334c
65 change-id: 20240427-for-netnext-mt7530-do-not-disable-port5-when-phy-muxing-7ff5fd0995d7
66
67 Best regards,
68
69 --- a/drivers/net/dsa/mt7530.c
70 +++ b/drivers/net/dsa/mt7530.c
71 @@ -1213,7 +1213,7 @@ mt7530_port_disable(struct dsa_switch *d
72 if (priv->id != ID_MT7530 && priv->id != ID_MT7621)
73 return;
74
75 - if (port == 5)
76 + if (port == 5 && priv->p5_mode == GMAC5)
77 mt7530_set(priv, MT753X_MTRAP, MT7530_P5_DIS);
78 else if (port == 6)
79 mt7530_set(priv, MT753X_MTRAP, MT7530_P6_DIS);