Aw: Re: [net-next v5 3/3] net: ethernet: mtk_eth_soc: skip first IRQ if not used

From: Frank Wunderlich
Date: Thu Jun 19 2025 - 06:33:09 EST


Hi Simon

> Gesendet: Donnerstag, 19. Juni 2025 um 12:03
> Von: "Simon Horman" <horms@xxxxxxxxxx>
> Betreff: Re: [net-next v5 3/3] net: ethernet: mtk_eth_soc: skip first IRQ if not used
>
> On Wed, Jun 18, 2025 at 03:07:14PM +0200, Frank Wunderlich wrote:
> > From: Frank Wunderlich <frank-w@xxxxxxxxxxxxxxx>
> >
> > On SoCs without MTK_SHARED_INT capability (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@xxxxxxxxxxxxxxx>
> > ---
> > v5:
> > - change commit title and description
> > v4:
> > - drop >2 condition as max is already 2 and drop the else continue
> > - update comment to explain which IRQs are taken in legacy way
>
> Reviewed-by: Simon Horman <horms@xxxxxxxxxx>

thank you very much

i guess RB is still valid with changes requested by Daniel?

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.

code (changed condition "if (i == MTK_FE_IRQ_SHARED)")
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);
+ }

regards Frank