summaryrefslogtreecommitdiff
path: root/drivers/net/dsa/mv88e6xxx
diff options
context:
space:
mode:
authorTobias Waldekranz <tobias@waldekranz.com>2022-03-18 23:13:21 +0300
committerJakub Kicinski <kuba@kernel.org>2022-03-22 01:51:51 +0300
commitbd48b911c88f017a97b1943201d23d6962968d1a (patch)
tree6f366e3ad1cb35f2218f7527630b60591579fec1 /drivers/net/dsa/mv88e6xxx
parentafaed2b142a1ab896764b03d8d26dc8778ea887c (diff)
downloadlinux-bd48b911c88f017a97b1943201d23d6962968d1a.tar.xz
net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback
In the same way that we check for STU support in the MST state callback, we should also verify it before trying to change a VLANs MSTI membership. Fixes: acaf4d2e36b3 ("net: dsa: mv88e6xxx: MST Offloading") Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Tested-by: Marek BehĂșn <kabel@kernel.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx')
-rw-r--r--drivers/net/dsa/mv88e6xxx/chip.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index b36393ba6d49..afb9417ffca0 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -2678,6 +2678,9 @@ static int mv88e6xxx_vlan_msti_set(struct dsa_switch *ds,
u8 old_sid, new_sid;
int err;
+ if (!mv88e6xxx_has_stu(chip))
+ return -EOPNOTSUPP;
+
mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_vtu_get(chip, msti->vid, &vlan);