Re: [PATCH RFC v2 8/9] arm64: dts: renesas: r9a09g077: Use SYS syscon for WDTDCR access

[email protected]
Newsgroups org.kernel.vger.linux-watchdog,org.kernel.vger.linux-devicetree
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Transitioning to a syscon regmap introduces a spinlock into the watchdog restart path, creating a severe deadlock risk during kernel panics or reboots.
--

commit f54f749e298c48411aae186783c11b3cc40d3738
Author: Lad Prabhakar <[email protected]>

arm64: dts: renesas: r9a09g077: Use SYS syscon for WDTDCR access

This commit updates the device tree for the r9a09g077 watchdog nodes
to use the new System Controller (SYS) syscon interface. It replaces
the direct MMIO region mapping with a "renesas,sys" phandle.

> diff --git a/arch/arm64/boot/dts/renesas/r9a09g077.dtsi b/arch/arm64/boot/dts/renesas/r9a09g077.dtsi
> index 208287f7b7442..ae69a01d60427 100644
> --- a/arch/arm64/boot/dts/renesas/r9a09g077.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r9a09g077.dtsi
> @@ -327,61 +327,61 @@ channel1 {
>  
>  		wdt0: watchdog@80082000 {
>  			compatible = "renesas,r9a09g077-wdt";
> -			reg = <0 0x80082000 0 0x400>,
> -			      <0 0x81295100 0 0x04>;
> +			reg = <0 0x80082000 0 0x400>;
>  			clocks = <&cpg CPG_CORE R9A09G077_CLK_PCLKL>;
>  			clock-names = "pclk";
>  			power-domains = <&cpg>;
> +			renesas,sys = <&sys1 0>;

[Severity: High]
Does adding this property introduce a deadlock during system panic or reboot?

By pointing the watchdog at the syscon regmap, the driver transitions
from lockless MMIO to a spinlocked regmap access path. If the system panics
and smp_send_stop() stops a CPU while it is holding the syscon regmap lock,
the watchdog restart handler could hang indefinitely.

The triggering sequence looks like this:

machine_restart()
  smp_send_stop()
  do_kernel_restart()
    watchdog_restart_notifier()
      rzv2h_wdt_restart()
        rzt2h_wdt_wdtdcr_count_start()
          regmap_update_bits()

Since regmap_update_bits() uses a standard spinlock, the restart path will
spin forever waiting for the locked CPU. Is there a way to bypass the lock
during the restart sequence?

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=8
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.