lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 25 Sep 2022 10:38:32 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     "Alice Guo (OSS)" <alice.guo@....nxp.com>
Cc:     m.felsch@...gutronix.de, wim@...ux-watchdog.org,
        shawnguo@...nel.org, s.hauer@...gutronix.de, festevam@...il.com,
        kernel@...gutronix.de, linux-imx@....com,
        linux-watchdog@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 6/7] watchdog: imx7ulp_wdt: init wdog when it was
 active

On Thu, Aug 25, 2022 at 04:32:55PM +0800, Alice Guo (OSS) wrote:
> From: Jason Liu <jason.hui.liu@....com>
> 
> Paired with suspend, we can only init wdog again when it was active
> and ping it once to avoid the watchdog timeout after it resumed.
> 
> Signed-off-by: Jason Liu <jason.hui.liu@....com>
> Signed-off-by: Alice Guo <alice.guo@....com>
> Reviewed-by: Ye Li <ye.li@....com>
> Reviewed-by: Jacky Bai <ping.bai@....com>
> Tested-by: Jacky Bai <ping.bai@....com>

Reviewed-by: Guenter Roeck <linux@...ck-us.net>

> ---
> 
> Changes for v2:
>  - none
> 
>  drivers/watchdog/imx7ulp_wdt.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/watchdog/imx7ulp_wdt.c b/drivers/watchdog/imx7ulp_wdt.c
> index 0cafa86fff7f..dee02c2a52c9 100644
> --- a/drivers/watchdog/imx7ulp_wdt.c
> +++ b/drivers/watchdog/imx7ulp_wdt.c
> @@ -136,13 +136,6 @@ static int imx7ulp_wdt_enable(struct watchdog_device *wdog, bool enable)
>  	return ret;
>  }
>  
> -static bool imx7ulp_wdt_is_enabled(void __iomem *base)
> -{
> -	u32 val = readl(base + WDOG_CS);
> -
> -	return val & WDOG_CS_EN;
> -}
> -
>  static int imx7ulp_wdt_ping(struct watchdog_device *wdog)
>  {
>  	struct imx7ulp_wdt_device *wdt = watchdog_get_drvdata(wdog);
> @@ -382,11 +375,11 @@ static int __maybe_unused imx7ulp_wdt_resume_noirq(struct device *dev)
>  	if (ret)
>  		return ret;
>  
> -	if (imx7ulp_wdt_is_enabled(imx7ulp_wdt->base))
> +	if (watchdog_active(&imx7ulp_wdt->wdd)) {
>  		imx7ulp_wdt_init(imx7ulp_wdt, timeout);
> -
> -	if (watchdog_active(&imx7ulp_wdt->wdd))
>  		imx7ulp_wdt_start(&imx7ulp_wdt->wdd);
> +		imx7ulp_wdt_ping(&imx7ulp_wdt->wdd);
> +	}
>  
>  	return 0;
>  }
> -- 
> 2.17.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ