From: Andrew Lunn <andrew@lunn.ch>
To: David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
Guenter Roeck <linux@roeck-us.net>,
Vivien Didelot <vivien.didelot@savoirfairelinux.com>,
Cory Tusar <cory.tusar@pid1solutions.com>,
Andrew Lunn <andrew@lunn.ch>
Subject: [PATCH] dsa: mv88x6xxx: Zero statistics counters
Date: Sat, 20 Jun 2015 21:31:29 +0200 [thread overview]
Message-ID: <1434828689-11804-1-git-send-email-andrew@lunn.ch> (raw)
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
next reply other threads:[~2015-06-20 19:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-20 19:31 Andrew Lunn [this message]
2015-06-23 13:37 ` [PATCH] dsa: mv88x6xxx: Zero statistics counters David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1434828689-11804-1-git-send-email-andrew@lunn.ch \
--to=andrew@lunn.ch \
--cc=cory.tusar@pid1solutions.com \
--cc=davem@davemloft.net \
--cc=linux@roeck-us.net \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@savoirfairelinux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).