Commit 38941522 authored by Zhiwu Song's avatar Zhiwu Song Committed by Daniel Lezcano

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: default avatarZhiwu Song <Zhiwu.Song@csr.com>
Signed-off-by: default avatarBarry Song <Baohua.Song@csr.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent 40c96312
...@@ -260,6 +260,9 @@ static void __init sirfsoc_marco_timer_init(struct device_node *np) ...@@ -260,6 +260,9 @@ static void __init sirfsoc_marco_timer_init(struct device_node *np)
clk = of_clk_get(np, 0); clk = of_clk_get(np, 0);
BUG_ON(IS_ERR(clk)); BUG_ON(IS_ERR(clk));
BUG_ON(clk_prepare_enable(clk));
rate = clk_get_rate(clk); rate = clk_get_rate(clk);
BUG_ON(rate < MARCO_CLOCK_FREQ); BUG_ON(rate < MARCO_CLOCK_FREQ);
......
...@@ -200,6 +200,9 @@ static void __init sirfsoc_prima2_timer_init(struct device_node *np) ...@@ -200,6 +200,9 @@ static void __init sirfsoc_prima2_timer_init(struct device_node *np)
clk = of_clk_get(np, 0); clk = of_clk_get(np, 0);
BUG_ON(IS_ERR(clk)); BUG_ON(IS_ERR(clk));
BUG_ON(clk_prepare_enable(clk));
rate = clk_get_rate(clk); rate = clk_get_rate(clk);
BUG_ON(rate < PRIMA2_CLOCK_FREQ); BUG_ON(rate < PRIMA2_CLOCK_FREQ);
......
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