From: Guenter Roeck <linux@roeck-us.net>
To: "Pali Rohár" <pali@kernel.org>, "Marek Behún" <kabel@kernel.org>,
"Wim Van Sebroeck" <wim@linux-watchdog.org>
Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: armada_37xx_wdt: Fix .set_timeout callback
Date: Tue, 26 Jul 2022 06:33:57 -0700 [thread overview]
Message-ID: <a3721fec-e035-39c9-ef30-7a9b71d9e02c@roeck-us.net> (raw)
In-Reply-To: <20220726085612.10672-1-pali@kernel.org>
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@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-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;
> }
>
next prev parent reply other threads:[~2022-07-26 13:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-26 8:56 [PATCH] watchdog: armada_37xx_wdt: Fix .set_timeout callback Pali Rohár
2022-07-26 13:33 ` Guenter Roeck [this message]
2022-07-26 13:45 ` Marek Behún
2022-09-24 10:51 ` Pali Rohár
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a3721fec-e035-39c9-ef30-7a9b71d9e02c@roeck-us.net \
--to=linux@roeck-us.net \
--cc=kabel@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=pali@kernel.org \
--cc=wim@linux-watchdog.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).