Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Marc Kleine-Budde
Wed, 18 Nov 2026 09:11
[PATCH net-next 08/12] can: janz-ican3: don't discard the IRQ lookup error in probe
Author: Marc Kleine-Budde
Date: Wed, 18 Nov 2026 09:11
Date: Wed, 18 Nov 2026 09:11
46 lines
12149 bytes
12149 bytes
From: Chaosheng Qu <chaosheng.qu.linux@gmail.com>
ican3_probe() collapses every failure of platform_get_irq() into
-ENODEV:
mod->irq = platform_get_irq(pdev, 0);
if (mod->irq < 0) {
ret = -ENODEV;
goto out_free_ndev;
}
Return the lookup error unchanged, as the neighbouring CAN platform drivers
do, e.g. previous commit ("can: cc770: don't discard the IRQ lookup error
in probe").
This driver cannot see -EPROBE_DEFER and the change does not fix a
deferred probe. The device is an MFD child of janz-cmodio, which takes
the interrupt from the carrier board's PCI device, and the driver has
neither an of_match_table nor an ACPI match. The probe should not invent
an error code for a lookup that failed for another reason.
Build tested on x86_64.
Signed-off-by: Chaosheng Qu <chaosheng.qu.linux@gmail.com>
Link: https://patch.msgid.link/28add8d0570b72d35c65c19b2365007cf0aa15c3.1792118040.git.chaosheng.qu.linux@gmail.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/janz-ican3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index 1efdd1fd8caa..a65326b0f11e 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -1944,7 +1944,7 @@ static int ican3_probe(struct platform_device *pdev)
/* find our IRQ number */
mod->irq = platform_get_irq(pdev, 0);
if (mod->irq < 0) {
- ret = -ENODEV;
+ ret = mod->irq;
goto out_free_ndev;
}
--
2.53.0
Re: [PATCH net-next 08/12] can: janz-ican3: don't discard the IRQ lookup error in probe
Author: netdev-bot+sashiko
Date: Thu, 19 Nov 2026 09:54
Date: Thu, 19 Nov 2026 09:54
86 lines
10872 bytes
10872 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message doesn't say what users will see after the
change, and the one failure that can actually happen is now reported…
--
can: janz-ican3: don't discard the IRQ lookup error in probe
This commit changes ican3_probe() to return the error from
platform_get_irq() as is, instead of always returning -ENODEV. The commit
message says the driver is an MFD child of janz-cmodio, cannot see
-EPROBE_DEFER, and should not invent its own error code.
Link: https://patch.msgid.link/28add8d0570b72d35c65c19b2365007cf0aa15c3.1792118040.git.chaosheng.qu.linux@gmail.com
> diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
> index 1efdd1fd8caa4..a65326b0f11e9 100644
> --- a/drivers/net/can/janz-ican3.c
> +++ b/drivers/net/can/janz-ican3.c
> @@ -1944,7 +1944,7 @@ static int ican3_probe(struct platform_device *pdev)
> /* find our IRQ number */
> mod->irq = platform_get_irq(pdev, 0);
> if (mod->irq < 0) {
> - ret = -ENODEV;
> + ret = mod->irq;
> goto out_free_ndev;
> }
[Severity: Low]
This isn't a bug, but could the commit message name the failure that can
actually happen here, and the new error code it produces?
The message says:
The probe should not invent an error code for a lookup that failed for
another reason.
cmodio_setup_subdevice() in drivers/mfd/janz-cmodio.c always gives each
child a single IRQ resource at offset 0:
res->flags = IORESOURCE_IRQ;
res->parent = NULL;
res->start = 0;
res->end = 0;
cmodio_probe_submodules() then passes the carrier PCI device's irq as
irq_base:
return mfd_add_devices(&pdev->dev, 0, priv->cells,
num_probed, NULL, pdev->irq, NULL);
So the resource is always there, and the child has no OF node. On
non-SPARC systems, the only error platform_get_irq() can return here
appears to come from platform_get_irq_affinity() when the PCI device's
irq is 0:
if (WARN(!ret, "0 is an invalid IRQ number\n"))
return -EINVAL;
Before this patch, ican3_probe() turned that into -ENODEV. It now returns
-EINVAL.
In call_driver_probe() in drivers/base/dd.c, -ENODEV and -ENXIO are only
logged with dev_dbg ("rejects match"). -EINVAL goes to the default branch
and gets a dev_err ("probe with driver ... failed with error -22"). A
sysfs bind attempt would also get -EINVAL back instead of -ENODEV. On
SPARC the lookup returns -ENXIO, which is logged the same way as -ENODEV,
so nothing changes there.
The other patches in this series describe the visible change, for
example:
A device tree without an interrupt now reports -ENXIO rather than
-ENODEV
Could a similar note be added here, saying that -EINVAL now replaces
-ENODEV when the carrier's irq is 0? The code change itself looks correct.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118092955.1283165-2-mkl%40pengutronix.de
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads