Skip to contentSkip to conversation

Unify ACPI bits on speedstep-centrino and acpi-cpufreq

PATCH In review Venkatesh Pallipadi 1 participant 2 messages Sep 1, 2006 – Sep 23, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 5/5 Unify ACPI bits on speedstep-centrino and acpi-cpufreq

Only change the frequency if the state previously set is different from what we are trying to set. We don't really have to get the current frequency at this point.

arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c +3 -4
Index: linux-2.6.18-rc4/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
===================================================================
@@ -325,11 +325,8 @@ static int acpi_cpufreq_target(struct cp
 	online_policy_cpus = policy->cpus;
 #endif
 
-	cmd.val = get_cur_val(online_policy_cpus);
-	freqs.old = extract_freq(cmd.val, data);
-	freqs.new = data->freq_table[next_state].frequency;
 	next_perf_state = data->freq_table[next_state].index;
-	if (freqs.new == freqs.old) {
+	if (perf->state == next_perf_state) {
 		if (unlikely(data->resume)) {
 			dprintk("Called after resume, resetting to P%d\n",
 				next_perf_state);
@@ -367,6 +364,8 @@ static int acpi_cpufreq_target(struct cp
 	else
 		cpu_set(policy->cpu, cmd.mask);
 
+	freqs.old = data->freq_table[perf->state].frequency;
+	freqs.new = data->freq_table[next_perf_state].frequency;
 	for_each_cpu_mask(i, cmd.mask) {
 		freqs.cpu = i;
 		cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
#1 lore raw

PATCH 1/1 acpi-cpufreq: Make cpuinfo_cur_freq work again

Recent speedstep-centrino unification onto acpi-cpufreq patchset broke cpuinfo_cur_freq interface in /sys/../cpuinfo/, when MSR was used for transitions. Attached patch fixes that breakage.

Applies over the patchset with subject
Unify ACPI bits on speedstep-centrino and acpi-cpufreq

arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c +4 -1
Index: linux-2.6.18-rc4/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
===================================================================
@@ -102,10 +102,13 @@ static unsigned extract_io(u32 value, st
 static unsigned extract_msr(u32 msr, struct acpi_cpufreq_data *data)
 {
 	int i;
+	struct acpi_processor_performance *perf;
 
 	msr &= INTEL_MSR_RANGE;
+	perf = data->acpi_data;
+
 	for (i = 0; data->freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-		if (msr == data->freq_table[i].index)
+		if (msr == perf->states[data->freq_table[i].index].status)
 			return data->freq_table[i].frequency;
 	}
 	return data->freq_table[0].frequency;