diff options
authorMark Salter <msalter@redhat.com>2014-10-19 11:11:08 -0400
committerGraeme Gregory <graeme.gregory@linaro.org>2014-11-06 12:00:46 +0000
commita1dd1f5fdf0623bc22e2212d65283361e2433cdc (patch)
parent56e9d8aca639569ada6e34c87b05fdeafee8530d (diff)
clocksource: arm_arch_timer: fix system hang
Arm allows for two possible architectural clock sources. One memory mapped and the other coprocessor based. If both timers exist, then the driver waits for both to be probed before registering a clocksource. Commit c387f07e6205 ("clocksource: arm_arch_timer: Discard unavailable timers correctly") attempted to fix a hang occurring when one of the two possible timers had a device node, but was disabled. In that case, the second probe would never occur and the system would hang without a clocksource being registered. Unfortunately, incorrect logic in that commit made things worse such that a hang would occur unless both timers had a device node and were enabled. This patch fixes the logic so that we don't wait to probe a second timer unless it exists and is enabled. Signed-off-by: Mark Salter <msalter@redhat.com>
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 7227ab21b744..394e06cbcda3 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -668,10 +668,11 @@ arch_timer_probed(int type, const struct of_device_id *matches)
bool probed = true;
dn = of_find_matching_node(NULL, matches);
- if (dn && of_device_is_available(dn) && !(arch_timers_present & type))
- probed = false;
- of_node_put(dn);
+ if (dn) {
+ if (of_device_is_available(dn) && !(arch_timers_present & type))
+ probed = false;
+ of_node_put(dn);
+ }
return probed;