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: <cf2f151a-06d7-368e-7ae5-68e992dfc3ea@roeck-us.net>
Date:   Wed, 2 May 2018 06:21:57 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Jongsung Kim <neidhard.kim@....com>,
        Wim Van Sebroeck <wim@...ux-watchdog.org>,
        linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     Chanho Min <chanho.min@....com>
Subject: Re: [PATCH v2] watchdog: sp805: add restart handler

On 05/02/2018 12:59 AM, Jongsung Kim wrote:
> Add restart handler for SP805 watchdog so that the driver can be
> used to reboot the system.
> 
> Signed-off-by: Jongsung Kim <neidhard.kim@....com>
> Cc: Guenter Roeck <linux@...ck-us.net>
> ---
>   drivers/watchdog/sp805_wdt.c | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
> index 03805bc..969369e 100644
> --- a/drivers/watchdog/sp805_wdt.c
> +++ b/drivers/watchdog/sp805_wdt.c
> @@ -121,6 +121,18 @@ static unsigned int wdt_timeleft(struct watchdog_device *wdd)
>   	return div_u64(load, rate);
>   }
>   
> +static int
> +wdt_restart(struct watchdog_device *wdd, unsigned long mode, void *cmd)
> +{
> +	struct sp805_wdt *wdt = watchdog_get_drvdata(wdd);
> +
> +	writel_relaxed(0, wdt->base + WDTCONTROL);
> +	writel_relaxed(0, wdt->base + WDTLOAD);
> +	writel_relaxed(INT_ENABLE | RESET_ENABLE, wdt->base + WDTCONTROL);
> +
> +	return 0;
> +}
> +
>   static int wdt_config(struct watchdog_device *wdd, bool ping)
>   {
>   	struct sp805_wdt *wdt = watchdog_get_drvdata(wdd);
> @@ -197,6 +209,7 @@ static const struct watchdog_ops wdt_ops = {
>   	.ping		= wdt_ping,
>   	.set_timeout	= wdt_setload,
>   	.get_timeleft	= wdt_timeleft,
> +	.restart	= wdt_restart,
>   };
>   
>   static int
> 
Please add the restart priority

	watchdog_set_restart_priority(&wdt->wdd, 128);

before registering the watchdog.

Thanks,
Guenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ