* [PATCH v4 1/4] watchdog: rzn1: Fix reverse xmas tree declaration
2026-05-07 10:24 [PATCH v4 0/4] watchdog: rzn1: clean up and drop irq requirement Wolfram Sang
@ 2026-05-07 10:24 ` Wolfram Sang
2026-05-08 16:29 ` Guenter Roeck
2026-05-07 10:24 ` [PATCH v4 2/4] watchdog: rzn1: Use dev_err_probe() Wolfram Sang
` (2 subsequent siblings)
3 siblings, 1 reply; 14+ messages in thread
From: Wolfram Sang @ 2026-05-07 10:24 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Herve Codina (Schneider Electric), Guenter Roeck, Wolfram Sang,
Wim Van Sebroeck, linux-watchdog
From: "Herve Codina (Schneider Electric)" <herve.codina@bootlin.com>
Variables declared in probe() don't follow the reverse xmas
tree convention.
Fix the declaration in order to follow the convention.
Signed-off-by: Herve Codina (Schneider Electric) <herve.codina@bootlin.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/watchdog/rzn1_wdt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/watchdog/rzn1_wdt.c b/drivers/watchdog/rzn1_wdt.c
index 96fd04fbc2a2..b7034eac91d0 100644
--- a/drivers/watchdog/rzn1_wdt.c
+++ b/drivers/watchdog/rzn1_wdt.c
@@ -101,10 +101,10 @@ static const struct watchdog_ops rzn1_wdt_ops = {
static int rzn1_wdt_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- struct rzn1_watchdog *wdt;
struct device_node *np = dev->of_node;
- struct clk *clk;
+ struct rzn1_watchdog *wdt;
unsigned long clk_rate;
+ struct clk *clk;
int ret;
int irq;
--
2.47.3
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v4 2/4] watchdog: rzn1: Use dev_err_probe()
2026-05-07 10:24 [PATCH v4 0/4] watchdog: rzn1: clean up and drop irq requirement Wolfram Sang
2026-05-07 10:24 ` [PATCH v4 1/4] watchdog: rzn1: Fix reverse xmas tree declaration Wolfram Sang
@ 2026-05-07 10:24 ` Wolfram Sang
2026-05-08 16:30 ` Guenter Roeck
2026-05-07 10:24 ` [PATCH v4 3/4] watchdog: rzn1: remove now obsolete interrupt support Wolfram Sang
2026-05-07 10:24 ` [PATCH v4 4/4] dt-bindings: watchdog: renesas,rzn1-wdt: interrupts are not required Wolfram Sang
3 siblings, 1 reply; 14+ messages in thread
From: Wolfram Sang @ 2026-05-07 10:24 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Herve Codina (Schneider Electric), Guenter Roeck, Wolfram Sang,
Wim Van Sebroeck, linux-watchdog
From: "Herve Codina (Schneider Electric)" <herve.codina@bootlin.com>
In the probe() function the following pattern is present several times:
if (err) {
dev_err(dev, ...);
return err;
}
Replace them by dev_err_probe() calls.
Signed-off-by: Herve Codina (Schneider Electric) <herve.codina@bootlin.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/watchdog/rzn1_wdt.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/watchdog/rzn1_wdt.c b/drivers/watchdog/rzn1_wdt.c
index b7034eac91d0..48d5afef62a5 100644
--- a/drivers/watchdog/rzn1_wdt.c
+++ b/drivers/watchdog/rzn1_wdt.c
@@ -122,22 +122,16 @@ static int rzn1_wdt_probe(struct platform_device *pdev)
ret = devm_request_irq(dev, irq, rzn1_wdt_irq, 0,
np->name, wdt);
- if (ret) {
- dev_err(dev, "failed to request irq %d\n", irq);
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to request irq %d\n", irq);
clk = devm_clk_get_enabled(dev, NULL);
- if (IS_ERR(clk)) {
- dev_err(dev, "failed to get the clock\n");
- return PTR_ERR(clk);
- }
+ if (IS_ERR(clk))
+ return dev_err_probe(dev, PTR_ERR(clk), "failed to get the clock\n");
clk_rate = clk_get_rate(clk);
- if (!clk_rate) {
- dev_err(dev, "failed to get the clock rate\n");
- return -EINVAL;
- }
+ if (!clk_rate)
+ return dev_err_probe(dev, -EINVAL, "failed to get the clock rate\n");
wdt->clk_rate_khz = clk_rate / 1000;
wdt->wdtdev.info = &rzn1_wdt_info;
--
2.47.3
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v4 2/4] watchdog: rzn1: Use dev_err_probe()
2026-05-07 10:24 ` [PATCH v4 2/4] watchdog: rzn1: Use dev_err_probe() Wolfram Sang
@ 2026-05-08 16:30 ` Guenter Roeck
0 siblings, 0 replies; 14+ messages in thread
From: Guenter Roeck @ 2026-05-08 16:30 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-renesas-soc, Herve Codina (Schneider Electric),
Wim Van Sebroeck, linux-watchdog
On Thu, May 07, 2026 at 12:24:07PM +0200, Wolfram Sang wrote:
> From: "Herve Codina (Schneider Electric)" <herve.codina@bootlin.com>
>
> In the probe() function the following pattern is present several times:
> if (err) {
> dev_err(dev, ...);
> return err;
> }
>
> Replace them by dev_err_probe() calls.
>
> Signed-off-by: Herve Codina (Schneider Electric) <herve.codina@bootlin.com>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v4 3/4] watchdog: rzn1: remove now obsolete interrupt support
2026-05-07 10:24 [PATCH v4 0/4] watchdog: rzn1: clean up and drop irq requirement Wolfram Sang
2026-05-07 10:24 ` [PATCH v4 1/4] watchdog: rzn1: Fix reverse xmas tree declaration Wolfram Sang
2026-05-07 10:24 ` [PATCH v4 2/4] watchdog: rzn1: Use dev_err_probe() Wolfram Sang
@ 2026-05-07 10:24 ` Wolfram Sang
2026-05-07 11:20 ` Herve Codina
` (2 more replies)
2026-05-07 10:24 ` [PATCH v4 4/4] dt-bindings: watchdog: renesas,rzn1-wdt: interrupts are not required Wolfram Sang
3 siblings, 3 replies; 14+ messages in thread
From: Wolfram Sang @ 2026-05-07 10:24 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Herve Codina (Schneider Electric), Wolfram Sang, Wim Van Sebroeck,
Guenter Roeck, linux-watchdog
Previously, it was overlooked that the watchdog could reset the system
directly. So, a workaround using the interrupt which called
emergency_restart() was implemented. We now configure the controller
when booting properly to allow watchdog resets directly. Thus, remove
the interrupt workaround.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/watchdog/rzn1_wdt.c | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/drivers/watchdog/rzn1_wdt.c b/drivers/watchdog/rzn1_wdt.c
index 48d5afef62a5..4fdc5363ba98 100644
--- a/drivers/watchdog/rzn1_wdt.c
+++ b/drivers/watchdog/rzn1_wdt.c
@@ -79,14 +79,6 @@ static int rzn1_wdt_start(struct watchdog_device *w)
return 0;
}
-static irqreturn_t rzn1_wdt_irq(int irq, void *_wdt)
-{
- pr_crit("RZN1 Watchdog. Initiating system reboot\n");
- emergency_restart();
-
- return IRQ_HANDLED;
-}
-
static struct watchdog_info rzn1_wdt_info = {
.identity = "RZ/N1 Watchdog",
.options = WDIOF_MAGICCLOSE | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
@@ -101,12 +93,10 @@ static const struct watchdog_ops rzn1_wdt_ops = {
static int rzn1_wdt_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- struct device_node *np = dev->of_node;
struct rzn1_watchdog *wdt;
unsigned long clk_rate;
struct clk *clk;
int ret;
- int irq;
wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
if (!wdt)
@@ -116,15 +106,6 @@ static int rzn1_wdt_probe(struct platform_device *pdev)
if (IS_ERR(wdt->base))
return PTR_ERR(wdt->base);
- irq = platform_get_irq(pdev, 0);
- if (irq < 0)
- return irq;
-
- ret = devm_request_irq(dev, irq, rzn1_wdt_irq, 0,
- np->name, wdt);
- if (ret)
- return dev_err_probe(dev, ret, "failed to request irq %d\n", irq);
-
clk = devm_clk_get_enabled(dev, NULL);
if (IS_ERR(clk))
return dev_err_probe(dev, PTR_ERR(clk), "failed to get the clock\n");
--
2.47.3
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v4 3/4] watchdog: rzn1: remove now obsolete interrupt support
2026-05-07 10:24 ` [PATCH v4 3/4] watchdog: rzn1: remove now obsolete interrupt support Wolfram Sang
@ 2026-05-07 11:20 ` Herve Codina
2026-05-07 21:05 ` sashiko-bot
2026-05-08 16:31 ` Guenter Roeck
2 siblings, 0 replies; 14+ messages in thread
From: Herve Codina @ 2026-05-07 11:20 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-renesas-soc, Wim Van Sebroeck, Guenter Roeck,
linux-watchdog
Hi Wolfram,
On Thu, 7 May 2026 12:24:08 +0200
Wolfram Sang <wsa+renesas@sang-engineering.com> wrote:
> Previously, it was overlooked that the watchdog could reset the system
> directly. So, a workaround using the interrupt which called
> emergency_restart() was implemented. We now configure the controller
> when booting properly to allow watchdog resets directly. Thus, remove
> the interrupt workaround.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> drivers/watchdog/rzn1_wdt.c | 19 -------------------
> 1 file changed, 19 deletions(-)
Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Best regards,
Hervé
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 3/4] watchdog: rzn1: remove now obsolete interrupt support
2026-05-07 10:24 ` [PATCH v4 3/4] watchdog: rzn1: remove now obsolete interrupt support Wolfram Sang
2026-05-07 11:20 ` Herve Codina
@ 2026-05-07 21:05 ` sashiko-bot
2026-05-08 16:31 ` Guenter Roeck
2 siblings, 0 replies; 14+ messages in thread
From: sashiko-bot @ 2026-05-07 21:05 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-watchdog, wsa+renesas
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Unconditionally removing the interrupt workaround breaks watchdog reboot functionality on existing systems running older bootloaders.
--
commit cc090392d96a1601fdb1492a2e01bab3e4a23303
Author: Wolfram Sang <wsa+renesas@sang-engineering.com>
watchdog: rzn1: remove now obsolete interrupt support
This commit removes the interrupt-based workaround that used
emergency_restart() on watchdog timeout. It assumes the controller is now
configured by the bootloader to reset the system directly.
> diff --git a/drivers/watchdog/rzn1_wdt.c b/drivers/watchdog/rzn1_wdt.c
> --- a/drivers/watchdog/rzn1_wdt.c
> +++ b/drivers/watchdog/rzn1_wdt.c
[ ... ]
> @@ -116,15 +106,6 @@ static int rzn1_wdt_probe(struct platform_device *pdev)
> if (IS_ERR(wdt->base))
> return PTR_ERR(wdt->base);
>
> - irq = platform_get_irq(pdev, 0);
> - if (irq < 0)
> - return irq;
> -
> - ret = devm_request_irq(dev, irq, rzn1_wdt_irq, 0,
> - np->name, wdt);
> - if (ret)
> - return dev_err_probe(dev, ret, "failed to request irq %d\n", irq);
Will this break existing systems running older bootloaders?
If the bootloader hasn't been updated to configure the hardware for direct
reset, the watchdog timeout will assert the interrupt line. Without this
handler, the unhandled interrupt might cause the system to hang entirely
instead of rebooting.
Could we use platform_get_irq_optional() here instead and retain the
interrupt handler as a fallback for backward compatibility with older
firmware?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260507102410.43384-1-wsa+renesas@sang-engineering.com?part=3
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 3/4] watchdog: rzn1: remove now obsolete interrupt support
2026-05-07 10:24 ` [PATCH v4 3/4] watchdog: rzn1: remove now obsolete interrupt support Wolfram Sang
2026-05-07 11:20 ` Herve Codina
2026-05-07 21:05 ` sashiko-bot
@ 2026-05-08 16:31 ` Guenter Roeck
2026-05-08 20:05 ` Wolfram Sang
2 siblings, 1 reply; 14+ messages in thread
From: Guenter Roeck @ 2026-05-08 16:31 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-renesas-soc, Herve Codina (Schneider Electric),
Wim Van Sebroeck, linux-watchdog
On Thu, May 07, 2026 at 12:24:08PM +0200, Wolfram Sang wrote:
> Previously, it was overlooked that the watchdog could reset the system
> directly. So, a workaround using the interrupt which called
> emergency_restart() was implemented. We now configure the controller
> when booting properly to allow watchdog resets directly. Thus, remove
> the interrupt workaround.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Reviewed-by: Herve Codina <herve.codina@bootlin.com>
I don't think Sashiko's concern is warranted. Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v4 4/4] dt-bindings: watchdog: renesas,rzn1-wdt: interrupts are not required
2026-05-07 10:24 [PATCH v4 0/4] watchdog: rzn1: clean up and drop irq requirement Wolfram Sang
` (2 preceding siblings ...)
2026-05-07 10:24 ` [PATCH v4 3/4] watchdog: rzn1: remove now obsolete interrupt support Wolfram Sang
@ 2026-05-07 10:24 ` Wolfram Sang
2026-05-07 11:22 ` Herve Codina
` (2 more replies)
3 siblings, 3 replies; 14+ messages in thread
From: Wolfram Sang @ 2026-05-07 10:24 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Herve Codina (Schneider Electric), Wolfram Sang, Wim Van Sebroeck,
Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, linux-watchdog, devicetree
It is now understood how the watchdog can do its job without the need of
an interrupt. So, it is not required anymore but optional.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml | 1 -
1 file changed, 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml
index 7e3ee533cd56..0e4b5b529e9c 100644
--- a/Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml
@@ -29,7 +29,6 @@ properties:
required:
- compatible
- reg
- - interrupts
- clocks
allOf:
--
2.47.3
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v4 4/4] dt-bindings: watchdog: renesas,rzn1-wdt: interrupts are not required
2026-05-07 10:24 ` [PATCH v4 4/4] dt-bindings: watchdog: renesas,rzn1-wdt: interrupts are not required Wolfram Sang
@ 2026-05-07 11:22 ` Herve Codina
2026-05-08 16:32 ` Guenter Roeck
2026-05-13 22:28 ` Rob Herring (Arm)
2 siblings, 0 replies; 14+ messages in thread
From: Herve Codina @ 2026-05-07 11:22 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-renesas-soc, Wim Van Sebroeck, Guenter Roeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Magnus Damm, linux-watchdog, devicetree
Hi Wolfram,
On Thu, 7 May 2026 12:24:09 +0200
Wolfram Sang <wsa+renesas@sang-engineering.com> wrote:
> It is now understood how the watchdog can do its job without the need of
> an interrupt. So, it is not required anymore but optional.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml | 1 -
> 1 file changed, 1 deletion(-)
>
Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Best regards,
Hervé
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 4/4] dt-bindings: watchdog: renesas,rzn1-wdt: interrupts are not required
2026-05-07 10:24 ` [PATCH v4 4/4] dt-bindings: watchdog: renesas,rzn1-wdt: interrupts are not required Wolfram Sang
2026-05-07 11:22 ` Herve Codina
@ 2026-05-08 16:32 ` Guenter Roeck
2026-05-13 22:28 ` Rob Herring (Arm)
2 siblings, 0 replies; 14+ messages in thread
From: Guenter Roeck @ 2026-05-08 16:32 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-renesas-soc, Herve Codina (Schneider Electric),
Wim Van Sebroeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, linux-watchdog, devicetree
On Thu, May 07, 2026 at 12:24:09PM +0200, Wolfram Sang wrote:
> It is now understood how the watchdog can do its job without the need of
> an interrupt. So, it is not required anymore but optional.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Waiting for DT maintainer approval.
For my reference:
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Thanks,
Guenter
> ---
> Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml
> index 7e3ee533cd56..0e4b5b529e9c 100644
> --- a/Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml
> @@ -29,7 +29,6 @@ properties:
> required:
> - compatible
> - reg
> - - interrupts
> - clocks
>
> allOf:
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 4/4] dt-bindings: watchdog: renesas,rzn1-wdt: interrupts are not required
2026-05-07 10:24 ` [PATCH v4 4/4] dt-bindings: watchdog: renesas,rzn1-wdt: interrupts are not required Wolfram Sang
2026-05-07 11:22 ` Herve Codina
2026-05-08 16:32 ` Guenter Roeck
@ 2026-05-13 22:28 ` Rob Herring (Arm)
2 siblings, 0 replies; 14+ messages in thread
From: Rob Herring (Arm) @ 2026-05-13 22:28 UTC (permalink / raw)
To: Wolfram Sang
Cc: Geert Uytterhoeven, Guenter Roeck, devicetree, Magnus Damm,
Wim Van Sebroeck, linux-renesas-soc, Conor Dooley,
Herve Codina (Schneider Electric), linux-watchdog,
Krzysztof Kozlowski
On Thu, 07 May 2026 12:24:09 +0200, Wolfram Sang wrote:
> It is now understood how the watchdog can do its job without the need of
> an interrupt. So, it is not required anymore but optional.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml | 1 -
> 1 file changed, 1 deletion(-)
>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 14+ messages in thread