Skip to contentSkip to conversation

Davinci: Do not reset EMAC TX overruns counter on read

PATCH New Thomas Lange 1 participant 1 message Mar 9, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Davinci: Do not reset EMAC TX overruns counter on read

Don't reset tx_fifo_errors when reading out current EMAC stats.
(tx_fifo_errors shows up as TX overruns in netdev stats.)

Without this correction, the old counter value is lost every time stats are read out.

---
 drivers/net/davinci_emac.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/davinci_emac.c +1 -1
index 2a628d1..922c8c5 100644
@@ -1730,7 +1730,7 @@ static struct net_device_stats *emac_dev_getnetstats(struct net_device *ndev)
 		emac_read(EMAC_TXCARRIERSENSE);
 	emac_write(EMAC_TXCARRIERSENSE, stats_clear_mask);
 
-	ndev->stats.tx_fifo_errors = emac_read(EMAC_TXUNDERRUN);
+	ndev->stats.tx_fifo_errors += emac_read(EMAC_TXUNDERRUN);
 	emac_write(EMAC_TXUNDERRUN, stats_clear_mask);
 
 	return &ndev->stats;
Signature · 1 line
1.7.2.5