public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clocksource: arm_arch_timer: discard unavailable timers correctly
@ 2014-09-16 23:50 Sudeep Holla
  2014-09-17  0:01 ` Stephen Boyd
  2014-09-17 19:39 ` [PATCH v2] " Sudeep Holla
  0 siblings, 2 replies; 8+ messages in thread
From: Sudeep Holla @ 2014-09-16 23:50 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: Daniel Lezcano, Thomas Gleixner, Sudeep Holla, Stephen Boyd,
	Mark Rutland

Currently we wait until both nodes are probed if we have two timers
without checking if the device is actually available. This might
result in non-functional system as no timer gets registered.

This patch adds the check for the availablity of the timer device
so that unavailable timers are discarded correctly.

Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/clocksource/arm_arch_timer.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 5163ec1..4d025ad 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -622,11 +622,15 @@ static void __init arch_timer_common_init(void)
 
 	/* Wait until both nodes are probed if we have two timers */
 	if ((arch_timers_present & mask) != mask) {
-		if (of_find_matching_node(NULL, arch_timer_mem_of_match) &&
-				!(arch_timers_present & ARCH_MEM_TIMER))
+		struct device_node *dn;
+
+		dn = of_find_matching_node(NULL, arch_timer_mem_of_match);
+		if (dn && of_device_is_available(dn) &&
+		    !(arch_timers_present & ARCH_MEM_TIMER))
 			return;
-		if (of_find_matching_node(NULL, arch_timer_of_match) &&
-				!(arch_timers_present & ARCH_CP15_TIMER))
+		dn = of_find_matching_node(NULL, arch_timer_of_match);
+		if (dn && of_device_is_available(dn) &&
+		    !(arch_timers_present & ARCH_CP15_TIMER))
 			return;
 	}
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-09-24 16:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-16 23:50 [PATCH] clocksource: arm_arch_timer: discard unavailable timers correctly Sudeep Holla
2014-09-17  0:01 ` Stephen Boyd
2014-09-17 19:39 ` [PATCH v2] " Sudeep Holla
2014-09-17 19:51   ` Stephen Boyd
2014-09-24 15:16   ` Sudeep Holla
2014-09-24 15:48     ` Mark Rutland
2014-09-24 15:55       ` Sudeep Holla
2014-09-24 16:23   ` [PATCH v3] " Sudeep Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox