Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1582965 > unrolled thread

Re: [PATCH] Add explanation of udelay() inaccuracy

Started byPavel Machek <pavel@ucw.cz>
First post2017-02-16 23:00 +0100
Last post2017-02-16 23:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] Add explanation of udelay() inaccuracy Pavel Machek <pavel@ucw.cz> - 2017-02-16 23:00 +0100

#1582965 — Re: [PATCH] Add explanation of udelay() inaccuracy

FromPavel Machek <pavel@ucw.cz>
Date2017-02-16 23:00 +0100
SubjectRe: [PATCH] Add explanation of udelay() inaccuracy
Message-ID<tbCfL-3Pz-15@gated-at.bofh.it>
Hi!

> +++ b/include/linux/delay.h
> @@ -5,6 +5,17 @@
>   * Copyright (C) 1993 Linus Torvalds
>   *
>   * Delay routines, using a pre-computed "loops_per_jiffy" value.
> + *
> + * Please note that ndelay(), udelay() and mdelay() may return early for
> + * several reasons:
> + *  1. computed loops_per_jiffy too low (due to the time taken to
> + *     execute the timer interrupt.)
> + *  2. cache behaviour affecting the time it takes to execute the
> + *     loop function.
> + *  3. CPU clock rate changes.
> + *

Hmm. Formulated like this, it would mean that udelay(100) can return
in 10usec (because of clock rate changes). No way can drivers work
reliably in that case.

Can we formulate something more useful? We don't want driver writers
to delay 10 times more "just for cpufreq", right?

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web