Commit f63d947c authored by Sudeep Holla's avatar Sudeep Holla Committed by Thomas Gleixner
Browse files

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

Fixes: c389d701

 ("clocksource: arm_arch_timer: split MMIO timer probing.")
Signed-off-by: default avatarSudeep Holla <>
Acked-by: default avatarMark Rutland <>
Cc: Marc Zyngier <>
Cc: Daniel Lezcano <>

Signed-off-by: default avatarThomas Gleixner <>
parent d3b5d352
......@@ -1268,7 +1268,7 @@ arch_timer_mem_find_best_frame(struct arch_timer_mem *timer_mem)
pr_err("Unable to find a suitable frame in timer @ %pa\n",
return frame;
return best_frame;
static int __init
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment