summaryrefslogtreecommitdiff
path: root/drivers/clk
diff options
context:
space:
mode:
authorBjorn Andersson <andersson@kernel.org>2023-02-22 06:31:10 -0800
committerBjorn Andersson <andersson@kernel.org>2023-02-22 06:34:08 -0800
commitc1855dd0a62b7ead360eb9231fb65c2108efaf47 (patch)
treee7fc2fb03d9877606a02f0135ef8f248914fba8e /drivers/clk
parent7935b534d32a1823a7d5db449d340f56c201f284 (diff)
clk: qcom: Revert sync_state based clk_disable_unused
Revert the postponement of clk_disable_unused() for clock providers that implement sync_state, and the change to drivers implementing this, until agreement on the implementation has been reached. This reverts: 29e31415e14e ("clk: qcom: Remove need for clk_ignore_unused on sc8280xp") 99c0f7d35c4b ("clk: qcom: sdm845: Use generic clk_sync_state_disable_unused callback") 26b36df75166 ("clk: Add generic sync_state callback for disabling unused clocks") Requested-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/clk.c57
-rw-r--r--drivers/clk/qcom/camcc-sdm845.c1
-rw-r--r--drivers/clk/qcom/dispcc-sc8280xp.c1
-rw-r--r--drivers/clk/qcom/dispcc-sdm845.c1
-rw-r--r--drivers/clk/qcom/gcc-sc8280xp.c1
-rw-r--r--drivers/clk/qcom/gcc-sdm845.c1
-rw-r--r--drivers/clk/qcom/gpucc-sdm845.c1
7 files changed, 11 insertions, 52 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index ac7182903d88..e62552a75f08 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1302,26 +1302,14 @@ static void clk_core_disable_unprepare(struct clk_core *core)
clk_core_unprepare_lock(core);
}
-static void clk_unprepare_unused_subtree(struct clk_core *core,
- struct device *dev)
+static void __init clk_unprepare_unused_subtree(struct clk_core *core)
{
- bool from_sync_state = !!dev;
struct clk_core *child;
lockdep_assert_held(&prepare_lock);
hlist_for_each_entry(child, &core->children, child_node)
- clk_unprepare_unused_subtree(child, dev);
-
- if (from_sync_state && core->dev != dev)
- return;
-
- /*
- * clock will be unprepared on sync_state,
- * so leave as is for now
- */
- if (!from_sync_state && dev_has_sync_state(core->dev))
- return;
+ clk_unprepare_unused_subtree(child);
if (core->prepare_count)
return;
@@ -1344,27 +1332,15 @@ static void clk_unprepare_unused_subtree(struct clk_core *core,
clk_pm_runtime_put(core);
}
-static void clk_disable_unused_subtree(struct clk_core *core,
- struct device *dev)
+static void __init clk_disable_unused_subtree(struct clk_core *core)
{
- bool from_sync_state = !!dev;
struct clk_core *child;
unsigned long flags;
lockdep_assert_held(&prepare_lock);
hlist_for_each_entry(child, &core->children, child_node)
- clk_disable_unused_subtree(child, dev);
-
- if (from_sync_state && core->dev != dev)
- return;
-
- /*
- * clock will be disabled on sync_state,
- * so leave as is for now
- */
- if (!from_sync_state && dev_has_sync_state(core->dev))
- return;
+ clk_disable_unused_subtree(child);
if (core->flags & CLK_OPS_PARENT_ENABLE)
clk_core_prepare_enable(core->parent);
@@ -1402,7 +1378,7 @@ unprepare_out:
clk_core_disable_unprepare(core->parent);
}
-static bool clk_ignore_unused;
+static bool clk_ignore_unused __initdata;
static int __init clk_ignore_unused_setup(char *__unused)
{
clk_ignore_unused = true;
@@ -1410,46 +1386,35 @@ static int __init clk_ignore_unused_setup(char *__unused)
}
__setup("clk_ignore_unused", clk_ignore_unused_setup);
-static void __clk_disable_unused(struct device *dev)
+static int __init clk_disable_unused(void)
{
struct clk_core *core;
if (clk_ignore_unused) {
pr_warn("clk: Not disabling unused clocks\n");
- return;
+ return 0;
}
clk_prepare_lock();
hlist_for_each_entry(core, &clk_root_list, child_node)
- clk_disable_unused_subtree(core, dev);
+ clk_disable_unused_subtree(core);
hlist_for_each_entry(core, &clk_orphan_list, child_node)
- clk_disable_unused_subtree(core, dev);
+ clk_disable_unused_subtree(core);
hlist_for_each_entry(core, &clk_root_list, child_node)
- clk_unprepare_unused_subtree(core, dev);
+ clk_unprepare_unused_subtree(core);
hlist_for_each_entry(core, &clk_orphan_list, child_node)
- clk_unprepare_unused_subtree(core, dev);
+ clk_unprepare_unused_subtree(core);
clk_prepare_unlock();
-}
-
-static int __init clk_disable_unused(void)
-{
- __clk_disable_unused(NULL);
return 0;
}
late_initcall_sync(clk_disable_unused);
-void clk_sync_state_disable_unused(struct device *dev)
-{
- __clk_disable_unused(dev);
-}
-EXPORT_SYMBOL_GPL(clk_sync_state_disable_unused);
-
static int clk_core_determine_round_nolock(struct clk_core *core,
struct clk_rate_request *req)
{
diff --git a/drivers/clk/qcom/camcc-sdm845.c b/drivers/clk/qcom/camcc-sdm845.c
index e5aeb832e47b..27d44188a7ab 100644
--- a/drivers/clk/qcom/camcc-sdm845.c
+++ b/drivers/clk/qcom/camcc-sdm845.c
@@ -1743,7 +1743,6 @@ static struct platform_driver cam_cc_sdm845_driver = {
.driver = {
.name = "sdm845-camcc",
.of_match_table = cam_cc_sdm845_match_table,
- .sync_state = clk_sync_state_disable_unused,
},
};
diff --git a/drivers/clk/qcom/dispcc-sc8280xp.c b/drivers/clk/qcom/dispcc-sc8280xp.c
index c84a6481b879..167470beb369 100644
--- a/drivers/clk/qcom/dispcc-sc8280xp.c
+++ b/drivers/clk/qcom/dispcc-sc8280xp.c
@@ -3199,7 +3199,6 @@ static struct platform_driver disp_cc_sc8280xp_driver = {
.driver = {
.name = "disp_cc-sc8280xp",
.of_match_table = disp_cc_sc8280xp_match_table,
- .sync_state = clk_sync_state_disable_unused,
},
};
diff --git a/drivers/clk/qcom/dispcc-sdm845.c b/drivers/clk/qcom/dispcc-sdm845.c
index 1810d58bad09..735adfefc379 100644
--- a/drivers/clk/qcom/dispcc-sdm845.c
+++ b/drivers/clk/qcom/dispcc-sdm845.c
@@ -869,7 +869,6 @@ static struct platform_driver disp_cc_sdm845_driver = {
.driver = {
.name = "disp_cc-sdm845",
.of_match_table = disp_cc_sdm845_match_table,
- .sync_state = clk_sync_state_disable_unused,
},
};
diff --git a/drivers/clk/qcom/gcc-sc8280xp.c b/drivers/clk/qcom/gcc-sc8280xp.c
index f4fdc5b9663c..b3198784e1c3 100644
--- a/drivers/clk/qcom/gcc-sc8280xp.c
+++ b/drivers/clk/qcom/gcc-sc8280xp.c
@@ -7441,7 +7441,6 @@ static struct platform_driver gcc_sc8280xp_driver = {
.driver = {
.name = "gcc-sc8280xp",
.of_match_table = gcc_sc8280xp_match_table,
- .sync_state = clk_sync_state_disable_unused,
},
};
diff --git a/drivers/clk/qcom/gcc-sdm845.c b/drivers/clk/qcom/gcc-sdm845.c
index 0ff05af515c4..6af08e0ca847 100644
--- a/drivers/clk/qcom/gcc-sdm845.c
+++ b/drivers/clk/qcom/gcc-sdm845.c
@@ -4020,7 +4020,6 @@ static struct platform_driver gcc_sdm845_driver = {
.driver = {
.name = "gcc-sdm845",
.of_match_table = gcc_sdm845_match_table,
- .sync_state = clk_sync_state_disable_unused,
},
};
diff --git a/drivers/clk/qcom/gpucc-sdm845.c b/drivers/clk/qcom/gpucc-sdm845.c
index d48ad19e832d..970d7414bdf0 100644
--- a/drivers/clk/qcom/gpucc-sdm845.c
+++ b/drivers/clk/qcom/gpucc-sdm845.c
@@ -200,7 +200,6 @@ static struct platform_driver gpu_cc_sdm845_driver = {
.driver = {
.name = "sdm845-gpucc",
.of_match_table = gpu_cc_sdm845_match_table,
- .sync_state = clk_sync_state_disable_unused,
},
};