aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource
diff options
context:
space:
mode:
authorZhiwu Song <Zhiwu.Song@csr.com>2014-07-03 08:52:51 -0400
committerDaniel Lezcano <daniel.lezcano@linaro.org>2014-07-23 06:02:34 -0400
commit38941522ecbd2198694b742343a67ea128b44913 (patch)
tree861ed0477c052cda4d04e8601f90c9667d0cf223 /drivers/clocksource
parent40c96312dc3534d97c64d7d69acf1ea14ceff404 (diff)
clocksource: sirf: Fix incorrect clock enable counter for timer
In the clocksource driver, we didn't explicitly enable the clock. it makes the clk reference counter wrong. We didn't encounter any hang issue because the tick's clock input has been open and is shared by some other hardware components, but if we don't enable those components in kernel, in the stage of disabling unused clk in kernel boot, Linux tick hangs. This patch fixes it. it does an explicit prepare and enable to the clock input, and increases the usage counter of the clk. Signed-off-by: Zhiwu Song <Zhiwu.Song@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers/clocksource')
-rw-r--r--drivers/clocksource/timer-marco.c3
-rw-r--r--drivers/clocksource/timer-prima2.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/clocksource/timer-marco.c b/drivers/clocksource/timer-marco.c
index dbd30398222a..330e93064692 100644
--- a/drivers/clocksource/timer-marco.c
+++ b/drivers/clocksource/timer-marco.c
@@ -260,6 +260,9 @@ static void __init sirfsoc_marco_timer_init(struct device_node *np)
260 260
261 clk = of_clk_get(np, 0); 261 clk = of_clk_get(np, 0);
262 BUG_ON(IS_ERR(clk)); 262 BUG_ON(IS_ERR(clk));
263
264 BUG_ON(clk_prepare_enable(clk));
265
263 rate = clk_get_rate(clk); 266 rate = clk_get_rate(clk);
264 267
265 BUG_ON(rate < MARCO_CLOCK_FREQ); 268 BUG_ON(rate < MARCO_CLOCK_FREQ);
diff --git a/drivers/clocksource/timer-prima2.c b/drivers/clocksource/timer-prima2.c
index a722aac7ac02..ce18d570e1cd 100644
--- a/drivers/clocksource/timer-prima2.c
+++ b/drivers/clocksource/timer-prima2.c
@@ -200,6 +200,9 @@ static void __init sirfsoc_prima2_timer_init(struct device_node *np)
200 200
201 clk = of_clk_get(np, 0); 201 clk = of_clk_get(np, 0);
202 BUG_ON(IS_ERR(clk)); 202 BUG_ON(IS_ERR(clk));
203
204 BUG_ON(clk_prepare_enable(clk));
205
203 rate = clk_get_rate(clk); 206 rate = clk_get_rate(clk);
204 207
205 BUG_ON(rate < PRIMA2_CLOCK_FREQ); 208 BUG_ON(rate < PRIMA2_CLOCK_FREQ);