ramips: fix the number of uarts for MT7688
[openwrt/staging/yousong.git] / target / linux / mediatek / patches-4.4 / 0092-net-next-mediatek-remove-superfluous-queue-wake-up-c.patch
1 From 538020913db04d199ce4d7e845444880e8200b5f Mon Sep 17 00:00:00 2001
2 From: John Crispin <john@phrozen.org>
3 Date: Tue, 3 May 2016 05:40:38 +0200
4 Subject: [PATCH 092/102] net-next: mediatek: remove superfluous queue wake up
5 call
6
7 The code checks if the queue should be stopped because we are below the
8 threshold of free descriptors only to check if it should be started again.
9 If we do end up in a state where we are at the threshold limit, it makes
10 more sense to just stop the queue and wait for the next IRQ to trigger the
11 TX housekeeping again. There is no rush in enqueuing the next packet, it
12 needs to wait for all the others in the queue to be dispatched first
13 anyway.
14
15 Signed-off-by: John Crispin <john@phrozen.org>
16 ---
17 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 7 ++-----
18 1 file changed, 2 insertions(+), 5 deletions(-)
19
20 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
21 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
22 @@ -795,12 +795,9 @@ static int mtk_start_xmit(struct sk_buff
23 if (mtk_tx_map(skb, dev, tx_num, ring, gso) < 0)
24 goto drop;
25
26 - if (unlikely(atomic_read(&ring->free_count) <= ring->thresh)) {
27 + if (unlikely(atomic_read(&ring->free_count) <= ring->thresh))
28 mtk_stop_queue(eth);
29 - if (unlikely(atomic_read(&ring->free_count) >
30 - ring->thresh))
31 - mtk_wake_queue(eth);
32 - }
33 +
34 spin_unlock_irqrestore(&eth->page_lock, flags);
35
36 return NETDEV_TX_OK;