diff options
| author | Osvaldo Banuelos <osvaldob@codeaurora.org> | 2016-03-21 15:29:39 -0700 |
|---|---|---|
| committer | Jeevan Shriram <jshriram@codeaurora.org> | 2016-05-06 12:06:24 -0700 |
| commit | 05a8698e52da34ab83aff8d68409a20ea46e3bbc (patch) | |
| tree | 0796b008db6b639f5392c5bcfea68cdb1060ae67 | |
| parent | 3a0f40b5ef2b74486fda2ef2bb77775ed5eba19b (diff) | |
clk: msm: clock-osm: increase refcount of CPU clocks at probe time
Increase the refcount of CPU clocks proportionally to the number
of available CPUs to maintain the assumption that each CPU clock
has been prepared and enabled by the time cpufreq takes over.
Change-Id: Icccb28bc7a88dc76cf4ed5710623e992ba62f19c
CRs-Fixed: 994035
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
| -rw-r--r-- | drivers/clk/msm/clock-osm.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/clk/msm/clock-osm.c b/drivers/clk/msm/clock-osm.c index 355147369b98..b8f153923f23 100644 --- a/drivers/clk/msm/clock-osm.c +++ b/drivers/clk/msm/clock-osm.c @@ -2169,7 +2169,7 @@ static int cpu_clock_osm_driver_probe(struct platform_device *pdev) { char perfclspeedbinstr[] = "qcom,perfcl-speedbin0-v0"; char pwrclspeedbinstr[] = "qcom,pwrcl-speedbin0-v0"; - int rc; + int rc, cpu; rc = clk_osm_resources_init(pdev); if (rc) { @@ -2347,11 +2347,13 @@ static int cpu_clock_osm_driver_probe(struct platform_device *pdev) return rc; } + get_online_cpus(); + /* Enable OSM */ - WARN(clk_prepare_enable(&pwrcl_clk.c), - "Failed to enable power cluster clock\n"); - WARN(clk_prepare_enable(&perfcl_clk.c), - "Failed to enable perf cluster clock\n"); + for_each_online_cpu(cpu) { + WARN(clk_prepare_enable(logical_cpu_to_clk(cpu)), + "Failed to enable clock for cpu %d\n", cpu); + } populate_opp_table(pdev); populate_debugfs_dir(&pwrcl_clk); @@ -2360,6 +2362,8 @@ static int cpu_clock_osm_driver_probe(struct platform_device *pdev) of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); pr_info("OSM driver inited\n"); + put_online_cpus(); + return 0; exit: |
