All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aniroop Mathur <aniroop.mathur@gmail.com>
To: John Stultz <john.stultz@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: a.mathur@samsung.com,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Ques: [kernel/time/*] Is there any disadvantage in using sleep_range for more than 20ms delay ?
Date: Mon, 7 Dec 2015 23:20:08 +0530	[thread overview]
Message-ID: <CADYu30-ZfRR5N7L6Azu5AwNRibnKViDN2dHrHeKbhdKAFvLW=w@mail.gmail.com> (raw)

Dear Mr. John and Mr. Thomas,
Greetings of the day !!

This is Aniroop Mathur working on sensor kernel drivers for last 3 years.
Recently, In my driver code, I have been changing msleep to usleep_range.
But I got stuck at one point and could not find proper answer on internet.
Could you please help to answer my query as mentioned below ?

>From the kernel documentation, I understood that it is better to use
usleep_range
for 10 us - 20 ms delay. For delays 10ms+, it is mentioned to use msleep.

If my understanding is right and considering HZ=100,
Even for 33 ms delay, msleep would sleep for 40 ms, while usleep_range
would sleep for 33 ms as desired.
And for 40 ms delay, msleep and usleep_range both will wake up at desired time.
Right ?

As in the kernel documentation, it is mentioned to use msleep for
10ms+ delay, I am confused whether there would be any disadvantage in
using usleep_range for higher delays values because normally drivers
have variety of delays used (2, 10, 20, 40, 100, 500 ms).

So, could you please help to confirm if there could be some problem in
using usleep_range for higher delay values ?

Thanks in advance !

Regards,
Aniroop Mathur

             reply	other threads:[~2015-12-07 17:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-07 17:50 Aniroop Mathur [this message]
2015-12-07 18:37 ` Ques: [kernel/time/*] Is there any disadvantage in using sleep_range for more than 20ms delay ? 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
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='CADYu30-ZfRR5N7L6Azu5AwNRibnKViDN2dHrHeKbhdKAFvLW=w@mail.gmail.com' \
    --to=aniroop.mathur@gmail.com \
    --cc=a.mathur@samsung.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.