linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ayyathurai, Vijayakannan" <vijayakannan.ayyathurai@intel.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: "wim@linux-watchdog.org" <wim@linux-watchdog.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"linux-watchdog@vger.kernel.org" <linux-watchdog@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"andriy.shevchenko@linux.intel.com" 
	<andriy.shevchenko@linux.intel.com>,
	"mgross@linux.intel.com" <mgross@linux.intel.com>,
	"Wan Mohamad,
	Wan Ahmad Zainie"  <wan.ahmad.zainie.wan.mohamad@intel.com>,
	"Raja Subramanian,
	Lakshmi Bai"  <lakshmi.bai.raja.subramanian@intel.com>
Subject: RE: [PATCH v3 1/2] watchdog: Add watchdog driver for Intel Keembay Soc
Date: Wed, 2 Dec 2020 14:55:32 +0000	[thread overview]
Message-ID: <DM6PR11MB425005AF05352338BE5403BEFBF30@DM6PR11MB4250.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20201201163044.GA89174@roeck-us.net>

Hi Guenter,

> From: Guenter Roeck <linux@roeck-us.net>
> Sent: Wednesday, 2 December, 2020 12:31 AM
> 
> On Tue, Dec 01, 2020 at 11:10:33PM +0800,
> vijayakannan.ayyathurai@intel.com wrote:
> > From: Vijayakannan Ayyathurai <vijayakannan.ayyathurai@intel.com>
> >
> > Intel Keembay Soc requires watchdog timer support.
> > Add watchdog driver to enable this.
> >
> > +static void keembay_wdt_set_timeout_reg(struct watchdog_device *wdog,
> bool ping)
> > +{
> > +	struct keembay_wdt *wdt = watchdog_get_drvdata(wdog);
> > +	u32 th_val = 0;
> > +
> > +	if (!ping && wdog->pretimeout) {
> > +		th_val = wdog->timeout - wdog->pretimeout;
> > +		keembay_wdt_writel(wdt, TIM_WATCHDOG_INT_THRES, th_val
> * wdt->rate);
> 
> Sorry for annoying you now, but I may have found another potential problem.
> 
> What happens if the user sets a pretimeout, then removes it ?
> What should TIM_WATCHDOG_INT_THRES be set to in that case ?
> Right now TIM_WATCHDOG_INT_THRES won't be updated anymore

It is a good catch. Indeed, I don't have coverage like this.

> in that case, which seems wrong. This might get worse with
> the following sequence.
> 
> - set pretimeout
> - clear pretimeout
> - set timeout to some other value
> 

Can the below method resolve this issue?


static int keembay_wdt_set_pretimeout(struct watchdog_device *wdog, u32 t)
{
        struct keembay_wdt *wdt = watchdog_get_drvdata(wdog);

        if(!t)
                keembay_wdt_writel(wdt, TIM_WATCHDOG_INT_THRES, 0);

        wdog->pretimeout = t;
        keembay_wdt_set_timeout_reg(wdog, false);

        return 0;
}

> Thanks,
> Guenter
> 

Thanks,
Vijay

  reply	other threads:[~2020-12-02 14:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01 15:10 [PATCH v3 0/2] Add drivers for Intel Keem Bay SoC watchdog vijayakannan.ayyathurai
2020-12-01 15:10 ` [PATCH v3 1/2] watchdog: Add watchdog driver for Intel Keembay Soc vijayakannan.ayyathurai
2020-12-01 16:30   ` Guenter Roeck
2020-12-02 14:55     ` Ayyathurai, Vijayakannan [this message]
2020-12-02 16:32       ` Guenter Roeck
2020-12-02 17:12         ` Ayyathurai, Vijayakannan
2020-12-01 15:10 ` [PATCH v3 2/2] dt-bindings: watchdog: Add bindings for Intel Keem Bay SoC vijayakannan.ayyathurai
2020-12-01 15:41   ` Ayyathurai, Vijayakannan
2020-12-07 18:23   ` Rob Herring
2020-12-08  2:21     ` Ayyathurai, Vijayakannan

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=DM6PR11MB425005AF05352338BE5403BEFBF30@DM6PR11MB4250.namprd11.prod.outlook.com \
    --to=vijayakannan.ayyathurai@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=lakshmi.bai.raja.subramanian@intel.com \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mgross@linux.intel.com \
    --cc=robh+dt@kernel.org \
    --cc=wan.ahmad.zainie.wan.mohamad@intel.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).