All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dsa: mv88x6xxx: Zero statistics counters
@ 2015-06-20 19:31 Andrew Lunn
  2015-06-23 13:37 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Lunn @ 2015-06-20 19:31 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, Guenter Roeck, Vivien Didelot, Cory Tusar, Andrew Lunn

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>
---

This patch will only cleanly apply after the debug series.  There is
no actual dependency, so applying the patch with some fuzz will allow
it to be applied without the debug series.

 drivers/net/dsa/mv88e6xxx.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index cb6c2711d6ea..fc73d809c292 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -2061,6 +2061,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;
 }
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dsa: mv88x6xxx: Zero statistics counters
  2015-06-20 19:31 [PATCH] dsa: mv88x6xxx: Zero statistics counters Andrew Lunn
@ 2015-06-23 13:37 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-06-23 13:37 UTC (permalink / raw)
  To: andrew; +Cc: netdev, linux, vivien.didelot, cory.tusar

From: Andrew Lunn <andrew@lunn.ch>
Date: Sat, 20 Jun 2015 21:31:29 +0200

> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-23 13:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-20 19:31 [PATCH] dsa: mv88x6xxx: Zero statistics counters Andrew Lunn
2015-06-23 13:37 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.