From: Thomas Lange Date: Wed, 9 Mar 2011 04:41:16 +0000 (+0000) Subject: Davinci: Do not reset EMAC TX overruns counter on read X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=60aeba23101f34a690a0b0a048ffde3d023d4f3b;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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. Signed-off-by: Thomas Lange Signed-off-by: David S. Miller --- diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index 7018bfe408a4..082d6ea69920 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c @@ -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;