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: <a3721fec-e035-39c9-ef30-7a9b71d9e02c@roeck-us.net>
Date:   Tue, 26 Jul 2022 06:33:57 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Pali Rohár <pali@...nel.org>,
        Marek Behún <kabel@...nel.org>,
        Wim Van Sebroeck <wim@...ux-watchdog.org>
Cc:     linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] watchdog: armada_37xx_wdt: Fix .set_timeout callback

On 7/26/22 01:56, Pali Rohár wrote:
> ioctl(WDIOC_SETTIMEOUT) calls .set_timeout and .ping callbacks and it is
> expected that it changes current watchdog timeout.
> 
> armada_37xx_wdt's .ping callback just reping counter 0 and does not touch
> counter 1 used for timeout. So it is needed to set counter 1 to the new
> value in .set_timeout callback to ensure ioctl(WDIOC_SETTIMEOUT)
> functionality. Fix it.
> 
> Fixes: 54e3d9b518c8 ("watchdog: Add support for Armada 37xx CPU watchdog")
> Signed-off-by: Pali Rohár <pali@...nel.org>

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

> ---
>   drivers/watchdog/armada_37xx_wdt.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/watchdog/armada_37xx_wdt.c b/drivers/watchdog/armada_37xx_wdt.c
> index 1635f421ef2c..b84cba94b135 100644
> --- a/drivers/watchdog/armada_37xx_wdt.c
> +++ b/drivers/watchdog/armada_37xx_wdt.c
> @@ -179,6 +179,8 @@ static int armada_37xx_wdt_set_timeout(struct watchdog_device *wdt,
>   	dev->timeout = (u64)dev->clk_rate * timeout;
>   	do_div(dev->timeout, CNTR_CTRL_PRESCALE_MIN);
>   
> +	set_counter_value(dev, CNTR_ID_WDOG, dev->timeout);
> +
>   	return 0;
>   }
>   

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ