From: phucduc.bui@gmail.com
To: Wei Fang <wei.fang@nxp.com>, Frank Li <frank.li@nxp.com>,
Shenwei Wang <shenwei.wang@nxp.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
davem@davemloft.net, Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Richard Cochran <richardcochran@gmail.com>,
imx@lists.linux.dev, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH net-next v6 2/2] net: fec: Handle optional IRQ lookup errors correctly
Date: Fri, 11 Sep 2026 11:00:21 +0700 [thread overview]
Message-ID: <20260911040021.12289-2-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20260911040021.12289-1-phucduc.bui@gmail.com>
From: bui duc phuc <phucduc.bui@gmail.com>
Handle errors from platform_get_irq_byname_optional() explicitly while
preserving the existing fallback to platform_get_irq() when the named IRQ
is not available.
Propagate errors other than -ENXIO from the optional IRQ lookup instead
of silently falling back to the indexed IRQ lookup.
In particular, silently ignoring -EPROBE_DEFER can cause the driver to
continue probing instead of deferring as required.
Reviewed-by: Wei Fang <wei.fang@nxp.com>
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/net/ethernet/freescale/fec_main.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index c6e29b5c2abb..f7636f23d1eb 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -5397,12 +5397,17 @@ fec_probe(struct platform_device *pdev)
for (i = 0; i < irq_cnt; i++) {
snprintf(irq_name, sizeof(irq_name), "int%d", i);
irq = platform_get_irq_byname_optional(pdev, irq_name);
- if (irq < 0)
- irq = platform_get_irq(pdev, i);
- if (irq < 0) {
+ if (irq < 0 && irq != -ENXIO) {
ret = irq;
goto failed_irq;
}
+ if (irq == -ENXIO) {
+ irq = platform_get_irq(pdev, i);
+ if (irq < 0) {
+ ret = irq;
+ goto failed_irq;
+ }
+ }
ret = devm_request_irq(&pdev->dev, irq, fec_enet_interrupt,
0, pdev->name, ndev);
if (ret)
--
2.43.0
next prev parent reply other threads:[~2026-09-11 4:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-11 4:00 [PATCH net-next v6 1/2] net: fec: Propagate PTP initialization errors phucduc.bui
2026-09-11 4:00 ` phucduc.bui [this message]
2026-09-12 4:03 ` [PATCH net-next v6 2/2] net: fec: Handle optional IRQ lookup errors correctly sashiko-bot
2026-09-12 4:03 ` [PATCH net-next v6 1/2] net: fec: Propagate PTP initialization errors sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260911040021.12289-2-phucduc.bui@gmail.com \
--to=phucduc.bui@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=frank.li@nxp.com \
--cc=imx@lists.linux.dev \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=shenwei.wang@nxp.com \
--cc=wei.fang@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.