linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	linux-watchdog@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Chris Paterson <Chris.Paterson2@renesas.com>,
	Biju Das <biju.das@bp.renesas.com>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v5 7/7] watchdog: rzg2l_wdt: Add set_timeout callback
Date: Fri, 25 Feb 2022 12:18:51 -0800	[thread overview]
Message-ID: <20220225201851.GD2900426@roeck-us.net> (raw)
In-Reply-To: <20220225175320.11041-8-biju.das.jz@bp.renesas.com>

On Fri, Feb 25, 2022 at 05:53:20PM +0000, Biju Das wrote:
> This patch adds support for set_timeout callback.
> 
> Once WDT is started, the WDT cycle setting register(WDTSET) can be updated
> only after issuing a module reset. Otherwise, it will ignore the writes
> and will hold the previous value. This patch updates the WDTSET register
> if it is active.
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

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

> ---
> V4->V5:
>  * Added Rb tag from Geert.
> V3->v4:
>  * Updated commit description
>  * Simplified the logic for updating timeout register, if wdt is active.
> v2->v3:
>  * Patch reodering Patch 3 -> patch 4
>  * Updated commit description.
> V1->V2:
>  * Updated commit description
>  * Removed stop/start and started using reset() instead.
>  * After reset, Start WDT based on watchdog timer state.
> ---
>  drivers/watchdog/rzg2l_wdt.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c
> index 4e7107655cc2..6eea0ee4af49 100644
> --- a/drivers/watchdog/rzg2l_wdt.c
> +++ b/drivers/watchdog/rzg2l_wdt.c
> @@ -115,6 +115,25 @@ static int rzg2l_wdt_stop(struct watchdog_device *wdev)
>  	return 0;
>  }
>  
> +static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned int timeout)
> +{
> +	struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev);
> +
> +	wdev->timeout = timeout;
> +
> +	/*
> +	 * If the watchdog is active, reset the module for updating the WDTSET
> +	 * register so that it is updated with new timeout values.
> +	 */
> +	if (watchdog_active(wdev)) {
> +		pm_runtime_put(wdev->parent);
> +		reset_control_reset(priv->rstc);
> +		rzg2l_wdt_start(wdev);
> +	}
> +
> +	return 0;
> +}
> +
>  static int rzg2l_wdt_restart(struct watchdog_device *wdev,
>  			     unsigned long action, void *data)
>  {
> @@ -151,6 +170,7 @@ static const struct watchdog_ops rzg2l_wdt_ops = {
>  	.start = rzg2l_wdt_start,
>  	.stop = rzg2l_wdt_stop,
>  	.ping = rzg2l_wdt_ping,
> +	.set_timeout = rzg2l_wdt_set_timeout,
>  	.restart = rzg2l_wdt_restart,
>  };
>  
> -- 
> 2.17.1
> 

  reply	other threads:[~2022-02-25 20:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-25 17:53 [PATCH v5 0/7] RZG2L_WDT Fixes and Improvements Biju Das
2022-02-25 17:53 ` [PATCH v5 1/7] watchdog: rzg2l_wdt: Fix 32bit overflow issue Biju Das
2022-02-25 17:53 ` [PATCH v5 2/7] watchdog: rzg2l_wdt: Fix Runtime PM usage Biju Das
2022-02-25 20:17   ` Guenter Roeck
2022-02-25 17:53 ` [PATCH v5 3/7] watchdog: rzg2l_wdt: Fix 'BUG: Invalid wait context' Biju Das
2022-02-25 20:18   ` Guenter Roeck
2022-02-25 17:53 ` [PATCH v5 4/7] watchdog: rzg2l_wdt: Fix reset control imbalance Biju Das
2022-03-01 11:20   ` Geert Uytterhoeven
2022-03-09 23:08   ` Guenter Roeck
2022-02-25 17:53 ` [PATCH v5 5/7] watchdog: rzg2l_wdt: Add error check for reset_control_deassert Biju Das
2022-02-26  9:15   ` Sergei Shtylyov
2022-02-28 14:36     ` Biju Das
2022-03-01 11:21   ` Geert Uytterhoeven
2022-03-09 23:09   ` Guenter Roeck
2022-02-25 17:53 ` [PATCH v5 6/7] watchdog: rzg2l_wdt: Use force reset for WDT reset Biju Das
2022-02-25 20:18   ` Guenter Roeck
2022-02-25 17:53 ` [PATCH v5 7/7] watchdog: rzg2l_wdt: Add set_timeout callback Biju Das
2022-02-25 20:18   ` Guenter Roeck [this message]
2022-03-07  8:52 ` [PATCH v5 0/7] RZG2L_WDT Fixes and Improvements Biju Das
2022-03-09 23:42   ` Guenter Roeck
2022-03-10  6:53     ` Biju Das

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=20220225201851.GD2900426@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=Chris.Paterson2@renesas.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=biju.das@bp.renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.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;
as well as URLs for NNTP newsgroup(s).