aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/cpufreq/cpufreq.c37
-rw-r--r--drivers/cpufreq/intel_pstate.c5
-rw-r--r--drivers/cpuidle/cpuidle-calxeda.c2
3 files changed, 29 insertions, 15 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 16d7b4ac94be..8d19f7c06010 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -839,9 +839,6 @@ static void cpufreq_init_policy(struct cpufreq_policy *policy)
839 839
840 /* set default policy */ 840 /* set default policy */
841 ret = cpufreq_set_policy(policy, &new_policy); 841 ret = cpufreq_set_policy(policy, &new_policy);
842 policy->user_policy.policy = policy->policy;
843 policy->user_policy.governor = policy->governor;
844
845 if (ret) { 842 if (ret) {
846 pr_debug("setting policy failed\n"); 843 pr_debug("setting policy failed\n");
847 if (cpufreq_driver->exit) 844 if (cpufreq_driver->exit)
@@ -1016,15 +1013,17 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif,
1016 read_unlock_irqrestore(&cpufreq_driver_lock, flags); 1013 read_unlock_irqrestore(&cpufreq_driver_lock, flags);
1017#endif 1014#endif
1018 1015
1019 if (frozen) 1016 /*
1020 /* Restore the saved policy when doing light-weight init */ 1017 * Restore the saved policy when doing light-weight init and fall back
1021 policy = cpufreq_policy_restore(cpu); 1018 * to the full init if that fails.
1022 else 1019 */
1020 policy = frozen ? cpufreq_policy_restore(cpu) : NULL;
1021 if (!policy) {
1022 frozen = false;
1023 policy = cpufreq_policy_alloc(); 1023 policy = cpufreq_policy_alloc();
1024 1024 if (!policy)
1025 if (!policy) 1025 goto nomem_out;
1026 goto nomem_out; 1026 }
1027
1028 1027
1029 /* 1028 /*
1030 * In the resume path, since we restore a saved policy, the assignment 1029 * In the resume path, since we restore a saved policy, the assignment
@@ -1069,8 +1068,10 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif,
1069 */ 1068 */
1070 cpumask_and(policy->cpus, policy->cpus, cpu_online_mask); 1069 cpumask_and(policy->cpus, policy->cpus, cpu_online_mask);
1071 1070
1072 policy->user_policy.min = policy->min; 1071 if (!frozen) {
1073 policy->user_policy.max = policy->max; 1072 policy->user_policy.min = policy->min;
1073 policy->user_policy.max = policy->max;
1074 }
1074 1075
1075 blocking_notifier_call_chain(&cpufreq_policy_notifier_list, 1076 blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
1076 CPUFREQ_START, policy); 1077 CPUFREQ_START, policy);
@@ -1101,6 +1102,11 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif,
1101 1102
1102 cpufreq_init_policy(policy); 1103 cpufreq_init_policy(policy);
1103 1104
1105 if (!frozen) {
1106 policy->user_policy.policy = policy->policy;
1107 policy->user_policy.governor = policy->governor;
1108 }
1109
1104 kobject_uevent(&policy->kobj, KOBJ_ADD); 1110 kobject_uevent(&policy->kobj, KOBJ_ADD);
1105 up_read(&cpufreq_rwsem); 1111 up_read(&cpufreq_rwsem);
1106 1112
@@ -1118,8 +1124,11 @@ err_get_freq:
1118 if (cpufreq_driver->exit) 1124 if (cpufreq_driver->exit)
1119 cpufreq_driver->exit(policy); 1125 cpufreq_driver->exit(policy);
1120err_set_policy_cpu: 1126err_set_policy_cpu:
1121 if (frozen) 1127 if (frozen) {
1128 /* Do not leave stale fallback data behind. */
1129 per_cpu(cpufreq_cpu_data_fallback, cpu) = NULL;
1122 cpufreq_policy_put_kobj(policy); 1130 cpufreq_policy_put_kobj(policy);
1131 }
1123 cpufreq_policy_free(policy); 1132 cpufreq_policy_free(policy);
1124 1133
1125nomem_out: 1134nomem_out:
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 5f1cbae36961..f9d561e198ab 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -614,6 +614,11 @@ static int intel_pstate_init_cpu(unsigned int cpunum)
614 cpu = all_cpu_data[cpunum]; 614 cpu = all_cpu_data[cpunum];
615 615
616 intel_pstate_get_cpu_pstates(cpu); 616 intel_pstate_get_cpu_pstates(cpu);
617 if (!cpu->pstate.current_pstate) {
618 all_cpu_data[cpunum] = NULL;
619 kfree(cpu);
620 return -ENODATA;
621 }
617 622
618 cpu->cpu = cpunum; 623 cpu->cpu = cpunum;
619 624
diff --git a/drivers/cpuidle/cpuidle-calxeda.c b/drivers/cpuidle/cpuidle-calxeda.c
index 36795639df0d..6e51114057d0 100644
--- a/drivers/cpuidle/cpuidle-calxeda.c
+++ b/drivers/cpuidle/cpuidle-calxeda.c
@@ -65,7 +65,7 @@ static struct cpuidle_driver calxeda_idle_driver = {
65 .state_count = 2, 65 .state_count = 2,
66}; 66};
67 67
68static int __init calxeda_cpuidle_probe(struct platform_device *pdev) 68static int calxeda_cpuidle_probe(struct platform_device *pdev)
69{ 69{
70 return cpuidle_register(&calxeda_idle_driver, NULL); 70 return cpuidle_register(&calxeda_idle_driver, NULL);
71} 71}