Skip to content

Commit db84bf4

Browse files
Prashant Sreedharandavem330
Prashant Sreedharan
authored andcommitted
tg3: tg3_reset_task() needs to use rtnl_lock to synchronize
Currently tg3_reset_task() uses only tp->lock for synchronizing with code paths like tg3_open() etc. But since tp->lock is released before doing synchronize_irq(), rtnl_lock should be taken in tg3_reset_task() to synchronize it with other code paths. 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 4fd190a commit db84bf4

File tree

1 file changed

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

1 file changed

+3
-0
lines changed

drivers/net/ethernet/broadcom/tg3.c

+3
Original file line numberDiff line numberDiff line change
@@ -11103,11 +11103,13 @@ static void tg3_reset_task(struct work_struct *work)
1110311103
struct tg3 *tp = container_of(work, struct tg3, reset_task);
1110411104
int err;
1110511105

11106+
rtnl_lock();
1110611107
tg3_full_lock(tp, 0);
1110711108

1110811109
if (!netif_running(tp->dev)) {
1110911110
tg3_flag_clear(tp, RESET_TASK_PENDING);
1111011111
tg3_full_unlock(tp);
11112+
rtnl_unlock();
1111111113
return;
1111211114
}
1111311115

@@ -11140,6 +11142,7 @@ static void tg3_reset_task(struct work_struct *work)
1114011142
tg3_phy_start(tp);
1114111143

1114211144
tg3_flag_clear(tp, RESET_TASK_PENDING);
11145+
rtnl_unlock();
1114311146
}
1114411147

1114511148
static int tg3_request_irq(struct tg3 *tp, int irq_num)

0 commit comments

Comments
 (0)