diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 2 | ||||
-rw-r--r-- | drivers/net/phy/phy.c | 6 | ||||
-rw-r--r-- | drivers/net/tg3.c | 11 | ||||
-rw-r--r-- | drivers/net/tg3.h | 2 |
4 files changed, 6 insertions, 15 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 3a03a74c0609..637ae8f68791 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -1214,7 +1214,7 @@ e1000_remove(struct pci_dev *pdev) | |||
1214 | int i; | 1214 | int i; |
1215 | #endif | 1215 | #endif |
1216 | 1216 | ||
1217 | flush_scheduled_work(); | 1217 | cancel_work_sync(&adapter->reset_task); |
1218 | 1218 | ||
1219 | e1000_release_manageability(adapter); | 1219 | e1000_release_manageability(adapter); |
1220 | 1220 | ||
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index eed433d6056a..f71dab347667 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -662,10 +662,10 @@ int phy_stop_interrupts(struct phy_device *phydev) | |||
662 | phy_error(phydev); | 662 | phy_error(phydev); |
663 | 663 | ||
664 | /* | 664 | /* |
665 | * Finish any pending work; we might have been scheduled | 665 | * Finish any pending work; we might have been scheduled to be called |
666 | * to be called from keventd ourselves, though. | 666 | * from keventd ourselves, but cancel_work_sync() handles that. |
667 | */ | 667 | */ |
668 | run_scheduled_work(&phydev->phy_queue); | 668 | cancel_work_sync(&phydev->phy_queue); |
669 | 669 | ||
670 | free_irq(phydev->irq, phydev); | 670 | free_irq(phydev->irq, phydev); |
671 | 671 | ||
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index e5e901ecd808..923b9c725cc3 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 | cancel_work_sync(&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 | ||
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index 4d334cf5a243..bd9f4f428e5b 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
@@ -2228,7 +2228,7 @@ struct tg3 { | |||
2228 | #define TG3_FLAG_JUMBO_RING_ENABLE 0x00800000 | 2228 | #define TG3_FLAG_JUMBO_RING_ENABLE 0x00800000 |
2229 | #define TG3_FLAG_10_100_ONLY 0x01000000 | 2229 | #define TG3_FLAG_10_100_ONLY 0x01000000 |
2230 | #define TG3_FLAG_PAUSE_AUTONEG 0x02000000 | 2230 | #define TG3_FLAG_PAUSE_AUTONEG 0x02000000 |
2231 | #define TG3_FLAG_IN_RESET_TASK 0x04000000 | 2231 | |
2232 | #define TG3_FLAG_40BIT_DMA_BUG 0x08000000 | 2232 | #define TG3_FLAG_40BIT_DMA_BUG 0x08000000 |
2233 | #define TG3_FLAG_BROKEN_CHECKSUMS 0x10000000 | 2233 | #define TG3_FLAG_BROKEN_CHECKSUMS 0x10000000 |
2234 | #define TG3_FLAG_SUPPORT_MSI 0x20000000 | 2234 | #define TG3_FLAG_SUPPORT_MSI 0x20000000 |