Skip to content

Commit c1855dd

Browse files
committed
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: 29e3141 ("clk: qcom: Remove need for clk_ignore_unused on sc8280xp") 99c0f7d ("clk: qcom: sdm845: Use generic clk_sync_state_disable_unused callback") 26b36df ("clk: Add generic sync_state callback for disabling unused clocks") Requested-by: Stephen Boyd <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 7935b53 commit c1855dd

File tree

8 files changed

+11
-53
lines changed

8 files changed

+11
-53
lines changed

drivers/clk/clk.c

Lines changed: 11 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,26 +1302,14 @@ static void clk_core_disable_unprepare(struct clk_core *core)
13021302
clk_core_unprepare_lock(core);
13031303
}
13041304

1305-
static void clk_unprepare_unused_subtree(struct clk_core *core,
1306-
struct device *dev)
1305+
static void __init clk_unprepare_unused_subtree(struct clk_core *core)
13071306
{
1308-
bool from_sync_state = !!dev;
13091307
struct clk_core *child;
13101308

13111309
lockdep_assert_held(&prepare_lock);
13121310

13131311
hlist_for_each_entry(child, &core->children, child_node)
1314-
clk_unprepare_unused_subtree(child, dev);
1315-
1316-
if (from_sync_state && core->dev != dev)
1317-
return;
1318-
1319-
/*
1320-
* clock will be unprepared on sync_state,
1321-
* so leave as is for now
1322-
*/
1323-
if (!from_sync_state && dev_has_sync_state(core->dev))
1324-
return;
1312+
clk_unprepare_unused_subtree(child);
13251313

13261314
if (core->prepare_count)
13271315
return;
@@ -1344,27 +1332,15 @@ static void clk_unprepare_unused_subtree(struct clk_core *core,
13441332
clk_pm_runtime_put(core);
13451333
}
13461334

1347-
static void clk_disable_unused_subtree(struct clk_core *core,
1348-
struct device *dev)
1335+
static void __init clk_disable_unused_subtree(struct clk_core *core)
13491336
{
1350-
bool from_sync_state = !!dev;
13511337
struct clk_core *child;
13521338
unsigned long flags;
13531339

13541340
lockdep_assert_held(&prepare_lock);
13551341

13561342
hlist_for_each_entry(child, &core->children, child_node)
1357-
clk_disable_unused_subtree(child, dev);
1358-
1359-
if (from_sync_state && core->dev != dev)
1360-
return;
1361-
1362-
/*
1363-
* clock will be disabled on sync_state,
1364-
* so leave as is for now
1365-
*/
1366-
if (!from_sync_state && dev_has_sync_state(core->dev))
1367-
return;
1343+
clk_disable_unused_subtree(child);
13681344

13691345
if (core->flags & CLK_OPS_PARENT_ENABLE)
13701346
clk_core_prepare_enable(core->parent);
@@ -1402,54 +1378,43 @@ static void clk_disable_unused_subtree(struct clk_core *core,
14021378
clk_core_disable_unprepare(core->parent);
14031379
}
14041380

1405-
static bool clk_ignore_unused;
1381+
static bool clk_ignore_unused __initdata;
14061382
static int __init clk_ignore_unused_setup(char *__unused)
14071383
{
14081384
clk_ignore_unused = true;
14091385
return 1;
14101386
}
14111387
__setup("clk_ignore_unused", clk_ignore_unused_setup);
14121388

1413-
static void __clk_disable_unused(struct device *dev)
1389+
static int __init clk_disable_unused(void)
14141390
{
14151391
struct clk_core *core;
14161392

14171393
if (clk_ignore_unused) {
14181394
pr_warn("clk: Not disabling unused clocks\n");
1419-
return;
1395+
return 0;
14201396
}
14211397

14221398
clk_prepare_lock();
14231399

14241400
hlist_for_each_entry(core, &clk_root_list, child_node)
1425-
clk_disable_unused_subtree(core, dev);
1401+
clk_disable_unused_subtree(core);
14261402

14271403
hlist_for_each_entry(core, &clk_orphan_list, child_node)
1428-
clk_disable_unused_subtree(core, dev);
1404+
clk_disable_unused_subtree(core);
14291405

14301406
hlist_for_each_entry(core, &clk_root_list, child_node)
1431-
clk_unprepare_unused_subtree(core, dev);
1407+
clk_unprepare_unused_subtree(core);
14321408

14331409
hlist_for_each_entry(core, &clk_orphan_list, child_node)
1434-
clk_unprepare_unused_subtree(core, dev);
1410+
clk_unprepare_unused_subtree(core);
14351411

14361412
clk_prepare_unlock();
1437-
}
1438-
1439-
static int __init clk_disable_unused(void)
1440-
{
1441-
__clk_disable_unused(NULL);
14421413

14431414
return 0;
14441415
}
14451416
late_initcall_sync(clk_disable_unused);
14461417

1447-
void clk_sync_state_disable_unused(struct device *dev)
1448-
{
1449-
__clk_disable_unused(dev);
1450-
}
1451-
EXPORT_SYMBOL_GPL(clk_sync_state_disable_unused);
1452-
14531418
static int clk_core_determine_round_nolock(struct clk_core *core,
14541419
struct clk_rate_request *req)
14551420
{

drivers/clk/qcom/camcc-sdm845.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,6 @@ static struct platform_driver cam_cc_sdm845_driver = {
17431743
.driver = {
17441744
.name = "sdm845-camcc",
17451745
.of_match_table = cam_cc_sdm845_match_table,
1746-
.sync_state = clk_sync_state_disable_unused,
17471746
},
17481747
};
17491748

drivers/clk/qcom/dispcc-sc8280xp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3199,7 +3199,6 @@ static struct platform_driver disp_cc_sc8280xp_driver = {
31993199
.driver = {
32003200
.name = "disp_cc-sc8280xp",
32013201
.of_match_table = disp_cc_sc8280xp_match_table,
3202-
.sync_state = clk_sync_state_disable_unused,
32033202
},
32043203
};
32053204

drivers/clk/qcom/dispcc-sdm845.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,6 @@ static struct platform_driver disp_cc_sdm845_driver = {
869869
.driver = {
870870
.name = "disp_cc-sdm845",
871871
.of_match_table = disp_cc_sdm845_match_table,
872-
.sync_state = clk_sync_state_disable_unused,
873872
},
874873
};
875874

drivers/clk/qcom/gcc-sc8280xp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7441,7 +7441,6 @@ static struct platform_driver gcc_sc8280xp_driver = {
74417441
.driver = {
74427442
.name = "gcc-sc8280xp",
74437443
.of_match_table = gcc_sc8280xp_match_table,
7444-
.sync_state = clk_sync_state_disable_unused,
74457444
},
74467445
};
74477446

drivers/clk/qcom/gcc-sdm845.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4020,7 +4020,6 @@ static struct platform_driver gcc_sdm845_driver = {
40204020
.driver = {
40214021
.name = "gcc-sdm845",
40224022
.of_match_table = gcc_sdm845_match_table,
4023-
.sync_state = clk_sync_state_disable_unused,
40244023
},
40254024
};
40264025

drivers/clk/qcom/gpucc-sdm845.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ static struct platform_driver gpu_cc_sdm845_driver = {
200200
.driver = {
201201
.name = "sdm845-gpucc",
202202
.of_match_table = gpu_cc_sdm845_match_table,
203-
.sync_state = clk_sync_state_disable_unused,
204203
},
205204
};
206205

include/linux/clk-provider.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,6 @@ struct clk *clk_register_divider_table(struct device *dev, const char *name,
720720
void __iomem *reg, u8 shift, u8 width,
721721
u8 clk_divider_flags, const struct clk_div_table *table,
722722
spinlock_t *lock);
723-
void clk_sync_state_disable_unused(struct device *dev);
724723
/**
725724
* clk_register_divider - register a divider clock with the clock framework
726725
* @dev: device registering this clock

0 commit comments

Comments
 (0)