Skip to contentSkip to conversation

speedstep-centrino: properly set current state in ACPI struct

PATCH In review Dominik Brodowski 1 participant 1 message Feb 20, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 4/4 speedstep-centrino: properly set current state in ACPI struct

Properly set the current state in the ACPI data so that it reflects the actual CPU speed.

 arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c |    5 +++++
 1 files changed, 5 insertions(+)
arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c +5 -0
diff -ruN linux-original/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c linux/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -263,6 +263,7 @@
 	union acpi_object		arg0 = {ACPI_TYPE_BUFFER};
 	u32				arg0_buf[3];
 	struct acpi_object_list 	arg_list = {1, &arg0};
+	unsigned long			cur_freq;
 	int				result = 0, i;
 
 	/* _PDC settings */
@@ -329,9 +330,13 @@
                 goto err_kfree;
         }
 
+	cur_freq = get_cur_freq();
+
         for (i=0; i<p.state_count; i++) {
 		centrino_model->op_points[i].index = p.states[i].control;
 		centrino_model->op_points[i].frequency = p.states[i].core_frequency * 1000;
+		if (cur_freq == centrino_model->op_points[i].frequency)
+			p.state = i;
 	}
 	centrino_model->op_points[p.state_count].frequency = CPUFREQ_TABLE_END;