]> rtime.felk.cvut.cz Git - linux-imx.git/commit
gianfar: convert u64 status counters to atomic64_t
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Tue, 12 Feb 2013 20:38:19 +0000 (15:38 -0500)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Wed, 13 Feb 2013 00:08:27 +0000 (19:08 -0500)
commit212079df6d77c0daada96b1d906f4b7749871411
tree2c4f2b31b6bdc2a6ea1a22617fd840c19ff90882
parent68719786cba169f93b6cb5a53f5dd6ea1bdbb9f3
gianfar: convert u64 status counters to atomic64_t

While looking at some asm dump for an unrelated change, Eric
noticed in the following stats count increment code:

    50b8:       81 3c 01 f8     lwz     r9,504(r28)
    50bc:       81 5c 01 fc     lwz     r10,508(r28)
    50c0:       31 4a 00 01     addic   r10,r10,1
    50c4:       7d 29 01 94     addze   r9,r9
    50c8:       91 3c 01 f8     stw     r9,504(r28)
    50cc:       91 5c 01 fc     stw     r10,508(r28)

that a 64 bit counter was used on ppc-32 without sync
and hence the "ethtool -S" output was racy.

Here we convert all the values to use atomic64_t so that
the output will always be consistent.

Reported-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
drivers/net/ethernet/freescale/gianfar.c
drivers/net/ethernet/freescale/gianfar.h
drivers/net/ethernet/freescale/gianfar_ethtool.c