[PATCH v1] watchdog: qcom-wdt: Drop read check on write-only WDT_EN register

Stefan Roese sr at denx.de
Wed Jul 2 09:22:31 CEST 2025


On 01.07.25 08:57, Balaji Selvanathan wrote:
> On some Qualcomm platforms, such as Dragonwing boards, the WDT_EN
> register is write-only. Reading it back after enabling the watchdog
> can return invalid data or cause unexpected behavior.
> 
> In particular, the check:
>    if (readl(wdt_addr(wdt, WDT_EN)) != 1)
> may fail even though the watchdog is correctly enabled and running.
> This leads to misleading error messages and unnecessary failures.
> 
> Removing the read check ensures compatibility and avoids false
> negatives on platforms where WDT_EN is not readable.
> 
> This work builds upon this previous submission:
> https://lore.kernel.org/u-boot/20250625094607.1348494-1-gopinath.sekar@oss.qualcomm.com/
> 
> Signed-off-by: Balaji Selvanathan <balaji.selvanathan at oss.qualcomm.com>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan

> ---
>   drivers/watchdog/qcom-wdt.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/watchdog/qcom-wdt.c b/drivers/watchdog/qcom-wdt.c
> index af97b27e311..e4ebb1f31d4 100644
> --- a/drivers/watchdog/qcom-wdt.c
> +++ b/drivers/watchdog/qcom-wdt.c
> @@ -82,10 +82,7 @@ int qcom_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
>   	writel(bark_timeout_s, wdt_addr(wdt, WDT_BARK_TIME));
>   	writel(bite_timeout_s, wdt_addr(wdt, WDT_BITE_TIME));
>   	writel(BIT(0), wdt_addr(wdt, WDT_EN));
> -	if (readl(wdt_addr(wdt, WDT_EN)) != 1) {
> -		dev_err(dev, "Failed to enable Qualcomm watchdog!\n");
> -		return -EIO;
> -	}
> +
>   	return 0;
>   }
>   

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de



More information about the U-Boot mailing list