Skip to content

Commit

Permalink
tg3: tg3_reset_task() needs to use rtnl_lock to synchronize
Browse files Browse the repository at this point in the history
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 <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>
  • Loading branch information
Prashant Sreedharan authored and davem330 committed Jan 14, 2015
1 parent 4fd190a commit db84bf4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/ethernet/broadcom/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -11103,11 +11103,13 @@ static void tg3_reset_task(struct work_struct *work)
struct tg3 *tp = container_of(work, struct tg3, reset_task);
int err;

rtnl_lock();
tg3_full_lock(tp, 0);

if (!netif_running(tp->dev)) {
tg3_flag_clear(tp, RESET_TASK_PENDING);
tg3_full_unlock(tp);
rtnl_unlock();
return;
}

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

tg3_flag_clear(tp, RESET_TASK_PENDING);
rtnl_unlock();
}

static int tg3_request_irq(struct tg3 *tp, int irq_num)
Expand Down

0 comments on commit db84bf4

Please sign in to comment.