mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Aniroop Mathur <aniroop.mathur@gmail.com>
Cc: clemens@ladisch.de, John Stultz <john.stultz@linaro.org>,
	a.mathur@samsung.com,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Ques: [kernel/time/*] Is there any disadvantage in using sleep_range for more than 20ms delay ?
Date: Tue, 8 Dec 2015 21:47:44 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.11.1512082140060.3595@nanos> (raw)
In-Reply-To: <CADYu3087CjQUbDM9kDMN7OYhMpzSK5-Zhky+r4k-d2ZEaqk6VA@mail.gmail.com>

On Tue, 8 Dec 2015, Aniroop Mathur wrote:
> On Tue, Dec 8, 2015 at 4:18 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > The initialization process is hardly something critical, so why would
> > the delay need to be precise? What's the point of having data 10ms
> > earlier?
> 
> As I know, the chip initialisation process is critical.
> Consider the case for an android mobile phone. When the phone is
> resumed from suspend state, all the earlier enabled devices need to
> be re-initialised.  Normally, we have two sleeps during device
> initialisation and we need to re-initialize more than 25 devices on
> board. So if single msleep delays by 10 ms, then the android phone
> resume is delayed by 10*2*25 = 500 ms, which is quite a big time.
>
> Also more importantly, during booting the phone as well, if every
> device sleeps for extra 20 ms and we have to probe 25 devices,
> booting is delayed by 500 ms.

You are optimizing for something which is simply stupid. WHY do you
need to (re)initialize all devices before you can do something useful?

Just because Android is implemented that way? That's silly.

If you really care about boot time / user experience you initialize
only the really important drivers in the boot/resume process and
initialize the reset in the background. It does not matter whether the
temperatur app shows the updated value one second later or not, but it
matters for the user that the GUI is functional.
 
> My point is to use single consistent sleep api in driver code
> instead of two as we need to use it many places in a single driver
> code. This way, the code looks better.

It's not about better. It's about using the right interfaces for the
right job. usleep_range() and msleep() use different facilities. As I
explained before: If you need a precise limit, use usleep_range(). If
not use msleep().
 
Thanks,

	tglx

  reply	other threads:[~2015-12-08 20:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-07 17:50 Aniroop Mathur
2015-12-07 18:37 ` Thomas Gleixner
2015-12-08  2:45   ` Aniroop Mathur
2015-12-08 10:48     ` Thomas Gleixner
2015-12-08 15:35       ` Aniroop Mathur
2015-12-08 20:47         ` Thomas Gleixner [this message]
2015-12-09 16:14           ` Aniroop Mathur
     [not found]             ` <CADYu309kcmtmZTSbnZ-o7TXjVYReg-QqOE+5bgsGqvPASMa4Zg@mail.gmail.com>
     [not found]               ` <566D3EC0.50408@ladisch.de>
2015-12-14 19:06                 ` Aniroop Mathur
2015-12-14 19:53                   ` Thomas Gleixner
2015-12-21 17:22                     ` Aniroop Mathur
2015-12-09  8:57 Aniroop Mathur

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=alpine.DEB.2.11.1512082140060.3595@nanos \
    --to=tglx@linutronix.de \
    --cc=a.mathur@samsung.com \
    --cc=aniroop.mathur@gmail.com \
    --cc=clemens@ladisch.de \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®