]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
watchdog: qcom-wdt: Drop read check on write-only WDT_EN register
authorBalaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Tue, 1 Jul 2025 06:57:38 +0000 (12:27 +0530)
committerCasey Connolly <casey.connolly@linaro.org>
Mon, 14 Jul 2025 13:35:24 +0000 (15:35 +0200)
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@oss.qualcomm.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Link: https://lore.kernel.org/r/20250701065738.1644669-1-balaji.selvanathan@oss.qualcomm.com
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
drivers/watchdog/qcom-wdt.c

index adbb5aacdc3b5cfc307cc4ff2dd6ee7c3131c7f2..4b972cff72ce514b3bf8a7db1643557f38cae357 100644 (file)
@@ -63,10 +63,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;
 }