From: Guenter Roeck <linux@roeck-us.net>
To: Tero Kristo <t-kristo@ti.com>
Cc: wim@linux-watchdog.org, linux-watchdog@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] watchdog: add support for resetting keepalive timers at start
Date: Fri, 28 Feb 2020 09:13:14 -0800 [thread overview]
Message-ID: <20200228171314.GA14594@roeck-us.net> (raw)
In-Reply-To: <20200228142331.13716-3-t-kristo@ti.com>
On Fri, Feb 28, 2020 at 04:23:29PM +0200, Tero Kristo wrote:
> Current watchdog core pets the timer always after the initial keepalive
> time has expired from boot-up. This is incorrect for certain timers that
> don't like to be petted immediately when they are started, if they have
> not been running over the boot.
>
> To allow drivers to reset their keepalive timers during startup, add
> a new watchdog flag to the api, WDOG_RESET_KEEPALIVE.
>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
> drivers/watchdog/watchdog_dev.c | 2 ++
> include/linux/watchdog.h | 1 +
> 2 files changed, 3 insertions(+)
>
> diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
> index 8b5c742f24e8..131e40c21703 100644
> --- a/drivers/watchdog/watchdog_dev.c
> +++ b/drivers/watchdog/watchdog_dev.c
> @@ -283,6 +283,8 @@ static int watchdog_start(struct watchdog_device *wdd)
> set_bit(WDOG_ACTIVE, &wdd->status);
> wd_data->last_keepalive = started_at;
> watchdog_update_worker(wdd);
> + if (test_bit(WDOG_RESET_KEEPALIVE, &wdd->status))
> + wd_data->last_hw_keepalive = started_at;
I don't think the additional flag is needed. The code should just set
last_hw_keepalive. After all, it already sets last_keepalive, which
determines when the next internal keepalive will be sent. It makes sense
to also set last_hw_keepalive to prevent the next keepalive from being
sent too early.
Guenter
next prev parent reply other threads:[~2020-02-28 17:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-28 14:23 [PATCH 0/4] watchdog: add TI K3 SoC watchdog support Tero Kristo
2020-02-28 14:23 ` [PATCH 1/4] dt-bindings: watchdog: Add support for TI K3 RTI watchdog Tero Kristo
2020-02-28 14:23 ` [PATCH 2/4] watchdog: add support for resetting keepalive timers at start Tero Kristo
2020-02-28 17:13 ` Guenter Roeck [this message]
2020-03-02 13:09 ` Tero Kristo
2020-02-28 14:23 ` [PATCH 3/4] watchdog: Add K3 RTI watchdog support Tero Kristo
2020-02-28 17:45 ` Guenter Roeck
2020-03-02 13:07 ` Tero Kristo
2020-02-28 14:23 ` [PATCH 4/4] arm64: dts: ti: k3-j721e-main: Add MAIN domain watchdog entries Tero Kristo
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=20200228171314.GA14594@roeck-us.net \
--to=linux@roeck-us.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=t-kristo@ti.com \
--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