0092-net-next-mediatek-remove-superfluous-queue-wake-up-c.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  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. The code checks if the queue should be stopped because we are below the
  7. threshold of free descriptors only to check if it should be started again.
  8. If we do end up in a state where we are at the threshold limit, it makes
  9. more sense to just stop the queue and wait for the next IRQ to trigger the
  10. TX housekeeping again. There is no rush in enqueuing the next packet, it
  11. needs to wait for all the others in the queue to be dispatched first
  12. anyway.
  13. Signed-off-by: John Crispin <john@phrozen.org>
  14. ---
  15. drivers/net/ethernet/mediatek/mtk_eth_soc.c | 7 ++-----
  16. 1 file changed, 2 insertions(+), 5 deletions(-)
  17. --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  18. +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  19. @@ -795,12 +795,9 @@ static int mtk_start_xmit(struct sk_buff
  20. if (mtk_tx_map(skb, dev, tx_num, ring, gso) < 0)
  21. goto drop;
  22. - if (unlikely(atomic_read(&ring->free_count) <= ring->thresh)) {
  23. + if (unlikely(atomic_read(&ring->free_count) <= ring->thresh))
  24. mtk_stop_queue(eth);
  25. - if (unlikely(atomic_read(&ring->free_count) >
  26. - ring->thresh))
  27. - mtk_wake_queue(eth);
  28. - }
  29. +
  30. spin_unlock_irqrestore(&eth->page_lock, flags);
  31. return NETDEV_TX_OK;