]> git.baikalelectronics.ru Git - kernel.git/commit
sh_eth: Mitigate lost statistics updates
authorBen Hutchings <ben.hutchings@codethink.co.uk>
Thu, 26 Feb 2015 20:35:05 +0000 (20:35 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Mar 2015 20:40:54 +0000 (15:40 -0500)
commit7b5c711ff1473d264af50a745df1d2fa893c0359
tree9d96b086dfaacd00f69528cfa57d54acdf01cf2b
parent41bcccfd60cb95c6994c63ea41b88de5fc595a84
sh_eth: Mitigate lost statistics updates

The statistics registers have write-clear behaviour, which means we
will lose any increment between the read and write.  Mitigate this by
only clearing when we read a non-zero value, so we will never falsely
report a total of zero.  This also saves time as we only handle
error statistics here and they won't often be incremented.

Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/renesas/sh_eth.c