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 v2 1/2] watchdog: Add watchdog driver for Intel Keembay Soc
Date: Tue, 1 Dec 2020 06:19:09 +0000	[thread overview]
Message-ID: <DM6PR11MB4250802106A1795B78DF3C31FBF40@DM6PR11MB4250.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20201130220538.GA42581@roeck-us.net>

Hi Guenter,

> From: Guenter Roeck <linux@roeck-us.net>
> 
> On Wed, Nov 11, 2020 at 01:53:07AM +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)
> > +		keembay_wdt_writel(wdt, TIM_WATCHDOG, wdog->timeout *
> wdt->rate);
> > +
> > +	if (!ping && wdog->pretimeout) {
> > +		th_val = wdog->timeout - wdog->pretimeout;
> > +		keembay_wdt_writel(wdt, TIM_WATCHDOG_INT_THRES, th_val
> * wdt->rate);
> > +	}
> > +
> > +	if (!ping)
> > +		keembay_wdt_writel(wdt, TIM_WATCHDOG, wdog->timeout *
> wdt->rate);
> 
> I am a bit at loss here. This seems unnecessarily complex. Why not just the
> following ?
> 

Sure. I can follow the below way.
Let me know if there is further comments to improve for the next version.

> 	if (!ping && wdog->pretimeout) {
> 		th_val = wdog->timeout - wdog->pretimeout;
> 		keembay_wdt_writel(wdt, TIM_WATCHDOG_INT_THRES, th_val
> * wdt->rate);
> 	}
> 	keembay_wdt_writel(wdt, TIM_WATCHDOG, wdog->timeout * wdt-
> >rate);
> 
> Thanks,
> Guenter

Thanks,
Vijay

  reply	other threads:[~2020-12-01  6:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-10 17:53 [PATCH v2 0/2] Add drivers for Intel Keem Bay SoC watchdog vijayakannan.ayyathurai
2020-11-10 17:53 ` [PATCH v2 1/2] watchdog: Add watchdog driver for Intel Keembay Soc vijayakannan.ayyathurai
2020-11-30 22:05   ` Guenter Roeck
2020-12-01  6:19     ` Ayyathurai, Vijayakannan [this message]
2020-12-01 12:22       ` Guenter Roeck
2020-11-10 17:53 ` [PATCH v2 2/2] dt-bindings: watchdog: Add bindings for Intel Keem Bay SoC vijayakannan.ayyathurai
2020-11-11 20:03   ` Rob Herring
2020-11-12  3:10     ` Ayyathurai, Vijayakannan
2020-11-11  2:08 ` [PATCH v2 0/2] Add drivers for Intel Keem Bay SoC watchdog mark gross
2020-11-23  4:47 ` 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=DM6PR11MB4250802106A1795B78DF3C31FBF40@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).