Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=223630fe3dc564b94e51ff4eb839828c9083f2f6
Commit:     223630fe3dc564b94e51ff4eb839828c9083f2f6
Parent:     09b56adc98e0f8a21644fcb4d20ad367c3fceb55
Author:     Zhang Rui <[EMAIL PROTECTED]>
AuthorDate: Thu Dec 6 23:36:35 2007 -0500
Committer:  Len Brown <[EMAIL PROTECTED]>
CommitDate: Thu Dec 6 23:36:35 2007 -0500

    export thermal notification to userspace when nocrt is set
    
    module parameter is used to prevent the thermal_zone action upon
    critical trip points.
    But exporting this notification to userspace is still useful.
    By setting nocrt with this patch applied, ACPI will take no action
    but exporting the events to userspace upon critical/hot trip points.
    
    http://bugzilla.kernel.org/show_bug.cgi?id=9139
    
    Signed-off-by: Zhang Rui <[EMAIL PROTECTED]>
    Signed-off-by: Len Brown <[EMAIL PROTECTED]>
---
 drivers/acpi/thermal.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 5f79b44..3a0af9a 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -492,7 +492,7 @@ static int acpi_thermal_get_devices(struct acpi_thermal *tz)
 
 static int acpi_thermal_critical(struct acpi_thermal *tz)
 {
-       if (!tz || !tz->trips.critical.flags.valid || nocrt)
+       if (!tz || !tz->trips.critical.flags.valid)
                return -EINVAL;
 
        if (tz->temperature >= tz->trips.critical.temperature) {
@@ -501,9 +501,6 @@ static int acpi_thermal_critical(struct acpi_thermal *tz)
        } else if (tz->trips.critical.flags.enabled)
                tz->trips.critical.flags.enabled = 0;
 
-       printk(KERN_EMERG
-              "Critical temperature reached (%ld C), shutting down.\n",
-              KELVIN_TO_CELSIUS(tz->temperature));
        acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL,
                                tz->trips.critical.flags.enabled);
        acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
@@ -511,14 +508,20 @@ static int acpi_thermal_critical(struct acpi_thermal *tz)
                                          ACPI_THERMAL_NOTIFY_CRITICAL,
                                          tz->trips.critical.flags.enabled);
 
-       orderly_poweroff(true);
+       /* take no action if nocrt is set */
+       if(!nocrt) {
+               printk(KERN_EMERG
+                       "Critical temperature reached (%ld C), shutting 
down.\n",
+                       KELVIN_TO_CELSIUS(tz->temperature));
+               orderly_poweroff(true);
+       }
 
        return 0;
 }
 
 static int acpi_thermal_hot(struct acpi_thermal *tz)
 {
-       if (!tz || !tz->trips.hot.flags.valid || nocrt)
+       if (!tz || !tz->trips.hot.flags.valid)
                return -EINVAL;
 
        if (tz->temperature >= tz->trips.hot.temperature) {
@@ -534,7 +537,7 @@ static int acpi_thermal_hot(struct acpi_thermal *tz)
                                          ACPI_THERMAL_NOTIFY_HOT,
                                          tz->trips.hot.flags.enabled);
 
-       /* TBD: Call user-mode "sleep(S4)" function */
+       /* TBD: Call user-mode "sleep(S4)" function if nocrt is cleared */
 
        return 0;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to