Commit 59aa896d authored by Marc Zyngier's avatar Marc Zyngier Committed by Daniel Lezcano

ARM/ARM64: arch-timer: fix arch_timer_probed logic

Commit c387f07e (clocksource: arm_arch_timer: Discard unavailable
timers correctly) changed the way the driver makes sure both the memory
and system-register timers have been probed before finalizing the probing.

There is a interesting flaw in this logic that leads to this final step
never to be executed. Things seems to work pretty well until something
actually needs the data that is produced during this final stage.

For example, KVM explodes on the first run of a guest when executed on
a platform that has both memory and sysreg nodes (Juno, for example).

Just fix the damned logic, and enjoy booting VMs again.

Tested on a Juno system.

Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Christoffer Dall <christoffer.dall@linaro.org>
Reported-by: default avatarRiku Voipio <riku.voipio@linaro.org>
Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
Acked-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Tested-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent 10632008
...@@ -660,11 +660,11 @@ static bool __init ...@@ -660,11 +660,11 @@ static bool __init
arch_timer_probed(int type, const struct of_device_id *matches) arch_timer_probed(int type, const struct of_device_id *matches)
{ {
struct device_node *dn; struct device_node *dn;
bool probed = false; bool probed = true;
dn = of_find_matching_node(NULL, matches); dn = of_find_matching_node(NULL, matches);
if (dn && of_device_is_available(dn) && (arch_timers_present & type)) if (dn && of_device_is_available(dn) && !(arch_timers_present & type))
probed = true; probed = false;
of_node_put(dn); of_node_put(dn);
return probed; return probed;
......
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