diff options
author | Prashant Sreedharan <prashant@broadcom.com> | 2015-01-14 14:33:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-14 17:05:50 -0500 |
commit | 4fd190a938cbb28ac9d42c5c86f5c829cc014537 (patch) | |
tree | 7c6055ad7d3f9ed4e77b32bc28a81e8253e56ca2 /drivers/net/ethernet/broadcom/tg3.c | |
parent | b0d11b42785b70e19bc6a3122eead3f7969a7589 (diff) |
tg3: tg3_timer() should grab tp->lock before checking for tp->irq_sync
This is to avoid the race between tg3_timer() and the execution paths
which does not invoke tg3_timer_stop() and releases tp->lock before
calling synchronize_irq()
Reported-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/tg3.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 553dcd8a9df2..2dbd4aea01f3 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -10903,11 +10903,13 @@ static void tg3_timer(unsigned long __opaque) | |||
10903 | { | 10903 | { |
10904 | struct tg3 *tp = (struct tg3 *) __opaque; | 10904 | struct tg3 *tp = (struct tg3 *) __opaque; |
10905 | 10905 | ||
10906 | if (tp->irq_sync || tg3_flag(tp, RESET_TASK_PENDING)) | ||
10907 | goto restart_timer; | ||
10908 | |||
10909 | spin_lock(&tp->lock); | 10906 | spin_lock(&tp->lock); |
10910 | 10907 | ||
10908 | if (tp->irq_sync || tg3_flag(tp, RESET_TASK_PENDING)) { | ||
10909 | spin_unlock(&tp->lock); | ||
10910 | goto restart_timer; | ||
10911 | } | ||
10912 | |||
10911 | if (tg3_asic_rev(tp) == ASIC_REV_5717 || | 10913 | if (tg3_asic_rev(tp) == ASIC_REV_5717 || |
10912 | tg3_flag(tp, 57765_CLASS)) | 10914 | tg3_flag(tp, 57765_CLASS)) |
10913 | tg3_chk_missed_msi(tp); | 10915 | tg3_chk_missed_msi(tp); |