net: dsa: microchip: ksz8795: Fix VLAN untagged flag change on deletion
authorBen Hutchings <ben.hutchings@mind.be>
Mon, 16 Aug 2021 18:09:38 +0000 (20:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Aug 2021 06:59:19 +0000 (08:59 +0200)
commit1e78179d75fb796b015f4d71d01d8e8725fde466
treeff4fc9535fcfd84adc0317a7561b0acdaabb9e34
parent5033d5e231551162e7830c6cb42851b37ea4ff65
net: dsa: microchip: ksz8795: Fix VLAN untagged flag change on deletion

commit af01754f9e3c553a2ee63b4693c79a3956e230ab upstream.

When a VLAN is deleted from a port, the flags in struct
switchdev_obj_port_vlan are always 0.  ksz8_port_vlan_del() copies the
BRIDGE_VLAN_INFO_UNTAGGED flag to the port's Tag Removal flag, and
therefore always clears it.

In case there are multiple VLANs configured as untagged on this port -
which seems useless, but is allowed - deleting one of them changes the
remaining VLANs to be tagged.

It's only ever necessary to change this flag when a VLAN is added to
the port, so leave it unchanged in ksz8_port_vlan_del().

Fixes: e66f840c08a2 ("net: dsa: ksz: Add Microchip KSZ8795 DSA driver")
Signed-off-by: Ben Hutchings <ben.hutchings@mind.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backport to 5.10: adjust context]
Signed-off-by: Ben Hutchings <ben.hutchings@mind.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/dsa/microchip/ksz8795.c