Skip to content

Commit 4fd190a

Browse files
Prashant Sreedharandavem330
authored andcommitted
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 <[email protected]> Tested-by: Peter Hurley <[email protected]> Signed-off-by: Prashant Sreedharan <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b0d11b4 commit 4fd190a

File tree

1 file changed

+5
-3
lines changed
  • drivers/net/ethernet/broadcom

1 file changed

+5
-3
lines changed

drivers/net/ethernet/broadcom/tg3.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10903,11 +10903,13 @@ static void tg3_timer(unsigned long __opaque)
1090310903
{
1090410904
struct tg3 *tp = (struct tg3 *) __opaque;
1090510905

10906-
if (tp->irq_sync || tg3_flag(tp, RESET_TASK_PENDING))
10907-
goto restart_timer;
10908-
1090910906
spin_lock(&tp->lock);
1091010907

10908+
if (tp->irq_sync || tg3_flag(tp, RESET_TASK_PENDING)) {
10909+
spin_unlock(&tp->lock);
10910+
goto restart_timer;
10911+
}
10912+
1091110913
if (tg3_asic_rev(tp) == ASIC_REV_5717 ||
1091210914
tg3_flag(tp, 57765_CLASS))
1091310915
tg3_chk_missed_msi(tp);

0 commit comments

Comments
 (0)