From: Guenter Roeck <linux@roeck-us.net>
To: Bharat Bhushan <bbhushan2@marvell.com>
Cc: wim@linux-watchdog.org, inux@roeck-us.net,
linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] drivers: watchdog: marvell_gti: fix zero pretimeout handling
Date: Wed, 11 Oct 2023 07:51:04 -0700 [thread overview]
Message-ID: <2842d7d6-2bc8-4ee6-8817-789ab7f20eec@roeck-us.net> (raw)
In-Reply-To: <20231009044037.514570-1-bbhushan2@marvell.com>
On Mon, Oct 09, 2023 at 10:10:36AM +0530, Bharat Bhushan wrote:
> When pretimeout is set to 0 then do not reprogram timer
> with zero timeout, this will reset device immediately.
> Also disable interrupt to stop pretimeout notification.
>
> Signed-off-by: Bharat Bhushan <bbhushan2@marvell.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/marvell_gti_wdt.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/watchdog/marvell_gti_wdt.c b/drivers/watchdog/marvell_gti_wdt.c
> index d7eb8286e11e..25b7ce0f0738 100644
> --- a/drivers/watchdog/marvell_gti_wdt.c
> +++ b/drivers/watchdog/marvell_gti_wdt.c
> @@ -190,6 +190,13 @@ static int gti_wdt_set_pretimeout(struct watchdog_device *wdev,
> struct gti_wdt_priv *priv = watchdog_get_drvdata(wdev);
> struct watchdog_device *wdog_dev = &priv->wdev;
>
> + if (!timeout) {
> + /* Disable Interrupt */
> + writeq(GTI_CWD_INT_ENA_CLR_VAL(priv->wdt_timer_idx),
> + priv->base + GTI_CWD_INT_ENA_CLR);
> + return 0;
> + }
> +
> /* pretimeout should 1/3 of max_timeout */
> if (timeout * 3 <= wdog_dev->max_timeout)
> return gti_wdt_settimeout(wdev, timeout * 3);
> --
> 2.34.1
>
prev parent reply other threads:[~2023-10-11 14:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-09 4:40 Bharat Bhushan
2023-10-09 4:40 ` [PATCH 2/2] drivers: watchdog: marvell_gti: Program the max_hw_heartbeat_ms Bharat Bhushan
2023-10-11 14:51 ` Guenter Roeck
2023-10-11 14:51 ` Guenter Roeck [this message]
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=2842d7d6-2bc8-4ee6-8817-789ab7f20eec@roeck-us.net \
--to=linux@roeck-us.net \
--cc=bbhushan2@marvell.com \
--cc=inux@roeck-us.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.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
all inboxes | Powered by JetHome®