Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a405fe9 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branches 'pm-cpufreq' and 'pm-cpuidle'

* pm-cpufreq:
  intel_pstate: Fail initialization if P-state information is missing
  cpufreq: preserve user_policy across suspend/resume
  cpufreq: Clean up after a failing light-weight initialization

* pm-cpuidle:
  ARM/cpuidle: remove __init tag from Calxeda cpuidle probe function
Loading
Loading
Loading
Loading
+23 −14
Original line number Original line Diff line number Diff line
@@ -839,9 +839,6 @@ static void cpufreq_init_policy(struct cpufreq_policy *policy)


	/* set default policy */
	/* set default policy */
	ret = cpufreq_set_policy(policy, &new_policy);
	ret = cpufreq_set_policy(policy, &new_policy);
	policy->user_policy.policy = policy->policy;
	policy->user_policy.governor = policy->governor;

	if (ret) {
	if (ret) {
		pr_debug("setting policy failed\n");
		pr_debug("setting policy failed\n");
		if (cpufreq_driver->exit)
		if (cpufreq_driver->exit)
@@ -1016,15 +1013,17 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif,
	read_unlock_irqrestore(&cpufreq_driver_lock, flags);
	read_unlock_irqrestore(&cpufreq_driver_lock, flags);
#endif
#endif


	if (frozen)
	/*
		/* Restore the saved policy when doing light-weight init */
	 * Restore the saved policy when doing light-weight init and fall back
		policy = cpufreq_policy_restore(cpu);
	 * to the full init if that fails.
	else
	 */
	policy = frozen ? cpufreq_policy_restore(cpu) : NULL;
	if (!policy) {
		frozen = false;
		policy = cpufreq_policy_alloc();
		policy = cpufreq_policy_alloc();

		if (!policy)
		if (!policy)
			goto nomem_out;
			goto nomem_out;

	}


	/*
	/*
	 * In the resume path, since we restore a saved policy, the assignment
	 * 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,
	 */
	 */
	cpumask_and(policy->cpus, policy->cpus, cpu_online_mask);
	cpumask_and(policy->cpus, policy->cpus, cpu_online_mask);


	if (!frozen) {
		policy->user_policy.min = policy->min;
		policy->user_policy.min = policy->min;
		policy->user_policy.max = policy->max;
		policy->user_policy.max = policy->max;
	}


	blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
	blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
				     CPUFREQ_START, policy);
				     CPUFREQ_START, policy);
@@ -1101,6 +1102,11 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif,


	cpufreq_init_policy(policy);
	cpufreq_init_policy(policy);


	if (!frozen) {
		policy->user_policy.policy = policy->policy;
		policy->user_policy.governor = policy->governor;
	}

	kobject_uevent(&policy->kobj, KOBJ_ADD);
	kobject_uevent(&policy->kobj, KOBJ_ADD);
	up_read(&cpufreq_rwsem);
	up_read(&cpufreq_rwsem);


@@ -1118,8 +1124,11 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif,
	if (cpufreq_driver->exit)
	if (cpufreq_driver->exit)
		cpufreq_driver->exit(policy);
		cpufreq_driver->exit(policy);
err_set_policy_cpu:
err_set_policy_cpu:
	if (frozen)
	if (frozen) {
		/* Do not leave stale fallback data behind. */
		per_cpu(cpufreq_cpu_data_fallback, cpu) = NULL;
		cpufreq_policy_put_kobj(policy);
		cpufreq_policy_put_kobj(policy);
	}
	cpufreq_policy_free(policy);
	cpufreq_policy_free(policy);


nomem_out:
nomem_out:
+5 −0
Original line number Original line Diff line number Diff line
@@ -614,6 +614,11 @@ static int intel_pstate_init_cpu(unsigned int cpunum)
	cpu = all_cpu_data[cpunum];
	cpu = all_cpu_data[cpunum];


	intel_pstate_get_cpu_pstates(cpu);
	intel_pstate_get_cpu_pstates(cpu);
	if (!cpu->pstate.current_pstate) {
		all_cpu_data[cpunum] = NULL;
		kfree(cpu);
		return -ENODATA;
	}


	cpu->cpu = cpunum;
	cpu->cpu = cpunum;


+1 −1
Original line number Original line Diff line number Diff line
@@ -65,7 +65,7 @@ static struct cpuidle_driver calxeda_idle_driver = {
	.state_count = 2,
	.state_count = 2,
};
};


static int __init calxeda_cpuidle_probe(struct platform_device *pdev)
static int calxeda_cpuidle_probe(struct platform_device *pdev)
{
{
	return cpuidle_register(&calxeda_idle_driver, NULL);
	return cpuidle_register(&calxeda_idle_driver, NULL);
}
}