aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Lunn <[email protected]>2015-06-20 19:31:29 +0000
committerDavid S. Miller <[email protected]>2015-06-23 13:37:17 +0000
commitdb687a56e4f2796bae77ac3b21b930fabe5159cc (patch)
treef50ee1d9ebbd113ef43b270aa2e3a8b45dcbc119
parentMerge branch 'dsa-mv88e6xxx-debugfs' (diff)
downloadkernel-db687a56e4f2796bae77ac3b21b930fabe5159cc.tar.gz
kernel-db687a56e4f2796bae77ac3b21b930fabe5159cc.zip
dsa: mv88x6xxx: Zero statistics counters
Zero the statistics counters when setting up the global registers. Otherwise the counters will remain from the last boot if the power has not been removed. Signed-off-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
-rw-r--r--drivers/net/dsa/mv88e6xxx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index c938d7ce5215..fd8547c2b79d 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -2005,6 +2005,12 @@ int mv88e6xxx_setup_global(struct dsa_switch *ds)
0x9000 | (i << 8));
}
+ /* Clear the statistics counters for all ports */
+ REG_WRITE(REG_GLOBAL, GLOBAL_STATS_OP, GLOBAL_STATS_OP_FLUSH_ALL);
+
+ /* Wait for the flush to complete. */
+ _mv88e6xxx_stats_wait(ds);
+
return 0;
}