aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ia64/kernel/cpufreq/acpi-cpufreq.c11
-rw-r--r--include/asm-ia64/pal.h9
2 files changed, 11 insertions, 9 deletions
diff --git a/arch/ia64/kernel/cpufreq/acpi-cpufreq.c b/arch/ia64/kernel/cpufreq/acpi-cpufreq.c
index 86faf221a070..088f130197ae 100644
--- a/arch/ia64/kernel/cpufreq/acpi-cpufreq.c
+++ b/arch/ia64/kernel/cpufreq/acpi-cpufreq.c
@@ -68,7 +68,8 @@ processor_get_pstate (
68 68
69 dprintk("processor_get_pstate\n"); 69 dprintk("processor_get_pstate\n");
70 70
71 retval = ia64_pal_get_pstate(&pstate_index); 71 retval = ia64_pal_get_pstate(&pstate_index,
72 PAL_GET_PSTATE_TYPE_INSTANT);
72 *value = (u32) pstate_index; 73 *value = (u32) pstate_index;
73 74
74 if (retval) 75 if (retval)
@@ -91,7 +92,7 @@ extract_clock (
91 dprintk("extract_clock\n"); 92 dprintk("extract_clock\n");
92 93
93 for (i = 0; i < data->acpi_data.state_count; i++) { 94 for (i = 0; i < data->acpi_data.state_count; i++) {
94 if (value >= data->acpi_data.states[i].control) 95 if (value == data->acpi_data.states[i].status)
95 return data->acpi_data.states[i].core_frequency; 96 return data->acpi_data.states[i].core_frequency;
96 } 97 }
97 return data->acpi_data.states[i-1].core_frequency; 98 return data->acpi_data.states[i-1].core_frequency;
@@ -117,11 +118,7 @@ processor_get_freq (
117 goto migrate_end; 118 goto migrate_end;
118 } 119 }
119 120
120 /* 121 /* processor_get_pstate gets the instantaneous frequency */
121 * processor_get_pstate gets the average frequency since the
122 * last get. So, do two PAL_get_freq()...
123 */
124 ret = processor_get_pstate(&value);
125 ret = processor_get_pstate(&value); 122 ret = processor_get_pstate(&value);
126 123
127 if (ret) { 124 if (ret) {
diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h
index 308e94f6299e..bc768153f3c9 100644
--- a/include/asm-ia64/pal.h
+++ b/include/asm-ia64/pal.h
@@ -84,6 +84,11 @@
84#define PAL_SET_PSTATE 263 /* set the P-state */ 84#define PAL_SET_PSTATE 263 /* set the P-state */
85#define PAL_BRAND_INFO 274 /* Processor branding information */ 85#define PAL_BRAND_INFO 274 /* Processor branding information */
86 86
87#define PAL_GET_PSTATE_TYPE_LASTSET 0
88#define PAL_GET_PSTATE_TYPE_AVGANDRESET 1
89#define PAL_GET_PSTATE_TYPE_AVGNORESET 2
90#define PAL_GET_PSTATE_TYPE_INSTANT 3
91
87#ifndef __ASSEMBLY__ 92#ifndef __ASSEMBLY__
88 93
89#include <linux/types.h> 94#include <linux/types.h>
@@ -1141,10 +1146,10 @@ ia64_pal_halt_info (pal_power_mgmt_info_u_t *power_buf)
1141 1146
1142/* Get the current P-state information */ 1147/* Get the current P-state information */
1143static inline s64 1148static inline s64
1144ia64_pal_get_pstate (u64 *pstate_index) 1149ia64_pal_get_pstate (u64 *pstate_index, unsigned long type)
1145{ 1150{
1146 struct ia64_pal_retval iprv; 1151 struct ia64_pal_retval iprv;
1147 PAL_CALL_STK(iprv, PAL_GET_PSTATE, 0, 0, 0); 1152 PAL_CALL_STK(iprv, PAL_GET_PSTATE, type, 0, 0);
1148 *pstate_index = iprv.v0; 1153 *pstate_index = iprv.v0;
1149 return iprv.status; 1154 return iprv.status;
1150} 1155}