diff options
author | Andrew Morton <akpm@osdl.org> | 2007-05-09 05:33:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-09 15:30:51 -0400 |
commit | 2b3cb2e778811a1df99e37fd7c359837501ab103 (patch) | |
tree | 736b6e149fababf75b1bd0d94a316b790e7f59ae /drivers/net/tg3.c | |
parent | 19a75d83ffeab004cfcfac64024ad3997bac7220 (diff) |
tg3: use flush_work_keventd()
Convert tg3 over to flush_work_keventd(). Remove nasty now-unneeded deadlock
avoidance logic.
(akpm: bypassed maintainers, sorry. There are other patches which depend on
this)
Cc: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: David Howells <dhowells@redhat.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Michael Chan <mchan@broadcom.com>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r-- | drivers/net/tg3.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index e5e901ecd808..0c0f9c817321 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -3716,10 +3716,8 @@ static void tg3_reset_task(struct work_struct *work) | |||
3716 | unsigned int restart_timer; | 3716 | unsigned int restart_timer; |
3717 | 3717 | ||
3718 | tg3_full_lock(tp, 0); | 3718 | tg3_full_lock(tp, 0); |
3719 | tp->tg3_flags |= TG3_FLAG_IN_RESET_TASK; | ||
3720 | 3719 | ||
3721 | if (!netif_running(tp->dev)) { | 3720 | if (!netif_running(tp->dev)) { |
3722 | tp->tg3_flags &= ~TG3_FLAG_IN_RESET_TASK; | ||
3723 | tg3_full_unlock(tp); | 3721 | tg3_full_unlock(tp); |
3724 | return; | 3722 | return; |
3725 | } | 3723 | } |
@@ -3750,8 +3748,6 @@ static void tg3_reset_task(struct work_struct *work) | |||
3750 | mod_timer(&tp->timer, jiffies + 1); | 3748 | mod_timer(&tp->timer, jiffies + 1); |
3751 | 3749 | ||
3752 | out: | 3750 | out: |
3753 | tp->tg3_flags &= ~TG3_FLAG_IN_RESET_TASK; | ||
3754 | |||
3755 | tg3_full_unlock(tp); | 3751 | tg3_full_unlock(tp); |
3756 | } | 3752 | } |
3757 | 3753 | ||
@@ -7390,12 +7386,7 @@ static int tg3_close(struct net_device *dev) | |||
7390 | { | 7386 | { |
7391 | struct tg3 *tp = netdev_priv(dev); | 7387 | struct tg3 *tp = netdev_priv(dev); |
7392 | 7388 | ||
7393 | /* Calling flush_scheduled_work() may deadlock because | 7389 | flush_work_keventd(&tp->reset_task); |
7394 | * linkwatch_event() may be on the workqueue and it will try to get | ||
7395 | * the rtnl_lock which we are holding. | ||
7396 | */ | ||
7397 | while (tp->tg3_flags & TG3_FLAG_IN_RESET_TASK) | ||
7398 | msleep(1); | ||
7399 | 7390 | ||
7400 | netif_stop_queue(dev); | 7391 | netif_stop_queue(dev); |
7401 | 7392 | ||