Skip to contentSkip to conversation

speedstep-centrino: don't break on FFFFFFFF'ed frequencies

RFC PATCH New Dominik Brodowski 1 participant 1 message Sep 29, 2004

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 speedstep-centrino: don't break on FFFFFFFF'ed frequencies

Some BIOSes export invalid _PSS entries where all bits are set to one. While this is totally contrary to the ACPI specification, BIOS vendors try to tell userspace that these entries should not be considered or used. In order to not fail on such entries, the speedstep-centrino already contains a method to ignore these things. However, due to a wrong ordering of checks the driver aborts nonetheless. So move some checks around.

arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c +5 -2
diff -ruN linux-original/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c linux/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -415,6 +415,11 @@
 	cur_freq = get_cur_freq(policy->cpu);
 
 	for (i=0; i<p.state_count; i++) {
+		if (!p.states[i].core_frequency) {
+			centrino_model->op_points[i].frequency = CPUFREQ_ENTRY_INVALID;
+			continue;
+		}
+		
 		if (extract_clock(centrino_model->op_points[i].index) !=
 		    (centrino_model->op_points[i].frequency)) {
 			printk(KERN_DEBUG "Invalid encoded frequency\n");
@@ -424,8 +429,6 @@
 
 		if (cur_freq == centrino_model->op_points[i].frequency)
 			p.state = i;
-		if (!p.states[i].core_frequency)
-			centrino_model->op_points[i].frequency = CPUFREQ_ENTRY_INVALID;
 	}
 
 	return 0;