]> git.baikalelectronics.ru Git - kernel.git/commit
TI DaVinci EMAC: Clear statistics register properly.
authorSriram <srk@ti.com>
Wed, 7 Oct 2009 02:44:30 +0000 (02:44 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Oct 2009 19:02:53 +0000 (12:02 -0700)
commit418588d5dbae5c7eaafc81a4382fcc3e444661d7
treea61b3d59ebc28c3eea7134680e250d2ddd261a40
parent8381509d4b8284c28a49e1f66ba66c9ce8f1c912
TI DaVinci EMAC: Clear statistics register properly.

The mechanism to clear the statistics register is dependent
on the status of GMIIEN bit in MAC control register. If the
GMIIEN bit is set, the stats registers are write to decrement.
If the GMIIEN bit is cleared, the stats registers are plain
read/write registers. The stats register clearing operation
must take into account the current state of GMIIEN as it
can be cleared when the interface is brought down.

With existing implementation logic, querying for interface stats
when the interface is down, can corrupt the statistics counters.
This patch examines the GMIIEN bit status in MAC_CONTROL
register before choosing an appropriate mask for clearing stats
registers.

Signed-off-by: Sriramakrishnan <srk@ti.com>
Acked-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/davinci_emac.c