diff options
Diffstat (limited to 'drivers/net/e1000e/netdev.c')
-rw-r--r-- | drivers/net/e1000e/netdev.c | 52 |
1 files changed, 42 insertions, 10 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 7cedfeb505b2..ec0b803c501e 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -935,6 +935,9 @@ static void e1000_print_hw_hang(struct work_struct *work) | |||
935 | u16 phy_status, phy_1000t_status, phy_ext_status; | 935 | u16 phy_status, phy_1000t_status, phy_ext_status; |
936 | u16 pci_status; | 936 | u16 pci_status; |
937 | 937 | ||
938 | if (test_bit(__E1000_DOWN, &adapter->state)) | ||
939 | return; | ||
940 | |||
938 | e1e_rphy(hw, PHY_STATUS, &phy_status); | 941 | e1e_rphy(hw, PHY_STATUS, &phy_status); |
939 | e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status); | 942 | e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status); |
940 | e1e_rphy(hw, PHY_EXT_STATUS, &phy_ext_status); | 943 | e1e_rphy(hw, PHY_EXT_STATUS, &phy_ext_status); |
@@ -1498,6 +1501,9 @@ static void e1000e_downshift_workaround(struct work_struct *work) | |||
1498 | struct e1000_adapter *adapter = container_of(work, | 1501 | struct e1000_adapter *adapter = container_of(work, |
1499 | struct e1000_adapter, downshift_task); | 1502 | struct e1000_adapter, downshift_task); |
1500 | 1503 | ||
1504 | if (test_bit(__E1000_DOWN, &adapter->state)) | ||
1505 | return; | ||
1506 | |||
1501 | e1000e_gig_downshift_workaround_ich8lan(&adapter->hw); | 1507 | e1000e_gig_downshift_workaround_ich8lan(&adapter->hw); |
1502 | } | 1508 | } |
1503 | 1509 | ||
@@ -3335,6 +3341,21 @@ int e1000e_up(struct e1000_adapter *adapter) | |||
3335 | return 0; | 3341 | return 0; |
3336 | } | 3342 | } |
3337 | 3343 | ||
3344 | static void e1000e_flush_descriptors(struct e1000_adapter *adapter) | ||
3345 | { | ||
3346 | struct e1000_hw *hw = &adapter->hw; | ||
3347 | |||
3348 | if (!(adapter->flags2 & FLAG2_DMA_BURST)) | ||
3349 | return; | ||
3350 | |||
3351 | /* flush pending descriptor writebacks to memory */ | ||
3352 | ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD); | ||
3353 | ew32(RDTR, adapter->rx_int_delay | E1000_RDTR_FPD); | ||
3354 | |||
3355 | /* execute the writes immediately */ | ||
3356 | e1e_flush(); | ||
3357 | } | ||
3358 | |||
3338 | static void e1000e_update_stats(struct e1000_adapter *adapter); | 3359 | static void e1000e_update_stats(struct e1000_adapter *adapter); |
3339 | 3360 | ||
3340 | void e1000e_down(struct e1000_adapter *adapter) | 3361 | void e1000e_down(struct e1000_adapter *adapter) |
@@ -3381,6 +3402,9 @@ void e1000e_down(struct e1000_adapter *adapter) | |||
3381 | 3402 | ||
3382 | if (!pci_channel_offline(adapter->pdev)) | 3403 | if (!pci_channel_offline(adapter->pdev)) |
3383 | e1000e_reset(adapter); | 3404 | e1000e_reset(adapter); |
3405 | |||
3406 | e1000e_flush_descriptors(adapter); | ||
3407 | |||
3384 | e1000_clean_tx_ring(adapter); | 3408 | e1000_clean_tx_ring(adapter); |
3385 | e1000_clean_rx_ring(adapter); | 3409 | e1000_clean_rx_ring(adapter); |
3386 | 3410 | ||
@@ -3771,6 +3795,10 @@ static void e1000e_update_phy_task(struct work_struct *work) | |||
3771 | { | 3795 | { |
3772 | struct e1000_adapter *adapter = container_of(work, | 3796 | struct e1000_adapter *adapter = container_of(work, |
3773 | struct e1000_adapter, update_phy_task); | 3797 | struct e1000_adapter, update_phy_task); |
3798 | |||
3799 | if (test_bit(__E1000_DOWN, &adapter->state)) | ||
3800 | return; | ||
3801 | |||
3774 | e1000_get_phy_info(&adapter->hw); | 3802 | e1000_get_phy_info(&adapter->hw); |
3775 | } | 3803 | } |
3776 | 3804 | ||
@@ -3781,6 +3809,10 @@ static void e1000e_update_phy_task(struct work_struct *work) | |||
3781 | static void e1000_update_phy_info(unsigned long data) | 3809 | static void e1000_update_phy_info(unsigned long data) |
3782 | { | 3810 | { |
3783 | struct e1000_adapter *adapter = (struct e1000_adapter *) data; | 3811 | struct e1000_adapter *adapter = (struct e1000_adapter *) data; |
3812 | |||
3813 | if (test_bit(__E1000_DOWN, &adapter->state)) | ||
3814 | return; | ||
3815 | |||
3784 | schedule_work(&adapter->update_phy_task); | 3816 | schedule_work(&adapter->update_phy_task); |
3785 | } | 3817 | } |
3786 | 3818 | ||
@@ -4155,6 +4187,9 @@ static void e1000_watchdog_task(struct work_struct *work) | |||
4155 | struct e1000_hw *hw = &adapter->hw; | 4187 | struct e1000_hw *hw = &adapter->hw; |
4156 | u32 link, tctl; | 4188 | u32 link, tctl; |
4157 | 4189 | ||
4190 | if (test_bit(__E1000_DOWN, &adapter->state)) | ||
4191 | return; | ||
4192 | |||
4158 | link = e1000e_has_link(adapter); | 4193 | link = e1000e_has_link(adapter); |
4159 | if ((netif_carrier_ok(netdev)) && link) { | 4194 | if ((netif_carrier_ok(netdev)) && link) { |
4160 | /* Cancel scheduled suspend requests. */ | 4195 | /* Cancel scheduled suspend requests. */ |
@@ -4342,19 +4377,12 @@ link_up: | |||
4342 | else | 4377 | else |
4343 | ew32(ICS, E1000_ICS_RXDMT0); | 4378 | ew32(ICS, E1000_ICS_RXDMT0); |
4344 | 4379 | ||
4380 | /* flush pending descriptors to memory before detecting Tx hang */ | ||
4381 | e1000e_flush_descriptors(adapter); | ||
4382 | |||
4345 | /* Force detection of hung controller every watchdog period */ | 4383 | /* Force detection of hung controller every watchdog period */ |
4346 | adapter->detect_tx_hung = 1; | 4384 | adapter->detect_tx_hung = 1; |
4347 | 4385 | ||
4348 | /* flush partial descriptors to memory before detecting Tx hang */ | ||
4349 | if (adapter->flags2 & FLAG2_DMA_BURST) { | ||
4350 | ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD); | ||
4351 | ew32(RDTR, adapter->rx_int_delay | E1000_RDTR_FPD); | ||
4352 | /* | ||
4353 | * no need to flush the writes because the timeout code does | ||
4354 | * an er32 first thing | ||
4355 | */ | ||
4356 | } | ||
4357 | |||
4358 | /* | 4386 | /* |
4359 | * With 82571 controllers, LAA may be overwritten due to controller | 4387 | * With 82571 controllers, LAA may be overwritten due to controller |
4360 | * reset from the other port. Set the appropriate LAA in RAR[0] | 4388 | * reset from the other port. Set the appropriate LAA in RAR[0] |
@@ -4892,6 +4920,10 @@ static void e1000_reset_task(struct work_struct *work) | |||
4892 | struct e1000_adapter *adapter; | 4920 | struct e1000_adapter *adapter; |
4893 | adapter = container_of(work, struct e1000_adapter, reset_task); | 4921 | adapter = container_of(work, struct e1000_adapter, reset_task); |
4894 | 4922 | ||
4923 | /* don't run the task if already down */ | ||
4924 | if (test_bit(__E1000_DOWN, &adapter->state)) | ||
4925 | return; | ||
4926 | |||
4895 | if (!((adapter->flags & FLAG_RX_NEEDS_RESTART) && | 4927 | if (!((adapter->flags & FLAG_RX_NEEDS_RESTART) && |
4896 | (adapter->flags & FLAG_RX_RESTART_NOW))) { | 4928 | (adapter->flags & FLAG_RX_RESTART_NOW))) { |
4897 | e1000e_dump(adapter); | 4929 | e1000e_dump(adapter); |