[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1f19f7a4-86db-4d49-b121-e8d38baa74cd@roeck-us.net>
Date: Thu, 4 Jul 2024 22:39:54 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Sascha Hauer <s.hauer@...gutronix.de>, linux-watchdog@...r.kernel.org
Cc: Wim Van Sebroeck <wim@...ux-watchdog.org>, imx@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Pengutronix Kernel Team <kernel@...gutronix.de>
Subject: Re: [PATCH] watchdog: imx7ulp_wdt: keep already running watchdog
enabled
On 7/3/24 04:16, Sascha Hauer wrote:
> When the bootloader enabled the watchdog before Kernel started then
> keep it enabled during initialization. Otherwise the time between
> the watchdog probing and the userspace taking over the watchdog
> won't be covered by the watchdog. When keeping the watchdog enabled
> inform the Kernel about this by setting the WDOG_HW_RUNNING so that
> the periodic watchdog feeder is started when desired.
>
> Signed-off-by: Sascha Hauer <s.hauer@...gutronix.de>
Reviewed-by: Guenter Roeck <linux@...ck-us.net>
> ---
> drivers/watchdog/imx7ulp_wdt.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/watchdog/imx7ulp_wdt.c b/drivers/watchdog/imx7ulp_wdt.c
> index b21d7a74a42df..94914a22daff7 100644
> --- a/drivers/watchdog/imx7ulp_wdt.c
> +++ b/drivers/watchdog/imx7ulp_wdt.c
> @@ -290,6 +290,11 @@ static int imx7ulp_wdt_init(struct imx7ulp_wdt_device *wdt, unsigned int timeout
> if (wdt->ext_reset)
> val |= WDOG_CS_INT_EN;
>
> + if (readl(wdt->base + WDOG_CS) & WDOG_CS_EN) {
> + set_bit(WDOG_HW_RUNNING, &wdt->wdd.status);
> + val |= WDOG_CS_EN;
> + }
> +
> do {
> ret = _imx7ulp_wdt_init(wdt, timeout, val);
> toval = readl(wdt->base + WDOG_TOVAL);
Powered by blists - more mailing lists