Skip to content

Commit 1e78179

Browse files
bwh-mindgregkh
authored andcommitted
net: dsa: microchip: ksz8795: Fix VLAN untagged flag change on deletion
commit af01754 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: e66f840 ("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>
1 parent 5033d5e commit 1e78179

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

drivers/net/dsa/microchip/ksz8795.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,6 @@ static void ksz8795_port_vlan_add(struct dsa_switch *ds, int port,
895895
static int ksz8795_port_vlan_del(struct dsa_switch *ds, int port,
896896
const struct switchdev_obj_port_vlan *vlan)
897897
{
898-
bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
899898
struct ksz_device *dev = ds->priv;
900899
u16 data, vid, pvid;
901900
u8 fid, member, valid;
@@ -904,8 +903,6 @@ static int ksz8795_port_vlan_del(struct dsa_switch *ds, int port,
904903
ksz_pread16(dev, port, REG_PORT_CTRL_VID, &pvid);
905904
pvid = pvid & 0xFFF;
906905

907-
ksz_port_cfg(dev, port, P_TAG_CTRL, PORT_REMOVE_TAG, untagged);
908-
909906
for (vid = vlan->vid_begin; vid <= vlan->vid_end; vid++) {
910907
ksz8795_r_vlan_table(dev, vid, &data);
911908
ksz8795_from_vlan(data, &fid, &member, &valid);

0 commit comments

Comments
 (0)