devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
To: Baoyou Xie <baoyou.xie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Mathieu Poirier
	<mathieu.poirier-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Jun Nie <jun.nie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	wim-IQzOog9fTRqzQB+pC5nmwQ@public.gmane.org,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	linux-arm Mailing List
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Shawn Guo <shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"xie.baoyou" <xie.baoyou-Th6q7B73Y6EnDS1+zs4M5A@public.gmane.org>,
	chen.chaokai-Th6q7B73Y6EnDS1+zs4M5A@public.gmane.org,
	wang.qiang01-Th6q7B73Y6EnDS1+zs4M5A@public.gmane.org
Subject: Re: [PATCH v6 3/3] watchdog: zx2967: add watchdog controller driver for ZTE's zx2967 family
Date: Mon, 30 Jan 2017 08:53:59 -0800	[thread overview]
Message-ID: <20170130165359.GA20288@roeck-us.net> (raw)
In-Reply-To: <CA+DQWkyPtndGEz-QYvmKaXoGNKQ69Zqu-aG7tCKnT-Mrmx5Wsw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Fri, Jan 27, 2017 at 10:40:09AM +0800, Baoyou Xie wrote:
> On 27 January 2017 at 00:17, Mathieu Poirier <mathieu.poirier-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> wrote:
> 
> > On Thu, Jan 26, 2017 at 09:32:56AM +0800, Baoyou Xie wrote:
> > > On 26 January 2017 at 00:23, Mathieu Poirier <mathieu.poirier-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
> > >
> > > wrote:
> > >
> > > > On Wed, Jan 25, 2017 at 10:44:49AM +0800, Baoyou Xie wrote:
> > > > > This patch adds watchdog controller driver for ZTE's zx2967 family.
> > > > >
> > > > > Signed-off-by: Baoyou Xie <baoyou.xie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> > > > > ---
[ ... ]
> > > > > +     reset_control_assert(rstc);
> > > > > +     usleep_range(500, 20000);
> > > >
> > > > Alright, I'm officially confused.
> > > >
> > > > First and foremost you still haven't provided an explanation as to why
> > > > this is
> > > > required.  Second, in your previous submission you had:
> > > >
> > > >         mdelay(10);
> > > >
> > > > That is a busy loop of 10ms.  In this post using usleep_range() is a
> > step
> > > > in the
> > > > right direction but the min and max values to wait for don't make
> > sense.
> > > > Here
> > > > you have 500 and 20000, which is 0.5ms and 20ms.
> > > >
> > > > In fact, sleeping for 0.5ms is enough.
> > > we extended the sleeping time to 20ms, the purpose is merging the timer
> > > interrupts. of course, it's happy to replace it with usleep_range(500,
> > > 1000).
> >
> > "merging the timer interrupts" - you mean trying to get the WD tick to be
> > closer
> > to other timers?  If so I really don't see why.  Timers are asynchronous by
> > nature and there can be dozens of them enabled at any given time.
> >
> > Really?
> Even if the system runs asynchronously, early process may trigger delayed
> process, for example delayed work queue or timers, we can merge our
> watchdog timer and those delayed work's timers.
> 
In the probe function ?

> Furthermore, what happen if we build this driver as module?
> 
If every driver writer would use that line of argument, booting would
take much longer than necessary, with every process sitting on unnecessary
wait or sleep calls for perceived "optimization" purposes. Probe functions
run exactly once, and should be time optimized. You should have an idea
what the minimum reset hold time is, and follow it.

> But, as i said early, it's a trial optimization but can be instead with
> usleep_range(500, 1000).
> 
> In some case, such optimization is helpful. I'd like to talk a story here,
> about before ten years, I pressed a return key in console, you know, in
> this case, a process be created and exited, so the cpu core that process
> run at sent an IPI to other CPU, IPI interrupt resulted in the performance
> decreased by 20%, so sad:)
> 
It appears to be somewhat unlikely that each keypress resulted in a driver
being instantiated. If it did, a sleep in its probe function was the least
of your problems.

> Unless there is a H/W constraint requiring a delay between the
> > assert/deassert
> > of the WD, I don't think adding a wait operation (of any kind) make sense.

Correct.

Guenter
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-01-30 16:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25  2:44 [PATCH v6 1/3] dt: bindings: add documentation for zx2967 family watchdog controller Baoyou Xie
     [not found] ` <1485312289-18354-1-git-send-email-baoyou.xie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-01-25  2:44   ` [PATCH v6 2/3] MAINTAINERS: add zx2967 watchdog controller driver to ARM ZTE architecture Baoyou Xie
2017-01-25  2:44   ` [PATCH v6 3/3] watchdog: zx2967: add watchdog controller driver for ZTE's zx2967 family Baoyou Xie
2017-01-25 16:23     ` Mathieu Poirier
2017-01-26  1:32       ` Baoyou Xie
     [not found]         ` <CA+DQWkxpcHqVfDSGuUK-i4DOVXsYEYo60MG5y_oBDNp+ykEdLQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-26 16:17           ` Mathieu Poirier
2017-01-27  2:40             ` Baoyou Xie
     [not found]               ` <CA+DQWkyPtndGEz-QYvmKaXoGNKQ69Zqu-aG7tCKnT-Mrmx5Wsw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-30 16:53                 ` Guenter Roeck [this message]
2017-02-01  3:29                   ` Baoyou Xie

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=20170130165359.GA20288@roeck-us.net \
    --to=linux-0h96xk9xttrk1umjsbkqmq@public.gmane.org \
    --cc=baoyou.xie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=chen.chaokai-Th6q7B73Y6EnDS1+zs4M5A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=jun.nie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=mathieu.poirier-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=wang.qiang01-Th6q7B73Y6EnDS1+zs4M5A@public.gmane.org \
    --cc=wim-IQzOog9fTRqzQB+pC5nmwQ@public.gmane.org \
    --cc=xie.baoyou-Th6q7B73Y6EnDS1+zs4M5A@public.gmane.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).