diff options
author | Zhang Rui <rui.zhang@intel.com> | 2007-12-06 23:36:35 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-12-06 23:36:35 -0500 |
commit | 223630fe3dc564b94e51ff4eb839828c9083f2f6 (patch) | |
tree | 9d3acde26b0c262bc73122260028129f82ddd2e4 /drivers/acpi/thermal.c | |
parent | 09b56adc98e0f8a21644fcb4d20ad367c3fceb55 (diff) |
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 <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r-- | 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 5f79b4451212..3a0af9a8cd27 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) | |||
492 | 492 | ||
493 | static int acpi_thermal_critical(struct acpi_thermal *tz) | 493 | static int acpi_thermal_critical(struct acpi_thermal *tz) |
494 | { | 494 | { |
495 | if (!tz || !tz->trips.critical.flags.valid || nocrt) | 495 | if (!tz || !tz->trips.critical.flags.valid) |
496 | return -EINVAL; | 496 | return -EINVAL; |
497 | 497 | ||
498 | if (tz->temperature >= tz->trips.critical.temperature) { | 498 | if (tz->temperature >= tz->trips.critical.temperature) { |
@@ -501,9 +501,6 @@ static int acpi_thermal_critical(struct acpi_thermal *tz) | |||
501 | } else if (tz->trips.critical.flags.enabled) | 501 | } else if (tz->trips.critical.flags.enabled) |
502 | tz->trips.critical.flags.enabled = 0; | 502 | tz->trips.critical.flags.enabled = 0; |
503 | 503 | ||
504 | printk(KERN_EMERG | ||
505 | "Critical temperature reached (%ld C), shutting down.\n", | ||
506 | KELVIN_TO_CELSIUS(tz->temperature)); | ||
507 | acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL, | 504 | acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL, |
508 | tz->trips.critical.flags.enabled); | 505 | tz->trips.critical.flags.enabled); |
509 | acpi_bus_generate_netlink_event(tz->device->pnp.device_class, | 506 | acpi_bus_generate_netlink_event(tz->device->pnp.device_class, |
@@ -511,14 +508,20 @@ static int acpi_thermal_critical(struct acpi_thermal *tz) | |||
511 | ACPI_THERMAL_NOTIFY_CRITICAL, | 508 | ACPI_THERMAL_NOTIFY_CRITICAL, |
512 | tz->trips.critical.flags.enabled); | 509 | tz->trips.critical.flags.enabled); |
513 | 510 | ||
514 | orderly_poweroff(true); | 511 | /* take no action if nocrt is set */ |
512 | if(!nocrt) { | ||
513 | printk(KERN_EMERG | ||
514 | "Critical temperature reached (%ld C), shutting down.\n", | ||
515 | KELVIN_TO_CELSIUS(tz->temperature)); | ||
516 | orderly_poweroff(true); | ||
517 | } | ||
515 | 518 | ||
516 | return 0; | 519 | return 0; |
517 | } | 520 | } |
518 | 521 | ||
519 | static int acpi_thermal_hot(struct acpi_thermal *tz) | 522 | static int acpi_thermal_hot(struct acpi_thermal *tz) |
520 | { | 523 | { |
521 | if (!tz || !tz->trips.hot.flags.valid || nocrt) | 524 | if (!tz || !tz->trips.hot.flags.valid) |
522 | return -EINVAL; | 525 | return -EINVAL; |
523 | 526 | ||
524 | if (tz->temperature >= tz->trips.hot.temperature) { | 527 | if (tz->temperature >= tz->trips.hot.temperature) { |
@@ -534,7 +537,7 @@ static int acpi_thermal_hot(struct acpi_thermal *tz) | |||
534 | ACPI_THERMAL_NOTIFY_HOT, | 537 | ACPI_THERMAL_NOTIFY_HOT, |
535 | tz->trips.hot.flags.enabled); | 538 | tz->trips.hot.flags.enabled); |
536 | 539 | ||
537 | /* TBD: Call user-mode "sleep(S4)" function */ | 540 | /* TBD: Call user-mode "sleep(S4)" function if nocrt is cleared */ |
538 | 541 | ||
539 | return 0; | 542 | return 0; |
540 | } | 543 | } |