Re: [PATCH v7 4/5] watchdog: qcom: add support to get the bootstatus from IMEM

From: Konrad Dybcio

Date: Wed Feb 25 2026 - 07:42:42 EST


On 2/25/26 7:43 AM, Kathiravan Thirumoorthy wrote:
> When the system boots up after a watchdog reset, the EXPIRED_STATUS bit
> in the WDT_STS register is cleared. To identify if the system was
> restarted due to WDT expiry, XBL update the information in the IMEM region.
> Update the driver to read the restart reason from IMEM and populate the
> bootstatus accordingly.
>
> With the CONFIG_WATCHDOG_SYSFS enabled, user can extract the information
> as below:
>
> cat /sys/devices/platform/soc@0/f410000.watchdog/watchdog/watchdog0/bootstatus
> 32
>
> For backward compatibility, keep the EXPIRED_STATUS bit check. Add a new
> function qcom_wdt_get_bootstatus() to read the restart reason from
> IMEM.
>
> Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@xxxxxxxxxxxxxxxx>
> ---

[...]

> +static int qcom_wdt_get_bootstatus(struct device *dev, struct qcom_wdt *wdt,
> + u32 val)
> +{
> + struct device_node *imem;
> + struct resource res;
> + void __iomem *addr;
> + int ret;
> +
> + imem = of_parse_phandle(dev->of_node, "sram", 0);
> + if (!imem) {
> +
> + /* Fallback to the existing check */

Odd \n above

'existing' is imprecise, perhaps something like

/* Read the EXPIRED_STATUS bit as a fallback */

lg otherwise

Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>

Konrad