]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: shmobile: timer: Fix preset_lpj leading to too short delays
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 11 Jan 2016 18:41:12 +0000 (19:41 +0100)
committerSimon Horman <horms+renesas@verge.net.au>
Tue, 19 Apr 2016 22:52:55 +0000 (08:52 +1000)
commit93f15d1d49b0b046497e5a29819a0bafea497ba8
treeff4a270a520ba262221fa5b0ff7b67d45d8548c2
parent7dc6bfa6bc65ba46c85326389b0e48b00fd0d465
ARM: shmobile: timer: Fix preset_lpj leading to too short delays

On all shmobile ARM SoCs, loop-based delays may complete early, which
can be after only 1/3 (Cortex A9) or 1/2 (Cortex A7 or A15) of the
minimum required time.

This is caused by calculating preset_lpj based on incorrect assumptions
about the number of clock cycles per loop:
  - All of Cortex A7, A9, and A15 run __loop_delay() at 1 loop per
    CPU clock cycle,
  - As of commit 2f5b3145d1eff2e4 ("ARM: 7907/1: lib: delay-loop: Add
    align directive to fix BogoMIPS calculation"), Cortex A8 runs
    __loop_delay() at 1 loop per 2 instead of 3 CPU clock cycles.

On SoCs with Cortex A7 and/or A15 CPU cores, this went unnoticed, as
delays use the ARM arch timer if available. R-Car Gen2 doesn't work if
the arch timer is disabled. However, APE6 can be used without the arch
timer.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
arch/arm/mach-shmobile/timer.c