All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
To: Guenter Roeck <linux@roeck-us.net>,
	Wim Van Sebroeck <wim@linux-watchdog.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Magnus Damm <magnus.damm@gmail.com>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	"linux-renesas-soc@vger.kernel.org" 
	<linux-renesas-soc@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-watchdog@vger.kernel.org" <linux-watchdog@vger.kernel.org>,
	Chris Paterson <Chris.Paterson2@renesas.com>,
	Biju Das <biju.das@bp.renesas.com>,
	Fabrizio Castro <fabrizio.castro@bp.renesas.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Jacopo Mondi <jacopo@jmondi.org>
Subject: RE: [PATCH 1/3] watchdog: rzg2l_wdt: Fix reboot for RZ/V2M
Date: Tue, 9 May 2023 08:13:30 +0000	[thread overview]
Message-ID: <TYWPR01MB8775789B33D4A13660017290C2769@TYWPR01MB8775.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <7d3b2991-f755-42e5-87ca-727fd8fb9164@roeck-us.net>

Thanks Guenter.

Fab

> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> Subject: Re: [PATCH 1/3] watchdog: rzg2l_wdt: Fix reboot for RZ/V2M
> 
> On Sun, May 07, 2023 at 05:36:25PM +0200, Wim Van Sebroeck wrote:
> > Hi Fabrizio,
> >
> > Based on below e-mail I excluded this patch from the merge window.
> > I saw that Guenter still has it in his branch.
> 
> Thanks for the note. I'll drop it.
> 
> Guenter
> 
> > So can we have an update on this please?
> >
> > Thanks in advance,
> > Wim.
> >
> > > Hi Geert and Guenter,
> > >
> > > Thank you for your reviews!
> > >
> > > As it turns out, the rzg2l_wdt driver has some reset related
> issues
> > > (currently not addressed by the driver) for the RZ/V2M and RZ/Five
> > > SoCs. More specifically to this patch, there is a better way to
> fix
> > > the restart callback by addressing the way the reset is handled
> > > for the watchdog IP.
> > >
> > > I am dropping this patch, and I'll send out a series to address
> > > the above concerns (which will tackle the issues with the restart
> > > callback in a better way).
> > >
> > >
> > > Thanks,
> > > Fab
> > >
> > >
> > > > From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter
> Roeck
> > > > Sent: 15 November 2022 13:28
> > > > Subject: Re: [PATCH 1/3] watchdog: rzg2l_wdt: Fix reboot for
> RZ/V2M
> > > >
> > > > On Thu, Nov 03, 2022 at 10:39:54PM +0000, Fabrizio Castro wrote:
> > > > > The setting for the RZ/V2M watchdog cannot be changed once
> > > > > the watchdog has been enabled, unless the IP gets reset.
> > > > > The current implementation of the restart callback assumes
> > > > > that the watchdog is not enabled, but that's not always the
> > > > > case, and it leads to longer than necessary reboot times if
> > > > > the watchdog is already running.
> > > > >
> > > > > Always reset the RZ/V2M watchdog first, so that we can always
> > > > > restart quickly.
> > > > >
> > > > > Fixes: ec122fd94eeb ("watchdog: rzg2l_wdt: Add rzv2m support")
> > > > > Signed-off-by: Fabrizio Castro
> <fabrizio.castro.jz@renesas.com>
> > > >
> > > > Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> > > >
> > > > > ---
> > > > >  drivers/watchdog/rzg2l_wdt.c | 11 ++++++++---
> > > > >  1 file changed, 8 insertions(+), 3 deletions(-)
> > > > >
> > > > > diff --git a/drivers/watchdog/rzg2l_wdt.c
> b/drivers/watchdog/rzg2l_wdt.c
> > > > > index 974a4194a8fd..00438ceed17a 100644
> > > > > --- a/drivers/watchdog/rzg2l_wdt.c
> > > > > +++ b/drivers/watchdog/rzg2l_wdt.c
> > > > > @@ -145,10 +145,10 @@ static int rzg2l_wdt_restart(struct
> > > > watchdog_device *wdev,
> > > > >  {
> > > > >  	struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev);
> > > > >
> > > > > -	clk_prepare_enable(priv->pclk);
> > > > > -	clk_prepare_enable(priv->osc_clk);
> > > > > -
> > > > >  	if (priv->devtype == WDT_RZG2L) {
> > > > > +		clk_prepare_enable(priv->pclk);
> > > > > +		clk_prepare_enable(priv->osc_clk);
> > > > > +
> > > > >  		/* Generate Reset (WDTRSTB) Signal on parity error */
> > > > >  		rzg2l_wdt_write(priv, 0, PECR);
> > > > >
> > > > > @@ -157,6 +157,11 @@ static int rzg2l_wdt_restart(struct
> watchdog_device
> > > > *wdev,
> > > > >  	} else {
> > > > >  		/* RZ/V2M doesn't have parity error registers */
> > > > >
> > > > > +		reset_control_reset(priv->rstc);
> > > > > +
> > > > > +		clk_prepare_enable(priv->pclk);
> > > > > +		clk_prepare_enable(priv->osc_clk);
> > > > > +
> > > > >  		wdev->timeout = 0;
> > > > >
> > > > >  		/* Initialize time out */
> > > > > --
> > > > > 2.34.1
> > > > >

  reply	other threads:[~2023-05-09  8:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03 22:39 [PATCH 0/3] Add Watchdog support for RZ/V2M EVK v2 Fabrizio Castro
2022-11-03 22:39 ` [PATCH 1/3] watchdog: rzg2l_wdt: Fix reboot for RZ/V2M Fabrizio Castro
2022-11-14 13:59   ` Geert Uytterhoeven
2022-11-15 13:28   ` Guenter Roeck
2022-11-17 11:39     ` Fabrizio Castro
2023-05-07 15:36       ` Wim Van Sebroeck
2023-05-08 13:29         ` Guenter Roeck
2023-05-09  8:13           ` Fabrizio Castro [this message]
2023-05-09  8:12         ` Fabrizio Castro
2022-11-03 22:39 ` [PATCH 2/3] arm64: dts: renesas: r9a09g011: Add watchdog node Fabrizio Castro
2022-11-14 14:00   ` Geert Uytterhoeven
2022-11-03 22:39 ` [PATCH 3/3] arm64: dts: renesas: v2mevk2: Enable watchdog Fabrizio Castro
2022-11-14 14:02   ` Geert Uytterhoeven

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=TYWPR01MB8775789B33D4A13660017290C2769@TYWPR01MB8775.jpnprd01.prod.outlook.com \
    --to=fabrizio.castro.jz@renesas.com \
    --cc=Chris.Paterson2@renesas.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=biju.das@bp.renesas.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fabrizio.castro@bp.renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=jacopo@jmondi.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=magnus.damm@gmail.com \
    --cc=robh+dt@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.