Commit 182fdd22 authored by Alex Williamson's avatar Alex Williamson Committed by Tony Luck

[IA64] Fix processor_get_freq

The core cpufreq code doesn't appear to understand returning -EAGAIN
for the get() function of the cpufreq_driver.  If PAL_GET_PSTATE returns
-1, such as when running on Xen, scaling_cur_freq is happy to return
4294967285 kHz (ie. (unsigned)-11).  The other drivers appear to return
0 for a failure, and doing so gives me the max frequency from
scaling_cur_frequency and "<unknown>" from cpuinfo_cur_frequency.  I
believe that's the desired behavior.
Signed-off-by: default avatarAlex Williamson <alex.williamson@hp.com>
Acked-by: default avatarVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 352b0ef5
...@@ -113,10 +113,8 @@ processor_get_freq ( ...@@ -113,10 +113,8 @@ processor_get_freq (
saved_mask = current->cpus_allowed; saved_mask = current->cpus_allowed;
set_cpus_allowed(current, cpumask_of_cpu(cpu)); set_cpus_allowed(current, cpumask_of_cpu(cpu));
if (smp_processor_id() != cpu) { if (smp_processor_id() != cpu)
ret = -EAGAIN;
goto migrate_end; goto migrate_end;
}
/* processor_get_pstate gets the instantaneous frequency */ /* processor_get_pstate gets the instantaneous frequency */
ret = processor_get_pstate(&value); ret = processor_get_pstate(&value);
...@@ -125,7 +123,7 @@ processor_get_freq ( ...@@ -125,7 +123,7 @@ processor_get_freq (
set_cpus_allowed(current, saved_mask); set_cpus_allowed(current, saved_mask);
printk(KERN_WARNING "get performance failed with error %d\n", printk(KERN_WARNING "get performance failed with error %d\n",
ret); ret);
ret = -EAGAIN; ret = 0;
goto migrate_end; goto migrate_end;
} }
clock_freq = extract_clock(data, value, cpu); clock_freq = extract_clock(data, value, cpu);
......
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