Re: [PATCH v4 7/7] riscv: dts: eswin: add watchdog support

[email protected]
Newsgroups 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] The watchdog device tree nodes map the APB bus clock to the watchdog timer reference clock, ignoring the dedicated Watchdog Reference clock.
--

--- Patch [7]: [PATCH v4 7/7] riscv: dts: eswin: add watchdog support ---
commit 8bb5be57363c57f6d3977083d5441f186e416e96
Author: Pritesh Patel <[email protected]>

riscv: dts: eswin: add watchdog support

Add watchdog node for ESWIN EIC7700 SoC and enable them for HiFive
Premier P550 board

> diff --git a/arch/riscv/boot/dts/eswin/eic7700.dtsi b/arch/riscv/boot/dts/eswin/eic7700.dtsi
> index c13432d145042..f873e9eeb9290 100644
> --- a/arch/riscv/boot/dts/eswin/eic7700.dtsi
> +++ b/arch/riscv/boot/dts/eswin/eic7700.dtsi
> @@ -265,6 +265,46 @@ syscon: syscon@50440000 {
>  			};
>  		};
>  
> +		wdt0: watchdog@50800000 {
> +			compatible = "snps,dw-wdt";
> +			reg = <0x0 0x50800000 0x0 0x4000>;
> +			interrupts = <87>;
> +			clocks = <&clk EIC7700_CLK_GATE_LSP_WDT0_PCLK>;
> +			clock-names = "tclk";

[Severity: High]
Is this node missing the dedicated watchdog reference clock?

The DesignWare APB Watchdog driver uses the frequency of tclk to calculate
watchdog timeout durations. Because only the APB bus clock
(EIC7700_CLK_GATE_LSP_WDT0_PCLK) is provided here, it appears the driver
will use the higher frequency of the APB clock for timeout calculations,
resulting in incorrectly calculated timeout values.

Additionally, if the dedicated watchdog reference clock
(EIC7700_CLK_GATE_NOC_WDREF) is omitted from the device tree entirely,
will the clock subsystem consider it unused and automatically disable it
during late boot? 

If the hardware is synthesized in asynchronous dual-clock mode, stopping the
reference clock might silently prevent the watchdog hardware from counting
altogether.

Should both the timer reference clock and the APB interface clock be
provided in the clocks list?

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=7
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.