1 Index: linux-4.9.44/drivers/net/ethernet/mediatek/mtk_eth_soc.c
2 ===================================================================
3 --- linux-4.9.44.orig/drivers/net/ethernet/mediatek/mtk_eth_soc.c
4 +++ linux-4.9.44/drivers/net/ethernet/mediatek/mtk_eth_soc.c
5 @@ -851,6 +851,7 @@ static void mtk_stop_queue(struct mtk_et
7 netif_stop_queue(eth->netdev[i]);
9 + mtk_tx_irq_enable(eth, MTK_TX_DONE_INT);
12 static int mtk_start_xmit(struct sk_buff *skb, struct net_device *dev)
13 @@ -1885,6 +1886,19 @@ static int mtk_start_dma(struct mtk_eth
17 +#define NAPI_TIMER_EXPIRE HZ
19 +static void napi_timer_handler(unsigned long priv)
21 + struct mtk_eth *eth = (struct mtk_eth*) priv;
23 + mtk_wake_queue(eth);
24 + mtk_handle_irq_rx(0, eth);
25 + mtk_handle_irq_tx(0, eth);
27 + mod_timer(ð->napi_timer, jiffies + NAPI_TIMER_EXPIRE);
30 static int mtk_open(struct net_device *dev)
32 struct mtk_mac *mac = netdev_priv(dev);
33 @@ -1901,6 +1915,9 @@ static int mtk_open(struct net_device *d
34 napi_enable(ð->rx_napi);
35 mtk_tx_irq_enable(eth, MTK_TX_DONE_INT);
36 mtk_rx_irq_enable(eth, MTK_RX_DONE_INT);
38 + setup_timer(ð->napi_timer, napi_timer_handler, (unsigned long) eth);
39 + mod_timer(ð->napi_timer, jiffies + NAPI_TIMER_EXPIRE);
41 atomic_inc(ð->dma_refcnt);
43 @@ -1945,6 +1962,8 @@ static int mtk_stop(struct net_device *d
44 if (!atomic_dec_and_test(ð->dma_refcnt))
47 + del_timer(ð->napi_timer);
49 mtk_tx_irq_disable(eth, MTK_TX_DONE_INT);
50 mtk_rx_irq_disable(eth, MTK_RX_DONE_INT);
51 napi_disable(ð->tx_napi);
52 @@ -2524,7 +2543,7 @@ static int mtk_add_mac(struct mtk_eth *e
53 mac->hw_stats->reg_offset = id * MTK_STAT_OFFSET;
55 SET_NETDEV_DEV(eth->netdev[id], eth->dev);
56 - eth->netdev[id]->watchdog_timeo = 15 * HZ;
57 + eth->netdev[id]->watchdog_timeo = 30 * HZ;
58 eth->netdev[id]->netdev_ops = &mtk_netdev_ops;
59 eth->netdev[id]->base_addr = (unsigned long)eth->base;
61 Index: linux-4.9.44/drivers/net/ethernet/mediatek/mtk_eth_soc.h
62 ===================================================================
63 --- linux-4.9.44.orig/drivers/net/ethernet/mediatek/mtk_eth_soc.h
64 +++ linux-4.9.44/drivers/net/ethernet/mediatek/mtk_eth_soc.h
65 @@ -601,6 +601,8 @@ struct mtk_eth {
66 struct mii_bus *mii_bus;
67 struct work_struct pending_work;
70 + struct timer_list napi_timer;
73 /* struct mtk_mac - the structure that holds the info about the MACs of the