Skip to content

Commit

Permalink
dsa: mv88x6xxx: Zero statistics counters
Browse files Browse the repository at this point in the history
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 <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andrew Lunn authored and David S. Miller committed Jun 23, 2015
1 parent 824831f commit db687a5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/dsa/mv88e6xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit db687a5

Please sign in to comment.