Commit 9b961aa9 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branches 'pm-cpufreq' and 'acpi-thermal'

* pm-cpufreq:
  cpufreq: cpu0: drop wrong devm usage
  cpufreq: remove race while accessing cur_policy

* acpi-thermal:
  ACPI / thermal: fix workqueue destroy order
...@@ -1278,8 +1278,8 @@ static int __init acpi_thermal_init(void) ...@@ -1278,8 +1278,8 @@ static int __init acpi_thermal_init(void)
static void __exit acpi_thermal_exit(void) static void __exit acpi_thermal_exit(void)
{ {
destroy_workqueue(acpi_thermal_pm_queue);
acpi_bus_unregister_driver(&acpi_thermal_driver); acpi_bus_unregister_driver(&acpi_thermal_driver);
destroy_workqueue(acpi_thermal_pm_queue);
return; return;
} }
......
...@@ -130,7 +130,7 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) ...@@ -130,7 +130,7 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
return -ENOENT; return -ENOENT;
} }
cpu_reg = devm_regulator_get_optional(cpu_dev, "cpu0"); cpu_reg = regulator_get_optional(cpu_dev, "cpu0");
if (IS_ERR(cpu_reg)) { if (IS_ERR(cpu_reg)) {
/* /*
* If cpu0 regulator supply node is present, but regulator is * If cpu0 regulator supply node is present, but regulator is
...@@ -145,23 +145,23 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) ...@@ -145,23 +145,23 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
PTR_ERR(cpu_reg)); PTR_ERR(cpu_reg));
} }
cpu_clk = devm_clk_get(cpu_dev, NULL); cpu_clk = clk_get(cpu_dev, NULL);
if (IS_ERR(cpu_clk)) { if (IS_ERR(cpu_clk)) {
ret = PTR_ERR(cpu_clk); ret = PTR_ERR(cpu_clk);
pr_err("failed to get cpu0 clock: %d\n", ret); pr_err("failed to get cpu0 clock: %d\n", ret);
goto out_put_node; goto out_put_reg;
} }
ret = of_init_opp_table(cpu_dev); ret = of_init_opp_table(cpu_dev);
if (ret) { if (ret) {
pr_err("failed to init OPP table: %d\n", ret); pr_err("failed to init OPP table: %d\n", ret);
goto out_put_node; goto out_put_clk;
} }
ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table);
if (ret) { if (ret) {
pr_err("failed to init cpufreq table: %d\n", ret); pr_err("failed to init cpufreq table: %d\n", ret);
goto out_put_node; goto out_put_clk;
} }
of_property_read_u32(np, "voltage-tolerance", &voltage_tolerance); of_property_read_u32(np, "voltage-tolerance", &voltage_tolerance);
...@@ -216,6 +216,12 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) ...@@ -216,6 +216,12 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
out_free_table: out_free_table:
dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table); dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
out_put_clk:
if (!IS_ERR(cpu_clk))
clk_put(cpu_clk);
out_put_reg:
if (!IS_ERR(cpu_reg))
regulator_put(cpu_reg);
out_put_node: out_put_node:
of_node_put(np); of_node_put(np);
return ret; return ret;
......
...@@ -366,6 +366,11 @@ int cpufreq_governor_dbs(struct cpufreq_policy *policy, ...@@ -366,6 +366,11 @@ int cpufreq_governor_dbs(struct cpufreq_policy *policy,
break; break;
case CPUFREQ_GOV_LIMITS: case CPUFREQ_GOV_LIMITS:
mutex_lock(&dbs_data->mutex);
if (!cpu_cdbs->cur_policy) {
mutex_unlock(&dbs_data->mutex);
break;
}
mutex_lock(&cpu_cdbs->timer_mutex); mutex_lock(&cpu_cdbs->timer_mutex);
if (policy->max < cpu_cdbs->cur_policy->cur) if (policy->max < cpu_cdbs->cur_policy->cur)
__cpufreq_driver_target(cpu_cdbs->cur_policy, __cpufreq_driver_target(cpu_cdbs->cur_policy,
...@@ -375,6 +380,7 @@ int cpufreq_governor_dbs(struct cpufreq_policy *policy, ...@@ -375,6 +380,7 @@ int cpufreq_governor_dbs(struct cpufreq_policy *policy,
policy->min, CPUFREQ_RELATION_L); policy->min, CPUFREQ_RELATION_L);
dbs_check_cpu(dbs_data, cpu); dbs_check_cpu(dbs_data, cpu);
mutex_unlock(&cpu_cdbs->timer_mutex); mutex_unlock(&cpu_cdbs->timer_mutex);
mutex_unlock(&dbs_data->mutex);
break; break;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment