net: ethernet: mtk_eth_soc: skip first IRQ if not used

On SoCs with dedicated RX and TX interrupts (all except MT7621 and
MT7628) platform_get_irq() is called for the first IRQ (eth->irq[0])
but it is never used.
Skip the first IRQ and reduce the IRQ-count to 2.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250619132125.78368-4-linux@fw-web.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Frank Wunderlich 2025-06-19 15:21:23 +02:00 committed by Jakub Kicinski
parent 4981901009
commit 9c0feca0a6
2 changed files with 10 additions and 6 deletions

View File

@ -3353,10 +3353,14 @@ static int mtk_get_irqs(struct platform_device *pdev, struct mtk_eth *eth)
* the second is for TX, and the third is for RX.
*/
for (i = 0; i < MTK_FE_IRQ_NUM; i++) {
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SHARED_INT) && i > 0)
eth->irq[i] = eth->irq[MTK_FE_IRQ_SHARED];
else
eth->irq[i] = platform_get_irq(pdev, i);
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SHARED_INT)) {
if (i == MTK_FE_IRQ_SHARED)
eth->irq[MTK_FE_IRQ_SHARED] = platform_get_irq(pdev, i);
else
eth->irq[i] = eth->irq[MTK_FE_IRQ_SHARED];
} else {
eth->irq[i] = platform_get_irq(pdev, i + 1);
}
if (eth->irq[i] < 0) {
dev_err(&pdev->dev, "no IRQ%d resource found\n", i);

View File

@ -643,8 +643,8 @@
#define MTK_MAC_FSM(x) (0x1010C + ((x) * 0x100))
#define MTK_FE_IRQ_SHARED 0
#define MTK_FE_IRQ_TX 1
#define MTK_FE_IRQ_RX 2
#define MTK_FE_IRQ_TX 0
#define MTK_FE_IRQ_RX 1
#define MTK_FE_IRQ_NUM (MTK_FE_IRQ_RX + 1)
struct mtk_rx_dma {