• Matt Carlson's avatar
    tg3: Fix tg3_get_stats64 for 5700 / 5701 devs · 65ec698d
    Matt Carlson authored
    tg3_get_stats64() takes tp->lock when dealing with non-serdes bcm5700
    and bcm5701 devices.  However, functions that call tg3_halt() have
    already acquired tp->lock.  When tg3_get_stats64() is called in
    tg3_halt(), deadlock will occur.
    
    This patch fixes the problem by separating the stat gathering code into
    a new tg3_get_nstats() function.  tg3_get_stats64() is recoded to call
    this function and take tp->lock.  The code that takes tp->lock in
    tg3_calc_crc_errors() has been removed.  Function signatures have been
    cleaned up too.
    Signed-off-by: default avatarMatt Carlson <mcarlson@broadcom.com>
    Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    65ec698d
tg3.c 419 KB