View | Details | Raw Unified | Return to bug 9139 | Differences between
and this patch

Collapse All | Expand All

(-)linux-2.6/drivers/acpi/thermal.c (-7 / +10 lines)
Lines 492-498 static int acpi_thermal_get_devices(stru Link Here
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) {
Lines 501-509 static int acpi_thermal_critical(struct Link Here
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,
Lines 511-524 static int acpi_thermal_critical(struct Link Here
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) {
Lines 534-540 static int acpi_thermal_hot(struct acpi_ Link Here
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
}

Return to bug 9139