Commit 861745d1 authored by Dave Jones's avatar Dave Jones

[CPUFREQ] Cpufreq hotplug

From: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>
                                                                                                                                                                    
I was trying to fix this hotplug force migration issue in
cpu/cpufreq/acpi.c. As you suggested, it made more sense to do this in
cpufreq.c, so that we need not do this in multiple low level drivers.
How does this simple patch look. Beyond this, we may have to change some
documentation, to tell to all low level drivers that they can assume
hotplug lock will be taken, when they are in the target() routine.
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent e9b850eb
...@@ -722,7 +722,12 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, ...@@ -722,7 +722,12 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
unsigned int target_freq, unsigned int target_freq,
unsigned int relation) unsigned int relation)
{ {
return cpufreq_driver->target(policy, target_freq, relation); int retval = -EINVAL;
lock_cpu_hotplug();
if (cpu_online(policy->cpu))
retval = cpufreq_driver->target(policy, target_freq, relation);
unlock_cpu_hotplug();
return retval;
} }
EXPORT_SYMBOL_GPL(__cpufreq_driver_target); EXPORT_SYMBOL_GPL(__cpufreq_driver_target);
......
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