All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix polling policy in the absence of _TZP
@ 2008-05-14  1:00 Matthew Garrett
  2008-05-14  1:03 ` [PATCH 1/2] Add a list of processor objects to the ACPI core Matthew Garrett
  2008-05-14  3:19 ` [PATCH] Fix polling policy in the absence of _TZP Len Brown
  0 siblings, 2 replies; 17+ messages in thread
From: Matthew Garrett @ 2008-05-14  1:00 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi

Fix Linux to conform to 11.3.18 of the ACPI spec 3.0. In the absence of 
a _TZP method, we should be polling at a default frequency. While it can 
be argued that "0" is a default frequency, I don't think that's what the 
spec authors had in mind.

Signed-off-by: Matthew Garrett <mjg@redhat.com>

---

Arguably this should be implemented in such a way that the polling rate 
increases as the temperature rises and drops if the trend is downwards. 
That would give higher resolution when we're heading towards a trip 
point, without any significant increase in power consumption since 
increased temperatures imply that the CPU is probably not idle.

diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 504385b..93cb3e8 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -846,10 +846,11 @@ static void acpi_thermal_check(void *data)
 	 * Calculate Sleep Time
 	 * --------------------
 	 * If we're in the passive state, use _TSP's value.  Otherwise
-	 * use the default polling frequency (e.g. _TZP).  If no polling
-	 * frequency is specified then we'll wait forever (at least until
-	 * a thermal event occurs).  Note that _TSP and _TZD values are
-	 * given in 1/10th seconds (we must covert to milliseconds).
+	 * use the default polling frequency (e.g. _TZP).  If no
+	 * polling frequency is specified then we'll wait 10 seconds
+	 * (or until a thermal event occurs).  Note that _TSP and _TZD
+	 * values are given in 1/10th seconds (we must covert to
+	 * milliseconds).
 	 */
 	if (tz->state.passive) {
 		sleep_time = tz->trips.passive.tsp * 100;
@@ -1575,8 +1576,9 @@ static int acpi_thermal_get_info(struct acpi_thermal *tz)
 	/* Get default polling frequency [_TZP] (optional) */
 	if (tzp)
 		tz->polling_frequency = tzp;
-	else
-		acpi_thermal_get_polling_frequency(tz);
+	else if (acpi_thermal_get_polling_frequency(tz) == -ENODEV)
+		/* If no _TZP, default to polling every 10 seconds */
+		tz->polling_frequency = 100;
 
 	return 0;
 }

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

end of thread, other threads:[~2008-05-15 12:03 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-14  1:00 [PATCH] Fix polling policy in the absence of _TZP Matthew Garrett
2008-05-14  1:03 ` [PATCH 1/2] Add a list of processor objects to the ACPI core Matthew Garrett
2008-05-14  1:08   ` [PATCH 2/2] Add a passive cooling trip point if the firmware doesn't define one Matthew Garrett
2008-05-14  3:30     ` Len Brown
2008-05-14  9:33       ` Matthew Garrett
2008-05-14 15:37         ` Len Brown
2008-05-14 23:01           ` Matthew Garrett
2008-05-15  0:55         ` Zhang Rui
2008-05-15  1:04           ` Matthew Garrett
     [not found]             ` <1210814699.2929.10.camel@rzhang-crestline.sh.intel.com>
     [not found]               ` <20080515015831.GA14829@srcf.ucam.org>
2008-05-15  2:15                 ` Zhang Rui
2008-05-15  2:24                   ` Matthew Garrett
2008-05-15  3:06                     ` Zhang Rui
2008-05-15 11:40                       ` Matthew Garrett
2008-05-15 11:47       ` Andi Kleen
2008-05-15 12:02         ` Matthew Garrett
2008-05-14  3:19 ` [PATCH] Fix polling policy in the absence of _TZP Len Brown
2008-05-14 10:14   ` Matthew Garrett

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.