--- x/drivers/acpi/thermal.c 2005-11-22 15:53:59.000000000 +0300 +++ y/drivers/acpi/thermal.c 2005-12-14 17:50:35.000000000 +0300 @@ -63,6 +63,12 @@ #define ACPI_THERMAL_MODE_CRITICAL 0xff #define ACPI_THERMAL_PATH_POWEROFF "/sbin/poweroff" +/* + * ACPI spec 3.0 states default value between 300 and 3000 (i.e. 30 or + * 3000 secs) but less polling interval proves to be safer + */ +#define ACPI_THERMAL_POLLING_FREQ_DEFAULT 50 + #define ACPI_THERMAL_MAX_ACTIVE 10 #define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65 @@ -172,6 +178,7 @@ struct acpi_thermal_trips trips; struct acpi_handle_list devices; struct timer_list timer; + u32 last_jiffies; }; static struct file_operations acpi_thermal_state_fops = { @@ -1226,9 +1233,16 @@ switch (event) { case ACPI_THERMAL_NOTIFY_TEMPERATURE: - acpi_thermal_check(tz); + if (jiffies - tz->last_jiffies > HZ) { + printk(KERN_ERR "------------------ Got thermal event 0x80\n"); + acpi_thermal_check(tz); + tz->last_jiffies = jiffies; + } else { + printk(KERN_ERR "------------------ SKIP thermal event 0x80\n"); + } break; case ACPI_THERMAL_NOTIFY_THRESHOLDS: + printk(KERN_ERR "------------------ Got thermal event 0x81\n"); acpi_thermal_get_trip_points(tz); acpi_thermal_check(tz); acpi_bus_generate_event(device, event, 0); @@ -1296,8 +1310,16 @@ /* Get default polling frequency [_TZP] (optional) */ if (tzp) tz->polling_frequency = tzp; - else - acpi_thermal_get_polling_frequency(tz); + else { + result = acpi_thermal_get_polling_frequency(tz); + /* + * The absence of _TZP informs OSPM to implement polling + * using an OS-provided default frequency + */ + if (result != 0) + tz->polling_frequency = + ACPI_THERMAL_POLLING_FREQ_DEFAULT; + } /* Get devices in this thermal zone [_TZD] (optional) */ result = acpi_thermal_get_devices(tz);