Skip to content

Commit

Permalink
Davinci: Do not reset EMAC TX overruns counter on read
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Thomas Lange <thomas@corelatus.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Thomas Lange authored and David S. Miller committed Mar 14, 2011
1 parent 0b32211 commit 60aeba2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/davinci_emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 60aeba2

Please sign in to comment.