* [PATCH 1/2] watchdog: orion_wdt: Propagate -EPROBE_DEFER from IRQ lookup
@ 2026-08-06 6:28 phucduc.bui
2026-08-06 6:28 ` [PATCH 2/2] watchdog: stm32_iwdg: " phucduc.bui
2026-08-06 9:30 ` [PATCH 1/2] watchdog: orion_wdt: " Guenter Roeck
0 siblings, 2 replies; 6+ messages in thread
From: phucduc.bui @ 2026-08-06 6:28 UTC (permalink / raw)
To: Wim Van Sebroeck, Guenter Roeck, Maxime Coquelin,
Alexandre Torgue, linux-watchdog
Cc: linux-kernel, linux-stm32, linux-arm-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Return -EPROBE_DEFER from platform_get_irq_optional() so the driver is
re-probed when the interrupt resource becomes available instead of
continuing probe without an IRQ.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/watchdog/orion_wdt.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 0e145f762f6f..8595073a8179 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -606,6 +606,8 @@ static int orion_wdt_probe(struct platform_device *pdev)
/* Request the IRQ only after the watchdog is disabled */
irq = platform_get_irq_optional(pdev, 0);
+ if (irq == -EPROBE_DEFER)
+ return irq;
if (irq > 0) {
/*
* Not all supported platforms specify an interrupt for the
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] watchdog: stm32_iwdg: Propagate -EPROBE_DEFER from IRQ lookup
2026-08-06 6:28 [PATCH 1/2] watchdog: orion_wdt: Propagate -EPROBE_DEFER from IRQ lookup phucduc.bui
@ 2026-08-06 6:28 ` phucduc.bui
2026-08-06 9:35 ` Guenter Roeck
2026-08-06 9:30 ` [PATCH 1/2] watchdog: orion_wdt: " Guenter Roeck
1 sibling, 1 reply; 6+ messages in thread
From: phucduc.bui @ 2026-08-06 6:28 UTC (permalink / raw)
To: Wim Van Sebroeck, Guenter Roeck, Maxime Coquelin,
Alexandre Torgue, linux-watchdog
Cc: linux-kernel, linux-stm32, linux-arm-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
platform_get_irq_optional() does not returns 0. It returns a positive
IRQ number on success or a negative error code on failure.
Return -EPROBE_DEFER from platform_get_irq_optional() so the driver is
re-probed when the interrupt resource becomes available instead of
continuing probe without an IRQ.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/watchdog/stm32_iwdg.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/watchdog/stm32_iwdg.c b/drivers/watchdog/stm32_iwdg.c
index b356a272ff9a..102f51084957 100644
--- a/drivers/watchdog/stm32_iwdg.c
+++ b/drivers/watchdog/stm32_iwdg.c
@@ -287,7 +287,9 @@ static int stm32_iwdg_irq_init(struct platform_device *pdev,
return 0;
irq = platform_get_irq_optional(pdev, 0);
- if (irq <= 0)
+ if (irq == -EPROBE_DEFER)
+ return irq;
+ if (irq < 0)
return 0;
if (of_property_read_bool(np, "wakeup-source")) {
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] watchdog: orion_wdt: Propagate -EPROBE_DEFER from IRQ lookup
2026-08-06 6:28 [PATCH 1/2] watchdog: orion_wdt: Propagate -EPROBE_DEFER from IRQ lookup phucduc.bui
2026-08-06 6:28 ` [PATCH 2/2] watchdog: stm32_iwdg: " phucduc.bui
@ 2026-08-06 9:30 ` Guenter Roeck
2026-08-07 4:20 ` Bui Duc Phuc
1 sibling, 1 reply; 6+ messages in thread
From: Guenter Roeck @ 2026-08-06 9:30 UTC (permalink / raw)
To: phucduc.bui, Wim Van Sebroeck, Maxime Coquelin, Alexandre Torgue,
linux-watchdog
Cc: linux-kernel, linux-stm32, linux-arm-kernel
On 8/5/26 23:28, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> Return -EPROBE_DEFER from platform_get_irq_optional() so the driver is
> re-probed when the interrupt resource becomes available instead of
> continuing probe without an IRQ.
>
> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
> ---
> drivers/watchdog/orion_wdt.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
> index 0e145f762f6f..8595073a8179 100644
> --- a/drivers/watchdog/orion_wdt.c
> +++ b/drivers/watchdog/orion_wdt.c
> @@ -606,6 +606,8 @@ static int orion_wdt_probe(struct platform_device *pdev)
>
> /* Request the IRQ only after the watchdog is disabled */
> irq = platform_get_irq_optional(pdev, 0);
> + if (irq == -EPROBE_DEFER)
> + return irq;
I think this should be
if (irq < 0 && irq != -ENXIO)
return irq;
Guenter
> if (irq > 0) {
> /*
> * Not all supported platforms specify an interrupt for the
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] watchdog: stm32_iwdg: Propagate -EPROBE_DEFER from IRQ lookup
2026-08-06 6:28 ` [PATCH 2/2] watchdog: stm32_iwdg: " phucduc.bui
@ 2026-08-06 9:35 ` Guenter Roeck
2026-08-07 4:23 ` Bui Duc Phuc
0 siblings, 1 reply; 6+ messages in thread
From: Guenter Roeck @ 2026-08-06 9:35 UTC (permalink / raw)
To: phucduc.bui, Wim Van Sebroeck, Maxime Coquelin, Alexandre Torgue,
linux-watchdog
Cc: linux-kernel, linux-stm32, linux-arm-kernel
On 8/5/26 23:28, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> platform_get_irq_optional() does not returns 0. It returns a positive
> IRQ number on success or a negative error code on failure.
>
> Return -EPROBE_DEFER from platform_get_irq_optional() so the driver is
> re-probed when the interrupt resource becomes available instead of
> continuing probe without an IRQ.
>
> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
> ---
> drivers/watchdog/stm32_iwdg.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/stm32_iwdg.c b/drivers/watchdog/stm32_iwdg.c
> index b356a272ff9a..102f51084957 100644
> --- a/drivers/watchdog/stm32_iwdg.c
> +++ b/drivers/watchdog/stm32_iwdg.c
> @@ -287,7 +287,9 @@ static int stm32_iwdg_irq_init(struct platform_device *pdev,
> return 0;
>
> irq = platform_get_irq_optional(pdev, 0);
> - if (irq <= 0)
> + if (irq == -EPROBE_DEFER)
> + return irq;
> + if (irq < 0)
> return 0;
if (irq < 0) {
if (irq != -ENXIO)
return irq;
return 0;
}
platform_get_irq_optional() does not return 0. and -ENXIO is returned
if there is no interrupt.
Guenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] watchdog: orion_wdt: Propagate -EPROBE_DEFER from IRQ lookup
2026-08-06 9:30 ` [PATCH 1/2] watchdog: orion_wdt: " Guenter Roeck
@ 2026-08-07 4:20 ` Bui Duc Phuc
0 siblings, 0 replies; 6+ messages in thread
From: Bui Duc Phuc @ 2026-08-07 4:20 UTC (permalink / raw)
To: Guenter Roeck
Cc: Wim Van Sebroeck, Maxime Coquelin, Alexandre Torgue,
linux-watchdog, linux-kernel, linux-stm32, linux-arm-kernel
Hi Guenter,
Thank you for your review.
> > + if (irq == -EPROBE_DEFER)
> > + return irq;
>
> I think this should be
>
> if (irq < 0 && irq != -ENXIO)
> return irq;
>
Agreed, that's better.
-EINVAL also deserves to be returned, not just -EPROBE_DEFER
only -ENXIO really means "no IRQ".
Will send v2 soon.
Best regards,
Phuc
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] watchdog: stm32_iwdg: Propagate -EPROBE_DEFER from IRQ lookup
2026-08-06 9:35 ` Guenter Roeck
@ 2026-08-07 4:23 ` Bui Duc Phuc
0 siblings, 0 replies; 6+ messages in thread
From: Bui Duc Phuc @ 2026-08-07 4:23 UTC (permalink / raw)
To: Guenter Roeck
Cc: Wim Van Sebroeck, Maxime Coquelin, Alexandre Torgue,
linux-watchdog, linux-kernel, linux-stm32, linux-arm-kernel
Hi Guenter,
Thank you for your review.
> > - if (irq <= 0)
> > + if (irq == -EPROBE_DEFER)
> > + return irq;
> > + if (irq < 0)
> > return 0;
>
> if (irq < 0) {
> if (irq != -ENXIO)
> return irq;
> return 0;
> }
>
> platform_get_irq_optional() does not return 0. and -ENXIO is returned
> if there is no interrupt.
I will send a v2 soon.
Best regards,
Phuc
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-08-07 4:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06 6:28 [PATCH 1/2] watchdog: orion_wdt: Propagate -EPROBE_DEFER from IRQ lookup phucduc.bui
2026-08-06 6:28 ` [PATCH 2/2] watchdog: stm32_iwdg: " phucduc.bui
2026-08-06 9:35 ` Guenter Roeck
2026-08-07 4:23 ` Bui Duc Phuc
2026-08-06 9:30 ` [PATCH 1/2] watchdog: orion_wdt: " Guenter Roeck
2026-08-07 4:20 ` Bui Duc Phuc
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox