linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: "Alice Guo (OSS)" <alice.guo@oss.nxp.com>
Cc: "wim@linux-watchdog.org" <wim@linux-watchdog.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	dl-linux-imx <linux-imx@nxp.com>,
	"linux-watchdog@vger.kernel.org" <linux-watchdog@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/7] watchdog: imx7ulp_wdt: Fix RCS timeout issue
Date: Tue, 23 Aug 2022 05:06:56 -0700	[thread overview]
Message-ID: <20220823120656.GC203169@roeck-us.net> (raw)
In-Reply-To: <AM6PR04MB60533A1ABDFA1DEDE59BB847E2709@AM6PR04MB6053.eurprd04.prod.outlook.com>

On Tue, Aug 23, 2022 at 05:59:11AM +0000, Alice Guo (OSS) wrote:
> 
> 
> > -----Original Message-----
> > From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> > Sent: Monday, August 22, 2022 10:10 PM
> > To: Alice Guo (OSS) <alice.guo@oss.nxp.com>
> > Cc: wim@linux-watchdog.org; shawnguo@kernel.org;
> > s.hauer@pengutronix.de; festevam@gmail.com; kernel@pengutronix.de;
> > dl-linux-imx <linux-imx@nxp.com>; linux-watchdog@vger.kernel.org;
> > linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> > Subject: Re: [PATCH 4/7] watchdog: imx7ulp_wdt: Fix RCS timeout issue
> > 
> > On Tue, Aug 16, 2022 at 12:36:40PM +0800, Alice Guo (OSS) wrote:
> > > From: Ye Li <ye.li@nxp.com>
> > >
> > > According to measure on i.MX7ULP and i.MX8ULP, the RCS done needs
> > > about 3400us and 6700us respectively. So current 20us timeout is not
> > > enough. When reconfiguring is on-going, unlock and configure CS will
> > > lead to unknown result.
> > >
> > > Increase the wait timeout value to 10ms and check the return value of
> > > RCS wait to fix the issue
> > >
> > 
> > You'll have to find a better solution. An active (non-sleep) wait of
> > 10 ms is unacceptable.
> > 
> > Guenter
> 
> Hi Guenter,
> 
> Sorry. I think this patch should be merged with " watchdog: imx7ulp_wdt: Handle wdog reconfigure failure", but I didn't merge them. I will send v2.
> 

That doesn't change the fact that a 10 ms hot wait is unacceptable.

Thanks,
Guenter

> Best Regards,
> Alice Guo
> 
> > > Signed-off-by: Ye Li <ye.li@nxp.com>
> > > Signed-off-by: Alice Guo <alice.guo@nxp.com>
> > > Reviewed-by: Jacky Bai <ping.bai@nxp.com>
> > > Acked-by: Jason Liu <jason.hui.liu@nxp.com>
> > > ---
> > >  drivers/watchdog/imx7ulp_wdt.c | 8 +++++---
> > >  1 file changed, 5 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/watchdog/imx7ulp_wdt.c
> > > b/drivers/watchdog/imx7ulp_wdt.c index a0f6b8cea78f..12715c248688
> > > 100644
> > > --- a/drivers/watchdog/imx7ulp_wdt.c
> > > +++ b/drivers/watchdog/imx7ulp_wdt.c
> > > @@ -39,7 +39,7 @@
> > >  #define DEFAULT_TIMEOUT	60
> > >  #define MAX_TIMEOUT	128
> > >  #define WDOG_CLOCK_RATE	1000
> > > -#define WDOG_WAIT_TIMEOUT	20
> > > +#define WDOG_WAIT_TIMEOUT	10000
> > >
> > >  static bool nowayout = WATCHDOG_NOWAYOUT;
> > module_param(nowayout,
> > > bool, 0000); @@ -80,7 +80,7 @@ static int imx7ulp_wdt_enable(struct
> > > watchdog_device *wdog, bool enable)
> > >  		writel(val | WDOG_CS_EN, wdt->base + WDOG_CS);
> > >  	else
> > >  		writel(val & ~WDOG_CS_EN, wdt->base + WDOG_CS);
> > > -	imx7ulp_wdt_wait(wdt->base, WDOG_CS_RCS);
> > > +	ret = imx7ulp_wdt_wait(wdt->base, WDOG_CS_RCS);
> > >
> > >  enable_out:
> > >  	local_irq_enable();
> > > @@ -127,7 +127,9 @@ static int imx7ulp_wdt_set_timeout(struct
> > watchdog_device *wdog,
> > >  	if (ret)
> > >  		goto timeout_out;
> > >  	writel(val, wdt->base + WDOG_TOVAL);
> > > -	imx7ulp_wdt_wait(wdt->base, WDOG_CS_RCS);
> > > +	ret = imx7ulp_wdt_wait(wdt->base, WDOG_CS_RCS);
> > > +	if (ret)
> > > +		goto timeout_out;
> > >
> > >  	wdog->timeout = timeout;
> > >
> > > --
> > > 2.17.1
> > >

  reply	other threads:[~2022-08-23 14:47 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16  4:36 [PATCH 0/7] watchdog: imx7ulp_wdt: update i.MX7ULP WDOG timer driver Alice Guo (OSS)
2022-08-16  4:36 ` [PATCH 1/7] watchdog: imx7ulp: Move suspend/resume to noirq phase Alice Guo (OSS)
2022-08-16  4:36 ` [PATCH 2/7] watchdog: imx7ulp: Add explict memory barrier for unlock sequence Alice Guo (OSS)
2022-08-16  6:23   ` Marco Felsch
2022-08-22  7:49     ` Alice Guo (OSS)
2022-08-22  8:00       ` Marco Felsch
2022-08-22 14:03         ` Guenter Roeck
2022-08-23  5:38           ` Alice Guo (OSS)
2022-08-23  9:10             ` Marco Felsch
2022-08-23 12:02               ` Guenter Roeck
2022-08-24  6:24                 ` Alice Guo (OSS)
2022-08-24  8:03                   ` Marco Felsch
2022-08-24  8:40                     ` Alice Guo (OSS)
2022-08-24  9:06                       ` Marco Felsch
2022-08-24 10:05                         ` Alice Guo (OSS)
2022-08-25  7:50                           ` Marco Felsch
2022-08-25  8:08                             ` Alice Guo (OSS)
2022-08-25  9:01                               ` Marco Felsch
2022-08-25 10:11                                 ` Alice Guo (OSS)
2022-08-16  4:36 ` [PATCH 3/7] watchdog: imx7ulp_wdt: Check CMD32EN in wdog init Alice Guo (OSS)
2022-08-22 14:05   ` Guenter Roeck
2022-08-23  5:46     ` Alice Guo (OSS)
2022-08-23 12:05       ` Guenter Roeck
2022-08-16  4:36 ` [PATCH 4/7] watchdog: imx7ulp_wdt: Fix RCS timeout issue Alice Guo (OSS)
2022-08-22 14:09   ` Guenter Roeck
2022-08-23  5:59     ` Alice Guo (OSS)
2022-08-23 12:06       ` Guenter Roeck [this message]
2022-08-24  6:44         ` Alice Guo (OSS)
2022-08-16  4:36 ` [PATCH 5/7] watchdog: imx7ulp_wdt: Handle wdog reconfigure failure Alice Guo (OSS)
2022-08-16  4:36 ` [PATCH 6/7] watchdog: imx7ulp_wdt: init wdog when it was active Alice Guo (OSS)
2022-08-16  4:36 ` [PATCH 7/7] watchdog: imx93: add watchdog timer on imx93 Alice Guo (OSS)

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=20220823120656.GC203169@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=alice.guo@oss.nxp.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@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;
as well as URLs for NNTP newsgroup(s).