[PATCH 3/3] CPUFREQ: processor.ko: Try to detect old BIOS, not supporting CPU freq on a recent CPU.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Thomas Renninger
Date: Wednesday, August 27, 2008 - 6:27 am

On Intel CPUs it is rather common and a good hint that BIOSes which do provide
_PPC func, but not the frequencies itself in _PSS function, are old and need
to be updated for CPU freq support.
Tell the user he has a BIOS/firmware problem.

Signed-off-by: Thomas Renninger <trenn@suse.de>
---
 drivers/acpi/processor_perflib.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 0133af4..3a2886f 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -38,6 +38,7 @@
 
 #include <asm/uaccess.h>
 #endif
+#include <asm/cpufeature.h>
 
 #include <acpi/acpi_bus.h>
 #include <acpi/processor.h>
@@ -334,7 +335,6 @@ static int acpi_processor_get_performance_info(struct acpi_processor *pr)
 	acpi_status status = AE_OK;
 	acpi_handle handle = NULL;
 
-
 	if (!pr || !pr->performance || !pr->handle)
 		return -EINVAL;
 
@@ -347,13 +347,25 @@ static int acpi_processor_get_performance_info(struct acpi_processor *pr)
 
 	result = acpi_processor_get_performance_control(pr);
 	if (result)
-		return result;
+		goto update_bios;
 
 	result = acpi_processor_get_performance_states(pr);
 	if (result)
-		return result;
+		goto update_bios;
 
 	return 0;
+
+	/*
+	 * Having _PPC but missing frequencies (_PSS, _PCT) is a very good hint that
+	 * the BIOS is older than the CPU and does not know its frequencies
+	 */
+ update_bios:
+	if (ACPI_SUCCESS(acpi_get_handle(pr->handle, "_PPC", &handle))){
+		if(boot_cpu_has(X86_FEATURE_EST))
+			printk(KERN_WARNING FW_BUG "BIOS needs update for CPU "
+			       "frequency support\n");
+	}
+	return result;
 }
 
 int acpi_processor_notify_smm(struct module *calling_module)
-- 
1.5.4.5

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] Introduce interface to report BIOS bugs, Thomas Renninger, (Wed Aug 20, 10:02 am)
[PATCH 1/3] Introduce interface to report BIOS bugs, Thomas Renninger, (Wed Aug 20, 10:02 am)
[PATCH 2/3] Powernow-k8: Make use of firmware bug report i ..., Thomas Renninger, (Wed Aug 20, 10:02 am)
[PATCH 3/3] acpi-cpufreq: Make use of firmware bug report ..., Thomas Renninger, (Wed Aug 20, 10:02 am)
Re: [PATCH 1/3] Introduce interface to report BIOS bugs, Bjorn Helgaas, (Wed Aug 20, 11:37 am)
Re: [PATCH 1/3] Introduce interface to report BIOS bugs, Thomas Renninger, (Thu Aug 21, 6:52 am)
Re: [PATCH 1/3] Introduce interface to report BIOS bugs, Bjorn Helgaas, (Thu Aug 21, 8:19 am)
Re: [PATCH 1/3] Introduce interface to report BIOS bugs, Pavel Machek, (Fri Aug 22, 3:19 am)
Introduce interface to report BIOS bugs (reworked, FW_BUG ..., Thomas Renninger, (Wed Aug 27, 6:27 am)
[PATCH 2/3] CPUFREQ: powernow-k8: Try to detect old BIOS, ..., Thomas Renninger, (Wed Aug 27, 6:27 am)
[PATCH 3/3] CPUFREQ: processor.ko: Try to detect old BIOS, ..., Thomas Renninger, (Wed Aug 27, 6:27 am)