linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: "Ayyathurai, Vijayakannan" <vijayakannan.ayyathurai@intel.com>
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 04:22:28 -0800	[thread overview]
Message-ID: <20201201122228.GA50515@roeck-us.net> (raw)
In-Reply-To: <DM6PR11MB4250802106A1795B78DF3C31FBF40@DM6PR11MB4250.namprd11.prod.outlook.com>

On Tue, Dec 01, 2020 at 06:19:09AM +0000, Ayyathurai, Vijayakannan wrote:
> 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.
> 
No, that was all. Driver looks good otherwise.

Guenter

> > 	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 12:23 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
2020-12-01 12:22       ` Guenter Roeck [this message]
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=20201201122228.GA50515@roeck-us.net \
    --to=linux@roeck-us.net \
    --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=mgross@linux.intel.com \
    --cc=robh+dt@kernel.org \
    --cc=vijayakannan.ayyathurai@intel.com \
    --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).