Skip to content
Commit 0fe7463a authored by Sriram's avatar Sriram Committed by David S. Miller
Browse files

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: default avatarSriramakrishnan <srk@ti.com>
Acked-by: default avatarChaithrika U S <chaithrika@ti.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent daf9df6d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment