• Sriram's avatar
    TI DaVinci EMAC: Clear statistics register properly. · 0fe7463a
    Sriram authored
    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>
    0fe7463a
davinci_emac.c 83.5 KB