aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/cpufreq/cpufreq.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 4b8c7f297d74..2d53f47d1747 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1729,18 +1729,23 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data,
1729 /* end old governor */ 1729 /* end old governor */
1730 if (data->governor) { 1730 if (data->governor) {
1731 __cpufreq_governor(data, CPUFREQ_GOV_STOP); 1731 __cpufreq_governor(data, CPUFREQ_GOV_STOP);
1732 unlock_policy_rwsem_write(policy->cpu);
1732 __cpufreq_governor(data, 1733 __cpufreq_governor(data,
1733 CPUFREQ_GOV_POLICY_EXIT); 1734 CPUFREQ_GOV_POLICY_EXIT);
1735 lock_policy_rwsem_write(policy->cpu);
1734 } 1736 }
1735 1737
1736 /* start new governor */ 1738 /* start new governor */
1737 data->governor = policy->governor; 1739 data->governor = policy->governor;
1738 if (!__cpufreq_governor(data, CPUFREQ_GOV_POLICY_INIT)) { 1740 if (!__cpufreq_governor(data, CPUFREQ_GOV_POLICY_INIT)) {
1739 if (!__cpufreq_governor(data, CPUFREQ_GOV_START)) 1741 if (!__cpufreq_governor(data, CPUFREQ_GOV_START)) {
1740 failed = 0; 1742 failed = 0;
1741 else 1743 } else {
1744 unlock_policy_rwsem_write(policy->cpu);
1742 __cpufreq_governor(data, 1745 __cpufreq_governor(data,
1743 CPUFREQ_GOV_POLICY_EXIT); 1746 CPUFREQ_GOV_POLICY_EXIT);
1747 lock_policy_rwsem_write(policy->cpu);
1748 }
1744 } 1749 }
1745 1750
1746 if (failed) { 1751 if (failed) {