aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2015-11-17 06:26:33 -0500
committerStephen Boyd <sboyd@codeaurora.org>2015-11-20 13:53:12 -0500
commitd7a81d847bce48ce92c937bfb2be5a86f4112f8f (patch)
treed9494ab23af424218c3ee077bf046d061a9745c7
parent1382ea631ddddb634850a3795527db0feeff5aaf (diff)
clk: at91: Revert "keep slow clk enabled to prevent system hang"
Commit dca1a4b5ff6e ("clk: at91: keep slow clk enabled to prevent system hang") added a workaround for the slow clock as it is not properly handled by its users. Now that the slow clock is taken properly by the drivers, this workaround is not necessary anymore, revert it. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Michael Turquette <mturquette@baylibre.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-rw-r--r--drivers/clk/at91/clk-slow.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/drivers/clk/at91/clk-slow.c b/drivers/clk/at91/clk-slow.c
index d0d5076a9b94..6f99a530ead6 100644
--- a/drivers/clk/at91/clk-slow.c
+++ b/drivers/clk/at91/clk-slow.c
@@ -10,7 +10,6 @@
10 * 10 *
11 */ 11 */
12 12
13#include <linux/clk.h>
14#include <linux/clk-provider.h> 13#include <linux/clk-provider.h>
15#include <linux/clkdev.h> 14#include <linux/clkdev.h>
16#include <linux/slab.h> 15#include <linux/slab.h>
@@ -72,8 +71,6 @@ struct clk_sam9x5_slow {
72 71
73#define to_clk_sam9x5_slow(hw) container_of(hw, struct clk_sam9x5_slow, hw) 72#define to_clk_sam9x5_slow(hw) container_of(hw, struct clk_sam9x5_slow, hw)
74 73
75static struct clk *slow_clk;
76
77static int clk_slow_osc_prepare(struct clk_hw *hw) 74static int clk_slow_osc_prepare(struct clk_hw *hw)
78{ 75{
79 struct clk_slow_osc *osc = to_clk_slow_osc(hw); 76 struct clk_slow_osc *osc = to_clk_slow_osc(hw);
@@ -360,8 +357,6 @@ at91_clk_register_sam9x5_slow(void __iomem *sckcr,
360 clk = clk_register(NULL, &slowck->hw); 357 clk = clk_register(NULL, &slowck->hw);
361 if (IS_ERR(clk)) 358 if (IS_ERR(clk))
362 kfree(slowck); 359 kfree(slowck);
363 else
364 slow_clk = clk;
365 360
366 return clk; 361 return clk;
367} 362}
@@ -433,8 +428,6 @@ at91_clk_register_sam9260_slow(struct at91_pmc *pmc,
433 clk = clk_register(NULL, &slowck->hw); 428 clk = clk_register(NULL, &slowck->hw);
434 if (IS_ERR(clk)) 429 if (IS_ERR(clk))
435 kfree(slowck); 430 kfree(slowck);
436 else
437 slow_clk = clk;
438 431
439 return clk; 432 return clk;
440} 433}
@@ -462,25 +455,3 @@ void __init of_at91sam9260_clk_slow_setup(struct device_node *np,
462 455
463 of_clk_add_provider(np, of_clk_src_simple_get, clk); 456 of_clk_add_provider(np, of_clk_src_simple_get, clk);
464} 457}
465
466/*
467 * FIXME: All slow clk users are not properly claiming it (get + prepare +
468 * enable) before using it.
469 * If all users properly claiming this clock decide that they don't need it
470 * anymore (or are removed), it is disabled while faulty users are still
471 * requiring it, and the system hangs.
472 * Prevent this clock from being disabled until all users are properly
473 * requesting it.
474 * Once this is done we should remove this function and the slow_clk variable.
475 */
476static int __init of_at91_clk_slow_retain(void)
477{
478 if (!slow_clk)
479 return 0;
480
481 __clk_get(slow_clk);
482 clk_prepare_enable(slow_clk);
483
484 return 0;
485}
486arch_initcall(of_at91_clk_slow_retain);