Commit db84bf43 authored by Prashant Sreedharan's avatar Prashant Sreedharan Committed by David S. Miller

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: default avatarPeter Hurley <peter@hurleysoftware.com>
Tested-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarPrashant Sreedharan <prashant@broadcom.com>
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4fd190a9
...@@ -11103,11 +11103,13 @@ static void tg3_reset_task(struct work_struct *work) ...@@ -11103,11 +11103,13 @@ static void tg3_reset_task(struct work_struct *work)
struct tg3 *tp = container_of(work, struct tg3, reset_task); struct tg3 *tp = container_of(work, struct tg3, reset_task);
int err; int err;
rtnl_lock();
tg3_full_lock(tp, 0); tg3_full_lock(tp, 0);
if (!netif_running(tp->dev)) { if (!netif_running(tp->dev)) {
tg3_flag_clear(tp, RESET_TASK_PENDING); tg3_flag_clear(tp, RESET_TASK_PENDING);
tg3_full_unlock(tp); tg3_full_unlock(tp);
rtnl_unlock();
return; return;
} }
...@@ -11140,6 +11142,7 @@ static void tg3_reset_task(struct work_struct *work) ...@@ -11140,6 +11142,7 @@ static void tg3_reset_task(struct work_struct *work)
tg3_phy_start(tp); tg3_phy_start(tp);
tg3_flag_clear(tp, RESET_TASK_PENDING); tg3_flag_clear(tp, RESET_TASK_PENDING);
rtnl_unlock();
} }
static int tg3_request_irq(struct tg3 *tp, int irq_num) static int tg3_request_irq(struct tg3 *tp, int irq_num)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment