]> git.baikalelectronics.ru Git - kernel.git/commit
clocksource/arm_arch_timer: Fix arch_timer_mem_find_best_frame()
authorSudeep Holla <sudeep.holla@arm.com>
Mon, 8 May 2017 12:32:27 +0000 (13:32 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 9 May 2017 06:56:41 +0000 (08:56 +0200)
commitda8bdd5587d1a1b330c4d5d4e8aed019b23d459f
tree3466d29245c0447075b14ee26d51e80bd2766b0b
parent716510e674519c3ef31c36ab9dc4d18793b72b3d
clocksource/arm_arch_timer: Fix arch_timer_mem_find_best_frame()

arch_timer_mem_find_best_frame() looks through ARCH_TIMER_MEM_MAX_FRAMES
frames even after finding matches to ensure the best frame is chosen,
which means the variable frame will point to the last valid frame but
not necessarily the best frame.

On Juno, we get the following error as the wrong frame is returned as the
best frame from arch_timer_mem_find_best_frame():

  arch_timer: Unable to map frame @ 0x0000000000000000
  arch_timer: Frame missing phys irq.
  Failed to initialize '/timer@2a810000': -22

Fix the issue by correctly returning the best frame from
arch_timer_mem_find_best_frame().

Fixes: 3b47a287d1a4 ("clocksource: arm_arch_timer: split MMIO timer probing.")
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1494246747-17267-1-git-send-email-sudeep.holla@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/clocksource/arm_arch_timer.c