summaryrefslogtreecommitdiff
path: root/drivers/net/dsa
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2017-03-29 22:38:37 +0300
committerDavid S. Miller <davem@davemloft.net>2017-03-31 01:35:23 +0300
commitbae76dd95b69350f6342d8a4ea1bdeec4c218053 (patch)
tree53df958cc04d623e4677f5611bd855b2e1a943ba /drivers/net/dsa
parente704f0434ea60adedc07c847b46910d4840a7ecf (diff)
downloadlinux-bae76dd95b69350f6342d8a4ea1bdeec4c218053.tar.xz
net: dsa: mv88e6xxx: debug ATU Age Time
The ATU ageing time value programmed in the switch is rounded up to the nearest multiple of its coefficient (variable depending on the model.) Add a debug message to inform the user about the exact programmed value. On 6352, "brctl setageing br0 18" gives "AgeTime set to 0x01 (15000 ms)" while on 6390 we get "AgeTime set to 0x05 (18750 ms)". Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r--drivers/net/dsa/mv88e6xxx/global1_atu.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/global1_atu.c b/drivers/net/dsa/mv88e6xxx/global1_atu.c
index 492e00dea3ce..fa7e7db5171b 100644
--- a/drivers/net/dsa/mv88e6xxx/global1_atu.c
+++ b/drivers/net/dsa/mv88e6xxx/global1_atu.c
@@ -63,7 +63,14 @@ int mv88e6xxx_g1_atu_set_age_time(struct mv88e6xxx_chip *chip,
val &= ~0xff0;
val |= age_time << 4;
- return mv88e6xxx_g1_write(chip, GLOBAL_ATU_CONTROL, val);
+ err = mv88e6xxx_g1_write(chip, GLOBAL_ATU_CONTROL, val);
+ if (err)
+ return err;
+
+ dev_dbg(chip->dev, "AgeTime set to 0x%02x (%d ms)\n", age_time,
+ age_time * coeff);
+
+ return 0;
}
/* Offset 0x0B: ATU Operation Register */