Skip to content

Commit

Permalink
net: dsa: mv88e6xxx: Require ops be implemented to claim STU support
Browse files Browse the repository at this point in the history
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: 49c98c1 ("net: dsa: mv88e6xxx: Disentangle STU from VTU")
Reported-by: Marek Behún <[email protected]>
Signed-off-by: Tobias Waldekranz <[email protected]>
Reviewed-by: Vladimir Oltean <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Tested-by: Marek Behún <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
wkz authored and kuba-moo committed Mar 21, 2022
1 parent e0c0ca3 commit afaed2b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/dsa/mv88e6xxx/chip.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit afaed2b

Please sign in to comment.