public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix processor_get_freq
@ 2007-08-13 21:49 Alex Williamson
  2007-08-15  2:25 ` Pallipadi, Venkatesh
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Williamson @ 2007-08-13 21:49 UTC (permalink / raw)
  To: linux-ia64


   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.  Thanks,

	Alex

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
---

diff -r 1559df81a153 arch/ia64/kernel/cpufreq/acpi-cpufreq.c
--- a/arch/ia64/kernel/cpufreq/acpi-cpufreq.c	Mon Aug 13 05:00:33 2007 +0000
+++ b/arch/ia64/kernel/cpufreq/acpi-cpufreq.c	Mon Aug 13 15:41:29 2007 -0600
@@ -113,10 +113,8 @@ processor_get_freq (
 
 	saved_mask = current->cpus_allowed;
 	set_cpus_allowed(current, cpumask_of_cpu(cpu));
-	if (smp_processor_id() != cpu) {
-		ret = -EAGAIN;
+	if (smp_processor_id() != cpu)
 		goto migrate_end;
-	}
 
 	/* processor_get_pstate gets the instantaneous frequency */
 	ret = processor_get_pstate(&value);
@@ -125,7 +123,7 @@ processor_get_freq (
 		set_cpus_allowed(current, saved_mask);
 		printk(KERN_WARNING "get performance failed with error %d\n",
 		       ret);
-		ret = -EAGAIN;
+		ret = 0;
 		goto migrate_end;
 	}
 	clock_freq = extract_clock(data, value, cpu);



^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH] Fix processor_get_freq
  2007-08-13 21:49 [PATCH] Fix processor_get_freq Alex Williamson
@ 2007-08-15  2:25 ` Pallipadi, Venkatesh
  0 siblings, 0 replies; 2+ messages in thread
From: Pallipadi, Venkatesh @ 2007-08-15  2:25 UTC (permalink / raw)
  To: linux-ia64


Ack.

Thanks,
Venki 

>-----Original Message-----
>From: linux-ia64-owner@vger.kernel.org 
>[mailto:linux-ia64-owner@vger.kernel.org] On Behalf Of Alex Williamson
>Sent: Monday, August 13, 2007 2:50 PM
>To: Pallipadi, Venkatesh
>Cc: linux-ia64
>Subject: [PATCH] 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.  Thanks,
>
>	Alex
>
>Signed-off-by: Alex Williamson <alex.williamson@hp.com>
>---
>
>diff -r 1559df81a153 arch/ia64/kernel/cpufreq/acpi-cpufreq.c
>--- a/arch/ia64/kernel/cpufreq/acpi-cpufreq.c	Mon Aug 13 
>05:00:33 2007 +0000
>+++ b/arch/ia64/kernel/cpufreq/acpi-cpufreq.c	Mon Aug 13 
>15:41:29 2007 -0600
>@@ -113,10 +113,8 @@ processor_get_freq (
> 
> 	saved_mask = current->cpus_allowed;
> 	set_cpus_allowed(current, cpumask_of_cpu(cpu));
>-	if (smp_processor_id() != cpu) {
>-		ret = -EAGAIN;
>+	if (smp_processor_id() != cpu)
> 		goto migrate_end;
>-	}
> 
> 	/* processor_get_pstate gets the instantaneous frequency */
> 	ret = processor_get_pstate(&value);
>@@ -125,7 +123,7 @@ processor_get_freq (
> 		set_cpus_allowed(current, saved_mask);
> 		printk(KERN_WARNING "get performance failed 
>with error %d\n",
> 		       ret);
>-		ret = -EAGAIN;
>+		ret = 0;
> 		goto migrate_end;
> 	}
> 	clock_freq = extract_clock(data, value, cpu);
>
>
>-
>To unsubscribe from this list: send the line "unsubscribe 
>linux-ia64" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-15  2:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-13 21:49 [PATCH] Fix processor_get_freq Alex Williamson
2007-08-15  2:25 ` Pallipadi, Venkatesh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox