public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ACPI thermal: Don't invalidate thermal zone if critical trip point is bad
@ 2010-02-16 21:55 Thomas Renninger
  2010-02-16 21:55 ` [PATCH 2/2] ACPI thermal: Check for thermal zone requirement Thomas Renninger
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Thomas Renninger @ 2010-02-16 21:55 UTC (permalink / raw)
  To: linux-acpi; +Cc: Thomas Renninger, Len Brown

Some BIOSes return a negative value for the critical trip point.
We currently invalidate the whole thermal zone in this case.
But it may still be needed for cooling, also without critical
trip point:


Same if there is no critical trip point, but ACPI spec says
there must at least be one trip point, it need not to be a
critical (see next patch).

Reference: http://bugzilla.novell.com/show_bug.cgi?id=531547

Signed-off-by: Thomas Renninger <trenn@suse.de>
Tested-by: clarkt@cnsp.com
CC: Len Brown <lenb@kernel.org>
CC: linux-acpi@vger.kernel.org
---
 drivers/acpi/thermal.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 9073ada..8fa71b8 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -368,7 +368,7 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
 	int valid = 0;
 	int i;
 
-	/* Critical Shutdown (required) */
+	/* Critical Shutdown */
 	if (flag & ACPI_TRIPS_CRITICAL) {
 		status = acpi_evaluate_integer(tz->device->handle,
 				"_CRT", NULL, &tmp);
@@ -379,17 +379,19 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
 		 * Below zero (Celsius) values clearly aren't right for sure..
 		 * ... so lets discard those as invalid.
 		 */
-		if (ACPI_FAILURE(status) ||
-				tz->trips.critical.temperature <= 2732) {
+		if (ACPI_FAILURE(status)) {
+			tz->trips.critical.flags.valid = 0;
+			ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+					  "No critical threshold\n"));
+		} else if (tmp <= 2732) {
+			printk(KERN_WARNING FW_BUG "Invalid critical threshold "
+			       "(_CRT:%)\n", tmp);
 			tz->trips.critical.flags.valid = 0;
-			ACPI_EXCEPTION((AE_INFO, status,
-					"No or invalid critical threshold"));
-			return -ENODEV;
 		} else {
 			tz->trips.critical.flags.valid = 1;
 			ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-					"Found critical threshold [%lu]\n",
-					tz->trips.critical.temperature));
+					  "Found critical threshold [%lu]\n",
+					  tz->trips.critical.temperature));
 		}
 		if (tz->trips.critical.flags.valid == 1) {
 			if (crt == -1) {
-- 
1.6.3


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2010-02-22  1:34 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-16 21:55 [PATCH 1/2] ACPI thermal: Don't invalidate thermal zone if critical trip point is bad Thomas Renninger
2010-02-16 21:55 ` [PATCH 2/2] ACPI thermal: Check for thermal zone requirement Thomas Renninger
2010-02-19  6:39   ` [PATCH 2/2] ACPI thermal: Check for thermal zone requiremen Len Brown
2010-02-19 11:20     ` Thomas Renninger
2010-02-19 16:20       ` Len Brown
2010-02-19 16:37         ` Thomas Renninger
2010-02-20  4:57           ` Len Brown
2010-02-20  9:50             ` Thomas Renninger
2010-02-20 10:15         ` Thomas Renninger
2010-02-19  6:34 ` [PATCH 1/2] ACPI thermal: Don't invalidate thermal zone if critical trip point is bad Len Brown
2010-02-19  7:34   ` Len Brown
2010-02-20 10:20     ` [PATCH] " Thomas Renninger
2010-02-20 10:42       ` Thomas Renninger
2010-02-20 10:44 ` Thomas Renninger
2010-02-21  2:51   ` Zhang Rui
     [not found]     ` <201002220002.49341.trenn@suse.de>
2010-02-22  1:33       ` Zhang Rui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox