summaryrefslogtreecommitdiff
path: root/drivers/net/dsa/mv88e6xxx
diff options
context:
space:
mode:
authorTobias Waldekranz <tobias@waldekranz.com>2022-03-18 23:13:20 +0300
committerJakub Kicinski <kuba@kernel.org>2022-03-22 01:51:50 +0300
commitafaed2b142a1ab896764b03d8d26dc8778ea887c (patch)
tree5517e3c48f44c97880479534376b7609df1230ce /drivers/net/dsa/mv88e6xxx
parente0c0ca3546adf6aaa9ba7c7232bd3b1792f3153b (diff)
downloadlinux-afaed2b142a1ab896764b03d8d26dc8778ea887c.tar.xz
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 <kabel@kernel.org> 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.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h
index 6a0b66354e1d..5e03cfe50156 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)