diff options
author | Prashant Sreedharan <prashant@broadcom.com> | 2015-01-14 14:34:17 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-14 17:05:51 -0500 |
commit | db84bf43ef23157cbb40ce8626475187f5ae90c3 (patch) | |
tree | 081715d4e53dbfc7a6d404355a165b6dbcc766b9 /drivers/net/ethernet/broadcom/tg3.c | |
parent | 4fd190a938cbb28ac9d42c5c86f5c829cc014537 (diff) |
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 <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 | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 2dbd4aea01f3..9247ae1412cc 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -11103,11 +11103,13 @@ static void tg3_reset_task(struct work_struct *work) | |||
11103 | struct tg3 *tp = container_of(work, struct tg3, reset_task); | 11103 | struct tg3 *tp = container_of(work, struct tg3, reset_task); |
11104 | int err; | 11104 | int err; |
11105 | 11105 | ||
11106 | rtnl_lock(); | ||
11106 | tg3_full_lock(tp, 0); | 11107 | tg3_full_lock(tp, 0); |
11107 | 11108 | ||
11108 | if (!netif_running(tp->dev)) { | 11109 | if (!netif_running(tp->dev)) { |
11109 | tg3_flag_clear(tp, RESET_TASK_PENDING); | 11110 | tg3_flag_clear(tp, RESET_TASK_PENDING); |
11110 | tg3_full_unlock(tp); | 11111 | tg3_full_unlock(tp); |
11112 | rtnl_unlock(); | ||
11111 | return; | 11113 | return; |
11112 | } | 11114 | } |
11113 | 11115 | ||
@@ -11140,6 +11142,7 @@ out: | |||
11140 | tg3_phy_start(tp); | 11142 | tg3_phy_start(tp); |
11141 | 11143 | ||
11142 | tg3_flag_clear(tp, RESET_TASK_PENDING); | 11144 | tg3_flag_clear(tp, RESET_TASK_PENDING); |
11145 | rtnl_unlock(); | ||
11143 | } | 11146 | } |
11144 | 11147 | ||
11145 | static int tg3_request_irq(struct tg3 *tp, int irq_num) | 11148 | static int tg3_request_irq(struct tg3 *tp, int irq_num) |