From: Tobias Waldekranz Date: Fri, 18 Mar 2022 20:13:20 +0000 (+0100) Subject: net: dsa: mv88e6xxx: Require ops be implemented to claim STU support X-Git-Tag: v6.6.17~7931^2~20^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=afaed2b142a1ab896764b03d8d26dc8778ea887c;p=platform%2Fkernel%2Flinux-rpi.git net: dsa: mv88e6xxx: Require ops be implemented to claim STU support Simply having a physical STU table in the device doesn't do us any good if there's no implementation of the relevant ops to access that table. So ensure that chips that claim STU support can also talk to the hardware. This fixes an issue where chips that had a their ->info->max_sid set (due to their family membership), but no implementation (due to their chip-specific ops struct) would fail to probe. Fixes: 49c98c1dc7d9 ("net: dsa: mv88e6xxx: Disentangle STU from VTU") Reported-by: Marek BehĂșn Signed-off-by: Tobias Waldekranz Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Tested-by: Marek BehĂșn Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h index 6a0b663..5e03cfe 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.h +++ b/drivers/net/dsa/mv88e6xxx/chip.h @@ -730,7 +730,9 @@ struct mv88e6xxx_hw_stat { static inline bool mv88e6xxx_has_stu(struct mv88e6xxx_chip *chip) { - return chip->info->max_sid > 0; + return chip->info->max_sid > 0 && + chip->info->ops->stu_loadpurge && + chip->info->ops->stu_getnext; } static inline bool mv88e6xxx_has_pvt(struct mv88e6xxx_chip *chip)