public inbox for cip-dev@lists.cip-project.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@denx.de>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: cip-dev@lists.cip-project.org,
	Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>,
	Pavel Machek <pavel@denx.de>,
	Chris Paterson <chris.paterson2@renesas.com>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: Re: [PATCH RESEND 5.10.y-cip 13/13] watchdog: rzg2l_wdt: Add set_timeout callback
Date: Sat, 16 Jul 2022 13:13:53 +0200	[thread overview]
Message-ID: <20220716110434.GC18467@duo.ucw.cz> (raw)
In-Reply-To: <20220715073916.2321319-14-biju.das.jz@bp.renesas.com>

[-- Attachment #1: Type: text/plain, Size: 1344 bytes --]

Hi!

> commit 4055ee81009e606e830af1acd9e2e35a36249713 upstream.
> 
> 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.


> +++ 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.
> +	 */

values->value?

> +	if (watchdog_active(wdev)) {
> +		pm_runtime_put(wdev->parent);
> +		reset_control_reset(priv->rstc);
> +		rzg2l_wdt_start(wdev);
> +	}

This code is quite tricky. AFAICT it is correct, but calling
rzg2l_wdt_stop() instead would make it more readable.

Best regards,
								Pavel
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2022-07-16 11:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15  7:39 [PATCH RESEND 5.10.y-cip 00/13] Add thermal driver and watchdog driver enhancements Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 01/13] kernel.h: split out mathematical helpers Biju Das
2022-07-16  9:08   ` Pavel Machek
2022-07-16 14:16     ` Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 02/13] units: Add SI metric prefix definitions Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 03/13] thermal/drivers: Add TSU driver for RZ/G2L Biju Das
2022-07-16 10:53   ` [cip-dev] " Pavel Machek
2022-07-16 14:36     ` Biju Das
2022-07-18  5:44       ` Biju Das
2022-07-18  8:55         ` Pavel Machek
2022-07-18  9:01           ` Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 04/13] thermal/drivers/rz2gl: Add error check for reset_control_deassert() Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 05/13] thermal/drivers/rz2gl: Fix OTP Calibration Register values Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 06/13] arm64: defconfig: Enable additional support for Renesas platforms Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 07/13] watchdog: rzg2l_wdt: Fix 32bit overflow issue Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 08/13] watchdog: rzg2l_wdt: Fix Runtime PM usage Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 09/13] watchdog: rzg2l_wdt: Fix 'BUG: Invalid wait context' Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 10/13] watchdog: rzg2l_wdt: Fix reset control imbalance Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 11/13] watchdog: rzg2l_wdt: Add error check for reset_control_deassert Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 12/13] watchdog: rzg2l_wdt: Use force reset for WDT reset Biju Das
2022-07-15  7:39 ` [PATCH RESEND 5.10.y-cip 13/13] watchdog: rzg2l_wdt: Add set_timeout callback Biju Das
2022-07-16 11:13   ` Pavel Machek [this message]
2022-07-16 14:24     ` Biju Das
2022-07-15  7:46 ` [PATCH RESEND 5.10.y-cip 00/13] Add thermal driver and watchdog driver enhancements Biju Das
2022-07-15  9:28   ` nobuhiro1.iwamatsu

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=20220716110434.GC18467@duo.ucw.cz \
    --to=pavel@denx.de \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=chris.paterson2@renesas.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    /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