diff mbox series

[net-next,2/2] net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback

Message ID 20220318201321.4010543-3-tobias@waldekranz.com (mailing list archive)
State Accepted
Commit bd48b911c88f017a97b1943201d23d6962968d1a
Delegated to: Netdev Maintainers
Headers show
Series net: dsa: mv88e6xxx: MST Fixes | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 9 of 9 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Tobias Waldekranz March 18, 2022, 8:13 p.m. UTC
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>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Vladimir Oltean March 18, 2022, 8:41 p.m. UTC | #1
On Fri, Mar 18, 2022 at 09:13:21PM +0100, Tobias Waldekranz wrote:
> 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>

>  drivers/net/dsa/mv88e6xxx/chip.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> 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);
> -- 
> 2.25.1
>
Florian Fainelli March 18, 2022, 9:23 p.m. UTC | #2
On 3/18/22 1:13 PM, Tobias Waldekranz wrote:
> 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: Florian Fainelli <f.fainelli@gmail.com>
Marek Behún March 19, 2022, 7 p.m. UTC | #3
On Fri, 18 Mar 2022 21:13:21 +0100
Tobias Waldekranz <tobias@waldekranz.com> wrote:

> 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>

Tested-by: Marek Behún <kabel@kernel.org>
diff mbox series

Patch

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);