Re: Exporting calibrate_delay()

From: Philipp Rumpf (prumpf@parcelfarce.linux.theplanet.co.uk)
Date: Sat Aug 26 2000 - 09:51:52 EST


On Fri, Aug 25, 2000 at 06:25:51PM +0100, Russell King wrote:
> No, I'd prefer to keep the things that can reasonably be kept generic without
> too much pain generic, and for that you can adjust the "loops_per_sec" (or
> a derived variable that udelay can use) to compensate for clock speed
> variations.

Should work fine, except for broken drivers which do:

my_delay = loops_per_sec / 10000000 + 1;

sleep;

__delay(my_delay);

shouldn't be an issue though. If you make sure you're not losing too much
precision (basically round loops_per_sec to a suitable boundary or keep the
original value around), I don't see any real problems.

> After all, if you know you've halved the clock speed, you have to double
> loops_per_sec.

halve loops_per_sec, of course.

        Philipp Rumpf
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 21:00:17 EST