author | Shen Liu <shen.liu@amlogic.com> | 2020-05-29 12:15:29 (GMT) |
---|---|---|
committer | Shen Liu <shen.liu@amlogic.com> | 2020-05-29 12:15:45 (GMT) |
commit | 0ca31b983fb154c1320005df9d95853d2668b830 (patch) | |
tree | 59027c3df78797b845d4cfa9765e1a859abe8866 | |
parent | aa20cdaaf219a9bdf0fb38d7a49943068528dbd7 (diff) | |
download | common-0ca31b983fb154c1320005df9d95853d2668b830.zip common-0ca31b983fb154c1320005df9d95853d2668b830.tar.gz common-0ca31b983fb154c1320005df9d95853d2668b830.tar.bz2 |
Revert "dvfs: sm1: critical region of cpu and dsu clock settings [1/1]"
This reverts commit 4c73e820b19e3d588e78f011e3b825488585209e.
Reason:
The commit caused rebooting process stuck.
Signed-off-by: Shen Liu <shen.liu@amlogic.com>
Change-Id: I59e358dff9ab2c332b6ad27be26418750e773e93
-rw-r--r-- | drivers/amlogic/cpufreq/meson-cpufreq.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/amlogic/cpufreq/meson-cpufreq.c b/drivers/amlogic/cpufreq/meson-cpufreq.c index 97412bb..a7bbd3e 100644 --- a/drivers/amlogic/cpufreq/meson-cpufreq.c +++ b/drivers/amlogic/cpufreq/meson-cpufreq.c @@ -72,8 +72,10 @@ struct meson_cpufreq_driver_data { }; +static DEFINE_PER_CPU(unsigned int, physical_cluster); + static struct mutex cluster_lock[MAX_CLUSTERS]; -static DEFINE_MUTEX(cpufreq_target_lock); + static unsigned int meson_cpufreq_get_rate(unsigned int cpu) { @@ -247,7 +249,6 @@ static int meson_cpufreq_set_target(struct cpufreq_policy *policy, return -ENODEV; } - mutex_lock(&cpufreq_target_lock); cpu = policy->cpu; cpufreq_data = policy->driver_data; cpu_dev = cpufreq_data->cpu_dev; @@ -263,7 +264,6 @@ static int meson_cpufreq_set_target(struct cpufreq_policy *policy, opp = dev_pm_opp_find_freq_ceil(cpu_dev, &freq_new); if (IS_ERR(opp)) { rcu_read_unlock(); - mutex_unlock(&cpufreq_target_lock); pr_err("failed to find OPP for %lu Khz\n", freq_new / 1000); return PTR_ERR(opp); @@ -288,7 +288,6 @@ static int meson_cpufreq_set_target(struct cpufreq_policy *policy, ret = meson_regulator_set_volate(cpu_reg, volt_old, volt_new, volt_tol); if (ret) { - mutex_unlock(&cpufreq_target_lock); pr_err("failed to scale voltage %u %u up: %d\n", volt_new, volt_tol, ret); return ret; @@ -306,7 +305,6 @@ static int meson_cpufreq_set_target(struct cpufreq_policy *policy, meson_regulator_set_volate(cpu_reg, volt_old, volt_old, volt_tol); } - mutex_unlock(&cpufreq_target_lock); return ret; } /*cpufreq down,change voltage after frequency*/ @@ -397,13 +395,6 @@ static int meson_cpufreq_init(struct cpufreq_policy *policy) goto free_clk; } - /*setting low_freq_clk_p to 1G,default 24M*/ - ret = clk_set_rate(low_freq_clk_p, mid_rate * 1000); - if (ret) { - pr_err("%s: error in setting low_freq_clk_p rate!\n", - __func__); - goto free_clk; - } high_freq_clk_p = of_clk_get_by_name(np, HIGH_FREQ_CLK_PARENT); if (IS_ERR(high_freq_clk_p)) { pr_err("%s: Failed to get high parent for cpu: %d,cluster: %d\n", @@ -424,7 +415,13 @@ static int meson_cpufreq_init(struct cpufreq_policy *policy) volt_tol = DEF_VOLT_TOL; pr_info("value of voltage_tolerance %u\n", volt_tol); - cpumask_copy(policy->cpus, topology_core_cpumask(policy->cpu)); + if (cur_cluster < MAX_CLUSTERS) { + int cpu; + + cpumask_copy(policy->cpus, topology_core_cpumask(policy->cpu)); + for_each_cpu(cpu, policy->cpus) + per_cpu(physical_cluster, cpu) = cur_cluster; + } ret = dev_pm_opp_of_cpumask_add_table(policy->cpus); if (ret) { @@ -499,7 +496,7 @@ free_np: static int meson_cpufreq_exit(struct cpufreq_policy *policy) { struct device *cpu_dev; - struct meson_cpufreq_driver_data *cpufreq_data; + struct sprd_cpufreq_driver_data *cpufreq_data; int cur_cluster = topology_physical_package_id(policy->cpu); cpufreq_data = policy->driver_data; |