Re: udelay function delays the wrong time interval in multiprocessorsystem, if ARCH_HAS_READ_CURRENT_TIMER is not defined and on current timeris used.

From: Will Deacon
Date: Sun Mar 17 2013 - 16:06:15 EST

On Sat, Mar 16, 2013 at 03:32:43AM +0000, chpoph wrote:
> On Sat, Mar 16, 2013 at 2:14 AM, Russell King - ARM Linux
> <linux@xxxxxxxxxxxxxxxx> wrote:
> > We don't support different CPUs running at different frequencies with
> > the delay loop. Sorry.
> Does it means that a timer-based delay implementation must be used to
> get an accurate delay in SMP. I think it should print a warning
> message if the CPU delay loop is used in SMP. In my system, the wrong
> delay interval fluctuated with CPU frequencies caused a control
> problem.

I've been playing around with loops_per_jiffy recently, in an attempt to
clean up the cpufreq scaling code so that the SMP-ness is in core code,
rather than being duplicated by every architecture:

git:// lpj

With those changes, it's pretty easy to get different delays depending on
the current CPU, but it would require preempt_{enable,disable} calls around
the delay, which I haven't convinced myself about.

Do you actually have an ARM platform that can scale the CPU frequencies

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at