msm: clock: Remove the "auto_off" feature
The auto_off feature loops through all clocks in lateinit and disables
them if their reference count is 0, so long as the SKIP_AUTO_OFF flag
is not set. This has a significant functional overlap with the more
intelligent handoff feature.
In addition to detecting initial clock rates, handoff (like auto_off)
disables clocks in lateinit, but only if the clock was detected to be
on when the handoff op was called during msm_clock_init.
Currently, handoff does not support a skip flag like SKIP_AUTO_OFF,
which was used aggressively by proc_comm targets. Experimentally,
however, this does not seem to cause problems, possibly because
clocks are now being more selectively disabled.
Because there is no up-to-date documentation of the reasons why many
of these flags were set, the flags are just dropped by this patch
until their questionable utility can be re-evaluated.
Change-Id: I6b3eeff9f8040d87be1a94cb28b28ab5774f23fb
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
diff --git a/arch/arm/mach-msm/clock.c b/arch/arm/mach-msm/clock.c
index 8bf98fa..da8c3a9 100644
--- a/arch/arm/mach-msm/clock.c
+++ b/arch/arm/mach-msm/clock.c
@@ -506,34 +506,16 @@
clk_init_data->post_init();
}
-/*
- * The bootloader and/or AMSS may have left various clocks enabled.
- * Disable any clocks that have not been explicitly enabled by a
- * clk_enable() call and don't have the CLKFLAG_SKIP_AUTO_OFF flag.
- */
static int __init clock_late_init(void)
{
- unsigned n, count = 0;
struct handoff_clk *h, *h_temp;
- unsigned long flags;
- int ret = 0;
+ int n, ret = 0;
clock_debug_init(clk_init_data);
- for (n = 0; n < clk_init_data->size; n++) {
- struct clk *clk = clk_init_data->table[n].clk;
+ for (n = 0; n < clk_init_data->size; n++)
+ clock_debug_add(clk_init_data->table[n].clk);
- clock_debug_add(clk);
- spin_lock_irqsave(&clk->lock, flags);
- if (!(clk->flags & CLKFLAG_SKIP_AUTO_OFF)) {
- if (!clk->count && clk->ops->auto_off) {
- count++;
- clk->ops->auto_off(clk);
- }
- }
- spin_unlock_irqrestore(&clk->lock, flags);
- }
- pr_info("clock_late_init() disabled %d unused clocks\n", count);
-
+ pr_info("%s: Removing enables held for handed-off clocks\n", __func__);
list_for_each_entry_safe(h, h_temp, &handoff_list, list) {
clk_disable_unprepare(h->clk);
list_del(&h->list);