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]
Message-ID: <9a79920c-71a6-d609-aefc-15b92802a3ed@roeck-us.net>
Date:   Fri, 9 Mar 2018 19:22:46 -0800
From:   Guenter Roeck <linux@...ck-us.net>
To:     Brian Norris <briannorris@...omium.org>,
        Wim Van Sebroeck <wim@...ux-watchdog.org>
Cc:     linux-kernel@...r.kernel.org, linux-watchdog@...r.kernel.org,
        Doug Anderson <dianders@...omium.org>,
        Matthias Kaehlcke <mka@...omium.org>
Subject: Re: [PATCH 2/2] watchdog: dw: save/restore control and timeout across
 suspend/resume

On 03/09/2018 06:44 PM, Brian Norris wrote:
> Some platforms lose this state in suspend. It should be safe to do this
> unconditionally.
> 
> Signed-off-by: Brian Norris <briannorris@...omium.org>

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

> ---
>   drivers/watchdog/dw_wdt.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
> index 6925d3e6c6b3..094986047194 100644
> --- a/drivers/watchdog/dw_wdt.c
> +++ b/drivers/watchdog/dw_wdt.c
> @@ -57,6 +57,9 @@ struct dw_wdt {
>   	unsigned long		rate;
>   	struct watchdog_device	wdd;
>   	struct reset_control	*rst;
> +	/* Save/restore */
> +	u32			control;
> +	u32			timeout;
>   };
>   
>   #define to_dw_wdt(wdd)	container_of(wdd, struct dw_wdt, wdd)
> @@ -204,6 +207,9 @@ static int dw_wdt_suspend(struct device *dev)
>   {
>   	struct dw_wdt *dw_wdt = dev_get_drvdata(dev);
>   
> +	dw_wdt->control = readl(dw_wdt->regs + WDOG_CONTROL_REG_OFFSET);
> +	dw_wdt->timeout = readl(dw_wdt->regs + WDOG_TIMEOUT_RANGE_REG_OFFSET);
> +
>   	clk_disable_unprepare(dw_wdt->clk);
>   
>   	return 0;
> @@ -217,6 +223,9 @@ static int dw_wdt_resume(struct device *dev)
>   	if (err)
>   		return err;
>   
> +	writel(dw_wdt->timeout, dw_wdt->regs + WDOG_TIMEOUT_RANGE_REG_OFFSET);
> +	writel(dw_wdt->control, dw_wdt->regs + WDOG_CONTROL_REG_OFFSET);
> +
>   	dw_wdt_ping(&dw_wdt->wdd);
>   
>   	return 0;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ