openwrt/target/linux/generic/pending-5.4/770-11-net-ethernet-mtk_eth_soc-avoid-rearming-interrupt-if.pa
Felix Fietkau 668c988fc5 mediatek/ramips: remove an ethernet optimization patch that was reported to cause a regression
In some tests, crashes were observed

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-09-09 11:51:47 +02:00

36 lines
905 B
Plaintext

From: Felix Fietkau <nbd@nbd.name>
Date: Fri, 4 Sep 2020 18:14:05 +0200
Subject: [PATCH] net: ethernet: mtk_eth_soc: avoid rearming interrupt if
napi_complete returns false
Reduces unnecessary interrupts
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1515,8 +1515,8 @@ static int mtk_napi_tx(struct napi_struc
if (status & MTK_TX_DONE_INT)
return budget;
- napi_complete(napi);
- mtk_tx_irq_enable(eth, MTK_TX_DONE_INT);
+ if (napi_complete(napi))
+ mtk_tx_irq_enable(eth, MTK_TX_DONE_INT);
return tx_done;
}
@@ -1549,8 +1549,9 @@ poll_again:
remain_budget -= rx_done;
goto poll_again;
}
- napi_complete(napi);
- mtk_rx_irq_enable(eth, MTK_RX_DONE_INT);
+
+ if (napi_complete(napi))
+ mtk_rx_irq_enable(eth, MTK_RX_DONE_INT);
return rx_done + budget - remain_budget;
}