|
@@ -1014,6 +1014,7 @@ static void e1000_print_hw_hang(struct work_struct *work)
|
|
struct e1000_adapter *adapter = container_of(work,
|
|
struct e1000_adapter *adapter = container_of(work,
|
|
struct e1000_adapter,
|
|
struct e1000_adapter,
|
|
print_hang_task);
|
|
print_hang_task);
|
|
|
|
+ struct net_device *netdev = adapter->netdev;
|
|
struct e1000_ring *tx_ring = adapter->tx_ring;
|
|
struct e1000_ring *tx_ring = adapter->tx_ring;
|
|
unsigned int i = tx_ring->next_to_clean;
|
|
unsigned int i = tx_ring->next_to_clean;
|
|
unsigned int eop = tx_ring->buffer_info[i].next_to_watch;
|
|
unsigned int eop = tx_ring->buffer_info[i].next_to_watch;
|
|
@@ -1025,6 +1026,21 @@ static void e1000_print_hw_hang(struct work_struct *work)
|
|
if (test_bit(__E1000_DOWN, &adapter->state))
|
|
if (test_bit(__E1000_DOWN, &adapter->state))
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
+ if (!adapter->tx_hang_recheck &&
|
|
|
|
+ (adapter->flags2 & FLAG2_DMA_BURST)) {
|
|
|
|
+ /* May be block on write-back, flush and detect again
|
|
|
|
+ * flush pending descriptor writebacks to memory
|
|
|
|
+ */
|
|
|
|
+ ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
|
|
|
|
+ /* execute the writes immediately */
|
|
|
|
+ e1e_flush();
|
|
|
|
+ adapter->tx_hang_recheck = true;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ /* Real hang detected */
|
|
|
|
+ adapter->tx_hang_recheck = false;
|
|
|
|
+ netif_stop_queue(netdev);
|
|
|
|
+
|
|
e1e_rphy(hw, PHY_STATUS, &phy_status);
|
|
e1e_rphy(hw, PHY_STATUS, &phy_status);
|
|
e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status);
|
|
e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status);
|
|
e1e_rphy(hw, PHY_EXT_STATUS, &phy_ext_status);
|
|
e1e_rphy(hw, PHY_EXT_STATUS, &phy_ext_status);
|
|
@@ -1145,10 +1161,10 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
|
|
if (tx_ring->buffer_info[i].time_stamp &&
|
|
if (tx_ring->buffer_info[i].time_stamp &&
|
|
time_after(jiffies, tx_ring->buffer_info[i].time_stamp
|
|
time_after(jiffies, tx_ring->buffer_info[i].time_stamp
|
|
+ (adapter->tx_timeout_factor * HZ)) &&
|
|
+ (adapter->tx_timeout_factor * HZ)) &&
|
|
- !(er32(STATUS) & E1000_STATUS_TXOFF)) {
|
|
|
|
|
|
+ !(er32(STATUS) & E1000_STATUS_TXOFF))
|
|
schedule_work(&adapter->print_hang_task);
|
|
schedule_work(&adapter->print_hang_task);
|
|
- netif_stop_queue(netdev);
|
|
|
|
- }
|
|
|
|
|
|
+ else
|
|
|
|
+ adapter->tx_hang_recheck = false;
|
|
}
|
|
}
|
|
adapter->total_tx_bytes += total_tx_bytes;
|
|
adapter->total_tx_bytes += total_tx_bytes;
|
|
adapter->total_tx_packets += total_tx_packets;
|
|
adapter->total_tx_packets += total_tx_packets;
|
|
@@ -3838,6 +3854,7 @@ static int e1000_open(struct net_device *netdev)
|
|
|
|
|
|
e1000_irq_enable(adapter);
|
|
e1000_irq_enable(adapter);
|
|
|
|
|
|
|
|
+ adapter->tx_hang_recheck = false;
|
|
netif_start_queue(netdev);
|
|
netif_start_queue(netdev);
|
|
|
|
|
|
adapter->idle_check = true;
|
|
adapter->idle_check = true;
|