aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/realtek
diff options
context:
space:
mode:
authorChun-Hao Lin <hau@realtek.com>2016-08-01 13:45:30 +0800
committerDavid S. Miller <davem@davemloft.net>2016-08-01 21:38:53 -0700
commit0a2f0d2de4ed9bd73e2c8d604863399ed6a20527 (patch)
treeddc0952a58ad899a6ce88cb5a1daed5f404b3d22 /drivers/net/ethernet/realtek
parentqed: Fix error return code in qed_resc_alloc() (diff)
downloadlinux-dev-0a2f0d2de4ed9bd73e2c8d604863399ed6a20527.tar.xz
linux-dev-0a2f0d2de4ed9bd73e2c8d604863399ed6a20527.zip
8139too: fix system hang when there is a tx timeout event.
If tx timeout event occur, kernel will call rtl8139_tx_timeout_task() to reset hardware. But in this function, driver does not stop tx and rx function before reset hardware, that will cause system hang. In this patch, add stop tx and rx function before reset hardware. Signed-off-by: Chunhao Lin <hau@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/realtek')
-rw-r--r--drivers/net/ethernet/realtek/8139too.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/ethernet/realtek/8139too.c b/drivers/net/ethernet/realtek/8139too.c
index ef668d300800..da4c2d8a4173 100644
--- a/drivers/net/ethernet/realtek/8139too.c
+++ b/drivers/net/ethernet/realtek/8139too.c
@@ -1667,6 +1667,10 @@ static void rtl8139_tx_timeout_task (struct work_struct *work)
int i;
u8 tmp8;
+ napi_disable(&tp->napi);
+ netif_stop_queue(dev);
+ synchronize_sched();
+
netdev_dbg(dev, "Transmit timeout, status %02x %04x %04x media %02x\n",
RTL_R8(ChipCmd), RTL_R16(IntrStatus),
RTL_R16(IntrMask), RTL_R8(MediaStatus));
@@ -1696,10 +1700,10 @@ static void rtl8139_tx_timeout_task (struct work_struct *work)
spin_unlock_irq(&tp->lock);
/* ...and finally, reset everything */
- if (netif_running(dev)) {
- rtl8139_hw_start (dev);
- netif_wake_queue (dev);
- }
+ napi_enable(&tp->napi);
+ rtl8139_hw_start(dev);
+ netif_wake_queue(dev);
+
spin_unlock_bh(&tp->rx_lock);
}