diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2011-02-02 05:19:45 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2011-02-17 03:45:06 -0500 |
commit | 615b32af9730def64330e4c0c95c973e90bd9c6d (patch) | |
tree | 8d439d0a42c6f7cb02e2737faf04bbd7443c81e4 /drivers/net/e1000e/netdev.c | |
parent | 6d90e8f45697c633f522269368297d7416fd8783 (diff) |
e1000e: check down flag in tasks
This change is part of a fix to avoid any tasks running while the driver is
exiting and deinitializing resources.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/e1000e/netdev.c')
-rw-r--r-- | drivers/net/e1000e/netdev.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 3065870cf2a7..174633c93325 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -937,6 +937,9 @@ static void e1000_print_hw_hang(struct work_struct *work) | |||
937 | u16 phy_status, phy_1000t_status, phy_ext_status; | 937 | u16 phy_status, phy_1000t_status, phy_ext_status; |
938 | u16 pci_status; | 938 | u16 pci_status; |
939 | 939 | ||
940 | if (test_bit(__E1000_DOWN, &adapter->state)) | ||
941 | return; | ||
942 | |||
940 | e1e_rphy(hw, PHY_STATUS, &phy_status); | 943 | e1e_rphy(hw, PHY_STATUS, &phy_status); |
941 | e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status); | 944 | e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status); |
942 | e1e_rphy(hw, PHY_EXT_STATUS, &phy_ext_status); | 945 | e1e_rphy(hw, PHY_EXT_STATUS, &phy_ext_status); |
@@ -1506,6 +1509,9 @@ static void e1000e_downshift_workaround(struct work_struct *work) | |||
1506 | struct e1000_adapter *adapter = container_of(work, | 1509 | struct e1000_adapter *adapter = container_of(work, |
1507 | struct e1000_adapter, downshift_task); | 1510 | struct e1000_adapter, downshift_task); |
1508 | 1511 | ||
1512 | if (test_bit(__E1000_DOWN, &adapter->state)) | ||
1513 | return; | ||
1514 | |||
1509 | e1000e_gig_downshift_workaround_ich8lan(&adapter->hw); | 1515 | e1000e_gig_downshift_workaround_ich8lan(&adapter->hw); |
1510 | } | 1516 | } |
1511 | 1517 | ||
@@ -3765,6 +3771,10 @@ static void e1000e_update_phy_task(struct work_struct *work) | |||
3765 | { | 3771 | { |
3766 | struct e1000_adapter *adapter = container_of(work, | 3772 | struct e1000_adapter *adapter = container_of(work, |
3767 | struct e1000_adapter, update_phy_task); | 3773 | struct e1000_adapter, update_phy_task); |
3774 | |||
3775 | if (test_bit(__E1000_DOWN, &adapter->state)) | ||
3776 | return; | ||
3777 | |||
3768 | e1000_get_phy_info(&adapter->hw); | 3778 | e1000_get_phy_info(&adapter->hw); |
3769 | } | 3779 | } |
3770 | 3780 | ||
@@ -3775,6 +3785,10 @@ static void e1000e_update_phy_task(struct work_struct *work) | |||
3775 | static void e1000_update_phy_info(unsigned long data) | 3785 | static void e1000_update_phy_info(unsigned long data) |
3776 | { | 3786 | { |
3777 | struct e1000_adapter *adapter = (struct e1000_adapter *) data; | 3787 | struct e1000_adapter *adapter = (struct e1000_adapter *) data; |
3788 | |||
3789 | if (test_bit(__E1000_DOWN, &adapter->state)) | ||
3790 | return; | ||
3791 | |||
3778 | schedule_work(&adapter->update_phy_task); | 3792 | schedule_work(&adapter->update_phy_task); |
3779 | } | 3793 | } |
3780 | 3794 | ||
@@ -4149,6 +4163,9 @@ static void e1000_watchdog_task(struct work_struct *work) | |||
4149 | u32 link, tctl; | 4163 | u32 link, tctl; |
4150 | int tx_pending = 0; | 4164 | int tx_pending = 0; |
4151 | 4165 | ||
4166 | if (test_bit(__E1000_DOWN, &adapter->state)) | ||
4167 | return; | ||
4168 | |||
4152 | link = e1000e_has_link(adapter); | 4169 | link = e1000e_has_link(adapter); |
4153 | if ((netif_carrier_ok(netdev)) && link) { | 4170 | if ((netif_carrier_ok(netdev)) && link) { |
4154 | /* Cancel scheduled suspend requests. */ | 4171 | /* Cancel scheduled suspend requests. */ |
@@ -4887,6 +4904,10 @@ static void e1000_reset_task(struct work_struct *work) | |||
4887 | struct e1000_adapter *adapter; | 4904 | struct e1000_adapter *adapter; |
4888 | adapter = container_of(work, struct e1000_adapter, reset_task); | 4905 | adapter = container_of(work, struct e1000_adapter, reset_task); |
4889 | 4906 | ||
4907 | /* don't run the task if already down */ | ||
4908 | if (test_bit(__E1000_DOWN, &adapter->state)) | ||
4909 | return; | ||
4910 | |||
4890 | if (!((adapter->flags & FLAG_RX_NEEDS_RESTART) && | 4911 | if (!((adapter->flags & FLAG_RX_NEEDS_RESTART) && |
4891 | (adapter->flags & FLAG_RX_RESTART_NOW))) { | 4912 | (adapter->flags & FLAG_RX_RESTART_NOW))) { |
4892 | e1000e_dump(adapter); | 4913 | e1000e_dump(adapter); |