Re: [PATCH RFC 5/6] watchdog: qcom-wdt: add support to read the restart reason from IMEM

From: Kathiravan Thirumoorthy
Date: Fri Apr 11 2025 - 01:29:39 EST



On 4/8/2025 6:03 PM, Guenter Roeck wrote:
  static int qcom_wdt_probe(struct platform_device *pdev)
  {
      struct device *dev = &pdev->dev;
@@ -267,7 +303,9 @@ static int qcom_wdt_probe(struct platform_device *pdev)
      wdt->wdd.parent = dev;
      wdt->layout = data->offset;
  -    if (readl(wdt_addr(wdt, WDT_STS)) & 1)
+    ret = qcom_wdt_get_restart_reason(wdt);
+    if (ret == -ENOENT &&
+        readl(wdt_addr(wdt, WDT_STS)) & 1)
          wdt->wdd.bootstatus = WDIOF_CARDRESET;

This ignores all other error returns from qcom_wdt_get_restart_reason(),
but in that function it generates several dev_err(). Either make those
messages less than an error, or treat them as error and drop out here.


Thanks for pointing this out. I will handle these errors in the next version.