public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Herve Codina <herve.codina@bootlin.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	Guenter Roeck <linux@roeck-us.net>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Magnus Damm <magnus.damm@gmail.com>,
	linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-clk@vger.kernel.org,
	Pascal Eberhard <pascal.eberhard@se.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH 0/5] watchdog: rzn1: Add support for direct hardware reset
Date: Wed, 11 Mar 2026 16:09:07 +0100	[thread overview]
Message-ID: <20260311160907.0686cfa0@bootlin.com> (raw)
In-Reply-To: <abCSvdToaQG20uWT@shikoro>

Hi Wolfram, Geert, Krzysztof

On Tue, 10 Mar 2026 22:53:01 +0100
Wolfram Sang <wsa+renesas@sang-engineering.com> wrote:

> Hi Herve,
> 
> > On timeout, the watchdog also asserts its dedicated reset line. This
> > reset line is connected to the reset controller (part of sysctrl) and,
> > if this line is enabled as a possible reset source at the reset
> > controller level, it initiates a system reset.  
> 
> Okay, this seems similar to R-Car SoCs, so multiple things to add from
> my side:
> 
> * I agree with Krzysztof that the renesas-vendor-binding is not the way
>   to go. The information could be either deduced from the register range
>   or you could have a link to the syscon describing somehow which reset
>   to allow.

I think deducing the information from the register range could be ok without
the need for introducing and use syscon.

On think that could be missing is the way to know if we are allowed or not
to enable this reset source.

Maybe a new "renesas,reset-type" property in the watchdog node could give
this information. This property could take the following value:
   - "soft":
     On timeout, the watchdog triggers an interrupt.

   - "hard":
     On timeout, the watchdog asserts the directly the system reset.

But I am not sure that this king of property will be accepted by Krzysztof
even if similar properties for similar features exist in other watchdog
bindings.

> 
> But:
> 
> * On R-Car, we require the firmware to correctly setup which resets are
>   allowed. Only in cases of broken firmware, we override it in the
>   system controller driver. The latter could probably be argued here.
>   The firmware is old and will probably be not updated anymore.
> 
> * If the watchdog driver kind of unconditionally allows its own reset,
>   we could keep it very simple and just unconditionally allow watchdog
>   resets when probing the sysctrl driver?
> 
> * If you don't like this, you could also parse the DT for enabled
>   watchdogs when probing the sysctrl driver and act upon findings?
> 

Looked deeper in the code.
On RZ/N1, the watchdog interrupt handler calls emergency_restart().

The clock driver (driver handling the sysctrl register area) allows the
software reset source unconditionally and register an handler to request
this software reset on system restart notification [1] and [2].

Whatever resets allowed by the firmware, it is already overridden for the
sofware reset and the watchdog resets the system.

So my plan for the next iteration is, as you suggested, unconditionally
allows watchdog resets in the clock driver probe(). Indeed it is the
driver in charge of sysctrl.

Geert any opinion on this topic?

[1] https://elixir.bootlin.com/linux/v7.0-rc1/source/drivers/clk/renesas/r9a06g032-clocks.c#L1346
[2] https://elixir.bootlin.com/linux/v7.0-rc1/source/drivers/clk/renesas/r9a06g032-clocks.c#L1282

Best regards,
Hervé

  reply	other threads:[~2026-03-11 15:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 17:32 [PATCH 0/5] watchdog: rzn1: Add support for direct hardware reset Herve Codina (Schneider Electric)
2026-03-10 17:32 ` [PATCH 1/5] watchdog: rzn1: Fix reverse xmas tree declaration Herve Codina (Schneider Electric)
2026-03-10 17:32 ` [PATCH 2/5] watchdog: rzn1: Use dev_err_probe() Herve Codina (Schneider Electric)
2026-03-10 17:32 ` [PATCH 3/5] dt-bindings: watchdog: renesas,rzn1-wdt: Document the reset line Herve Codina (Schneider Electric)
2026-03-10 17:38   ` Krzysztof Kozlowski
2026-03-10 18:12     ` Herve Codina
2026-03-10 20:14       ` Krzysztof Kozlowski
2026-03-10 17:32 ` [PATCH 4/5] clk: renesas: r9a06g032: Introduce a helper to set rsten register Herve Codina (Schneider Electric)
2026-03-10 17:32 ` [PATCH 5/5] watchdog: rzn1: Add support for direct hardware reset Herve Codina (Schneider Electric)
2026-03-11  2:12   ` kernel test robot
2026-03-11  6:07   ` kernel test robot
2026-03-10 21:53 ` [PATCH 0/5] " Wolfram Sang
2026-03-11 15:09   ` Herve Codina [this message]
2026-03-11 15:27     ` Wolfram Sang

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=20260311160907.0686cfa0@bootlin.com \
    --to=herve.codina@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=krzk+dt@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=magnus.damm@gmail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=mturquette@baylibre.com \
    --cc=pascal.eberhard@se.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wim@linux-watchdog.org \
    --cc=wsa+renesas@sang-engineering.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox