]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tg3: Fix tg3_get_stats64 for 5700 / 5701 devs
authorJoe Jin <joe.jin@oracle.com>
Mon, 27 Aug 2012 05:22:21 +0000 (13:22 +0800)
committerJoe Jin <joe.jin@oracle.com>
Tue, 28 Aug 2012 07:23:05 +0000 (15:23 +0800)
commit228bedee50236cee2b1768734602b7ff21099c7e
tree4593991116aa8336a1dc7e4516df025b1c40dbc0
parent0a95bc6125ca9b307976fc86f6ca1d493255e5e9
tg3: Fix tg3_get_stats64 for 5700 / 5701 devs

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.

(cherry picked from commit 65ec698d1368fc64d0b93fb703783d25ec550577)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/tg3.c