Re: [PATCH v3 8/8] riscv: dts: eswin: add watchdog support

[email protected] Tue, 04 Aug 2026 11:34:19 +0000
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] Incorrect timer reference clock mapping for watchdog nodes
--

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

riscv: dts: eswin: add watchdog support

This commit adds watchdog nodes for the ESWIN EIC7700 SoC and enables
them for the 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]
Will this cause the watchdog to calculate timeouts incorrectly or freeze
entirely?

The snps,dw-wdt driver uses the clock named tclk to determine the frequency
for timeout calculations. Here it is mapped to the APB interface clock
(EIC7700_CLK_GATE_LSP_WDT0_PCLK).

Since the ESWIN EIC7700 clock driver defines a separate watchdog reference
clock (EIC7700_CLK_GATE_NOC_WDREF), providing the faster APB clock frequency
to the driver might cause it to calculate extremely large tick counts. This
would result in physical timeouts taking much longer than requested.

Additionally, if EIC7700_CLK_GATE_NOC_WDREF is not referenced here, could
the common clock framework's clk_disable_unused late initcall gate it and
completely freeze the watchdog counter?

This same clock mapping pattern appears in the wdt1, wdt2, and wdt3 nodes
introduced below.

> +			resets = <&reset EIC7700_RESET_WDT0>;
> +			status = "disabled";
> +		};

[ ... ]

-- 
Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=8