30 Apr 2010 21:12
[PATCH V2] [ARM] Add ARCH_PROVIDES_UDELAY config option
Colin Cross <ccross <at> android.com>
2010-04-30 19:12:16 GMT
2010-04-30 19:12:16 GMT
On SMP kernels, the loops_per_jiffy value is not scaled due to the possibility of one CPU affecting the speed of another CPU while the second CPU is in a udelay loop. Since loops_per_jiffy is calculated once on boot for SMP kernels, udelays are too long if the CPU frequency is scaled down from the boot frequency, or too short if the frequency is scaled up. Some SOCs have a timer with a constant tick rate that can be used to time udelays, similar to the TSC on x86. Provide a config flag to allow these SOCs to override the default ARM udelay implementation. Signed-off-by: Colin Cross <ccross <at> android.com> --- arch/arm/Kconfig | 3 +++ arch/arm/include/asm/delay.h | 4 ++++ arch/arm/lib/Makefile | 6 +++++- 3 files changed, 12 insertions(+), 1 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 33d2825..d9923b0 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig <at> <at> -175,6 +175,9 <at> <at> config ARM_L1_CACHE_SHIFT_6 help Setting ARM L1 cache line size to 64 Bytes. +config ARCH_PROVIDES_UDELAY + bool + if OPROFILE(Continue reading)
Thanks,
Saravana
Kevin Hilman wrote:
> Colin Cross <ccross <at> android.com> writes:
>
>> An alternative to this patch would be to add a config option to use
>> sched_clock() to provide the counter instead of the cycle loop. The
>> same loops_per_jiffy calibration could be done to determine the
>> sched_clock frequency. Any machine with an available constant tick
>> rate counter, which is likely to be used for sched_clock() already,
>> can enable CONFIG_UDELAY_USES_SCHED_CLOCK.
>
> Or even better, why not have an option to use the clocksource which is
> most likely using the constant tick timer as well.
>
> Kevin
RSS Feed