Merge tag 'tag-chrome-platform-for-v5.9' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / drivers / net / dsa / mt7530.c
index 34e4aad..8dcb8a4 100644 (file)
@@ -807,10 +807,15 @@ mt7530_port_set_vlan_aware(struct dsa_switch *ds, int port)
                   PCR_MATRIX_MASK, PCR_MATRIX(MT7530_ALL_MEMBERS));
 
        /* Trapped into security mode allows packet forwarding through VLAN
-        * table lookup.
+        * table lookup. CPU port is set to fallback mode to let untagged
+        * frames pass through.
         */
-       mt7530_rmw(priv, MT7530_PCR_P(port), PCR_PORT_VLAN_MASK,
-                  MT7530_PORT_SECURITY_MODE);
+       if (dsa_is_cpu_port(ds, port))
+               mt7530_rmw(priv, MT7530_PCR_P(port), PCR_PORT_VLAN_MASK,
+                          MT7530_PORT_FALLBACK_MODE);
+       else
+               mt7530_rmw(priv, MT7530_PCR_P(port), PCR_PORT_VLAN_MASK,
+                          MT7530_PORT_SECURITY_MODE);
 
        /* Set the port as a user port which is to be able to recognize VID
         * from incoming packets before fetching entry within the VLAN table.
@@ -1077,12 +1082,6 @@ mt7530_port_vlan_add(struct dsa_switch *ds, int port,
        struct mt7530_priv *priv = ds->priv;
        u16 vid;
 
-       /* The port is kept as VLAN-unaware if bridge with vlan_filtering not
-        * being set.
-        */
-       if (!dsa_port_is_vlan_filtering(dsa_to_port(ds, port)))
-               return;
-
        mutex_lock(&priv->reg_mutex);
 
        for (vid = vlan->vid_begin; vid <= vlan->vid_end; ++vid) {
@@ -1108,12 +1107,6 @@ mt7530_port_vlan_del(struct dsa_switch *ds, int port,
        struct mt7530_priv *priv = ds->priv;
        u16 vid, pvid;
 
-       /* The port is kept as VLAN-unaware if bridge with vlan_filtering not
-        * being set.
-        */
-       if (!dsa_port_is_vlan_filtering(dsa_to_port(ds, port)))
-               return 0;
-
        mutex_lock(&priv->reg_mutex);
 
        pvid = priv->ports[port].pvid;
@@ -1227,6 +1220,7 @@ mt7530_setup(struct dsa_switch *ds)
         * as two netdev instances.
         */
        dn = dsa_to_port(ds, MT7530_CPU_PORT)->master->dev.of_node->parent;
+       ds->configure_vlan_while_not_filtering = true;
 
        if (priv->id == ID_MT7530) {
                regulator_set_voltage(priv->core_pwr, 1000000, 1000000);