blob: e26829ee60b142a4f37c17fc6706e23f65967476 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From 0141792f8b7300006b874dda1c35acd0abd90d9d Mon Sep 17 00:00:00 2001
2From: DENG Qingfang <dqfext@gmail.com>
3Date: Fri, 15 May 2020 23:25:55 +0800
4Subject: net: dsa: mt7530: fix VLAN setup
5
6Allow DSA to add VLAN entries even if VLAN filtering is disabled, so
7enabling it will not block the traffic of existent ports in the bridge
8
9Signed-off-by: DENG Qingfang <dqfext@gmail.com>
10Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
11Signed-off-by: David S. Miller <davem@davemloft.net>
12---
13 drivers/net/dsa/mt7530.c | 13 +------------
14 1 file changed, 1 insertion(+), 12 deletions(-)
15
16--- a/drivers/net/dsa/mt7530.c
17+++ b/drivers/net/dsa/mt7530.c
18@@ -1083,12 +1083,6 @@ mt7530_port_vlan_add(struct dsa_switch *
19 struct mt7530_priv *priv = ds->priv;
20 u16 vid;
21
22- /* The port is kept as VLAN-unaware if bridge with vlan_filtering not
23- * being set.
24- */
25- if (!dsa_port_is_vlan_filtering(&ds->ports[port]))
26- return;
27-
28 mutex_lock(&priv->reg_mutex);
29
30 for (vid = vlan->vid_begin; vid <= vlan->vid_end; ++vid) {
31@@ -1114,12 +1108,6 @@ mt7530_port_vlan_del(struct dsa_switch *
32 struct mt7530_priv *priv = ds->priv;
33 u16 vid, pvid;
34
35- /* The port is kept as VLAN-unaware if bridge with vlan_filtering not
36- * being set.
37- */
38- if (!dsa_port_is_vlan_filtering(&ds->ports[port]))
39- return 0;
40-
41 mutex_lock(&priv->reg_mutex);
42
43 pvid = priv->ports[port].pvid;
44@@ -1233,6 +1221,7 @@ mt7530_setup(struct dsa_switch *ds)
45 * as two netdev instances.
46 */
47 dn = ds->ports[MT7530_CPU_PORT].master->dev.of_node->parent;
48+ ds->configure_vlan_while_not_filtering = true;
49
50 if (priv->id == ID_MT7530) {
51 regulator_set_voltage(priv->core_pwr, 1000000, 1000000);