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] [day] [month] [year] [list]
Date:   Mon, 8 Aug 2022 08:46:58 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Henning Schild <henning.schild@...mens.com>,
        Wim Van Sebroeck <wim@...ux-watchdog.org>,
        linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] watchdog: w83627hf_wdt: add boostatus support

On 8/8/22 08:12, Henning Schild wrote:
> The status bit in the status and control register can tell us whether
> the last reboot was caused by the watchdog. Make sure to take that into
> the bootstatus before clearing it.
> 
> Signed-off-by: Henning Schild <henning.schild@...mens.com>\
Reviewed-by: Guenter Roeck <linux@...ck-us.net>

> ---
>   drivers/watchdog/w83627hf_wdt.c | 12 ++++++++++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c
> index 56a4a4030ca9..bc33b63c5a5d 100644
> --- a/drivers/watchdog/w83627hf_wdt.c
> +++ b/drivers/watchdog/w83627hf_wdt.c
> @@ -113,6 +113,10 @@ MODULE_PARM_DESC(early_disable, "Disable watchdog at boot time (default=0)");
>   #define W836X7HF_WDT_CSR	0xf7
>   #define NCT6102D_WDT_CSR	0xf2
>   
> +#define WDT_CSR_STATUS		0x10
> +#define WDT_CSR_KBD		0x40
> +#define WDT_CSR_MOUSE		0x80
> +
>   static void superio_outb(int reg, int val)
>   {
>   	outb(reg, WDT_EFER);
> @@ -244,8 +248,12 @@ static int w83627hf_init(struct watchdog_device *wdog, enum chips chip)
>   	t = superio_inb(cr_wdt_control) & ~0x0C;
>   	superio_outb(cr_wdt_control, t);
>   
> -	/* reset trigger, disable keyboard & mouse turning off watchdog */
> -	t = superio_inb(cr_wdt_csr) & ~0xD0;
> +	t = superio_inb(cr_wdt_csr);
> +	if (t & WDT_CSR_STATUS)
> +		wdog->bootstatus |= WDIOF_CARDRESET;
> +
> +	/* reset status, disable keyboard & mouse turning off watchdog */
> +	t &= ~(WDT_CSR_STATUS | WDT_CSR_KBD | WDT_CSR_MOUSE);
>   	superio_outb(cr_wdt_csr, t);
>   
>   	superio_exit();

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ