All of lore.kernel.org
 help / color / mirror / Atom feed
* Ques: [kernel/time/*] Is there any disadvantage in using usleep_range for more than 20ms delay ?
@ 2015-12-07 17:59 Aniroop Mathur
  2015-12-08  9:03 ` Clemens Ladisch
  0 siblings, 1 reply; 3+ messages in thread
From: Aniroop Mathur @ 2015-12-07 17:59 UTC (permalink / raw)
  To: John Stultz, Thomas Gleixner; +Cc: a.mathur, linux-kernel@vger.kernel.org

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 that if we use usleep_range for
inserting delays greater than 20 ms, would it be harmful or beneficial
or does not make any difference at all ?

Thanks in advance !

Regards,
Aniroop Mathur

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-12-08 19:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-07 17:59 Ques: [kernel/time/*] Is there any disadvantage in using usleep_range for more than 20ms delay ? Aniroop Mathur
2015-12-08  9:03 ` Clemens Ladisch
2015-12-08 19:21   ` Aniroop Mathur

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.