[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <OS0PR01MB5922DDCE24ED6F6DD44B4B3F86059@OS0PR01MB5922.jpnprd01.prod.outlook.com>
Date: Mon, 14 Nov 2022 18:42:18 +0000
From: Biju Das <biju.das.jz@...renesas.com>
To: Prabhakar <prabhakar.csengg@...il.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Wim Van Sebroeck <wim@...ux-watchdog.org>,
Guenter Roeck <linux@...ck-us.net>,
Philipp Zabel <p.zabel@...gutronix.de>,
"linux-watchdog@...r.kernel.org" <linux-watchdog@...r.kernel.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-renesas-soc@...r.kernel.org"
<linux-renesas-soc@...r.kernel.org>,
Fabrizio Castro <fabrizio.castro.jz@...esas.com>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@...renesas.com>
Subject: RE: [PATCH] watchdog: rzg2l_wdt: Issue a reset before we put the PM
clocks
> -----Original Message-----
> From: Prabhakar <prabhakar.csengg@...il.com>
> Sent: 14 November 2022 18:09
> To: Geert Uytterhoeven <geert+renesas@...der.be>; Wim Van Sebroeck
> <wim@...ux-watchdog.org>; Guenter Roeck <linux@...ck-us.net>; Philipp Zabel
> <p.zabel@...gutronix.de>; linux-watchdog@...r.kernel.org
> Cc: linux-kernel@...r.kernel.org; linux-renesas-soc@...r.kernel.org;
> Prabhakar <prabhakar.csengg@...il.com>; Biju Das
> <biju.das.jz@...renesas.com>; Fabrizio Castro
> <fabrizio.castro.jz@...esas.com>; Prabhakar Mahadev Lad <prabhakar.mahadev-
> lad.rj@...renesas.com>
> Subject: [PATCH] watchdog: rzg2l_wdt: Issue a reset before we put the PM
> clocks
>
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
>
> On RZ/Five SoC it was observed that setting timeout (to say 1 sec) wouldn't
> reset the system. To fix this we make sure we issue a reset before putting
> the PM clocks to make sure the registers have been cleared.
>
> While at it re-used rzg2l_wdt_stop() in rzg2l_wdt_set_timeout() as we were
> calling the same functions here.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
> ---
> Note,
> - This patch has been tested on RZ/G2L, RZ/V2M and RZ/Five.
> - My initial investigation showed adding the delay after
> pm_runtime_get_sync()
> also fixed this issue.
> - Do I need add the fixes tag ? what should be the operation PUT-
> >RESET/RESET->PUT?
It looks like timing issue, None of the previous devices are affected by this.
> in case we need the tag is:
> Fixes: 4055ee81009e6 ("watchdog: rzg2l_wdt: Add set_timeout callback")
> ---
> drivers/watchdog/rzg2l_wdt.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c
> index 00438ceed17a..d1271cc7750f 100644
> --- a/drivers/watchdog/rzg2l_wdt.c
> +++ b/drivers/watchdog/rzg2l_wdt.c
> @@ -115,16 +115,14 @@ static int rzg2l_wdt_stop(struct watchdog_device *wdev)
> {
> struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev);
>
> - pm_runtime_put(wdev->parent);
> reset_control_reset(priv->rstc);
> + pm_runtime_put(wdev->parent);
>
> 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;
>
> /*
> @@ -132,8 +130,7 @@ static int rzg2l_wdt_set_timeout(struct watchdog_device
> *wdev, unsigned int time
> * register so that it is updated with new timeout values.
> */
Maybe update the comment above with new code change.
Cheers,
Biju
> if (watchdog_active(wdev)) {
> - pm_runtime_put(wdev->parent);
> - reset_control_reset(priv->rstc);
> + rzg2l_wdt_stop(wdev);
> rzg2l_wdt_start(wdev);
> }
>
> --
> 2.25.1
Powered by blists - more mailing lists