Skip to contentSkip to conversation

Bugfixes for 2.5.73 cpufreq/acpi.c

PATCH New David Moore 1 participant 1 message Jun 24, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bugfixes for 2.5.73 cpufreq/acpi.c

Here are a few bug fixes to the ACPI cpufreq driver in 2.5.73. The first two hunks, I am fairly confident that the fix is correct. The first fixes a NULL dereference occurs when /proc/acpi/processor/.../performance is written to. The second fixes a bug that causes cpufreq to set the wrong frequencies if the platform limit is non-zero. The third applies the platform limit to be the performance limit for ACPI. This should probably be initialized by a call to acpi_processor_apply_limit(), but there is no convenient way to call that from cpufreq/acpi.c. If someone else has a better fix in mind, please do that instead.

Regards,

David

arch/i386/kernel/cpu/cpufreq/acpi.c renamed from arch/i386/kernel/cpu/cpufreq/acpi.c.orig +6 -2
@@ -385,7 +385,8 @@
         loff_t			*data)
 {
 	int			result = 0;
-	struct acpi_processor	*pr = (struct acpi_processor *) data;
+	struct seq_file		*m = (struct seq_file *) file->private_data;
+	struct acpi_processor	*pr = (struct acpi_processor *) m->private;
 	char			state_string[12] = {'\0'};
 	unsigned int            new_state = 0;
 	struct cpufreq_policy   policy;
@@ -484,7 +485,8 @@
 	if (result)
 		return_VALUE(result);
 
-	result = acpi_processor_set_performance (perf, next_state);
+	result = acpi_processor_set_performance (perf,
+		next_state + perf->pr->limit.state.px);
 
 	return_VALUE(result);
 }
@@ -680,6 +682,8 @@
 	goto err0;
 
  found_capable_cpu:
+
+	pr->limit.state.px = pr->performance_platform_limit;
 	
  	result = cpufreq_register_driver(&acpi_cpufreq_driver);
 	if (result)