--- linux-3.4/drivers/acpi/thermal.c.orig 2012-10-17 21:29:52.132423648 +0900 +++ linux-3.4/drivers/acpi/thermal.c 2012-10-18 09:11:12.030277766 +0900 @@ -96,6 +96,8 @@ module_param(psv, int, 0644); MODULE_PARM_DESC(psv, "Disable or override all passive trip points."); +static int temp_before_trip; + static int acpi_thermal_add(struct acpi_device *device); static int acpi_thermal_remove(struct acpi_device *device, int type); static int acpi_thermal_resume(struct acpi_device *device); @@ -941,15 +943,32 @@ if (!tz) return -EINVAL; - /* Get trip points [_CRT, _PSV, etc.] (required) */ - result = acpi_thermal_get_trip_points(tz); - if (result) + if (temp_before_trip) { + /* + * some hardwares need temperature before trip points + * can be obtained + */ + + /* Get temperature [_TMP] (required) */ + result = acpi_thermal_get_temperature(tz); + if (result) return result; - /* Get temperature [_TMP] (required) */ - result = acpi_thermal_get_temperature(tz); - if (result) + /* Get trip points [_CRT, _PSV, etc.] (required) */ + result = acpi_thermal_get_trip_points(tz); + if (result) return result; + } else { + /* Get trip points [_CRT, _PSV, etc.] (required) */ + result = acpi_thermal_get_trip_points(tz); + if (result) + return result; + + /* Get temperature [_TMP] (required) */ + result = acpi_thermal_get_temperature(tz); + if (result) + return result; + } /* Set the cooling mode [_SCP] to active cooling (default) */ result = acpi_thermal_set_cooling_mode(tz, ACPI_THERMAL_MODE_ACTIVE); @@ -1110,6 +1129,15 @@ return 0; } +static int thermal_temp_before_trip(const struct dmi_system_id *d) +{ + + printk(KERN_NOTICE "ACPI: %s detected: getting temperature before trip point initialisation\n", + d->ident); + temp_before_trip = 1; + return 0; +} + static struct dmi_system_id thermal_dmi_table[] __initdata = { /* * Award BIOS on this AOpen makes thermal control almost worthless. @@ -1147,6 +1175,26 @@ DMI_MATCH(DMI_BOARD_NAME, "7ZX"), }, }, + /* + * Some HP Compaq require temperature before trip points + * https://bugzilla.kernel.org/show_bug.cgi?id=43284 + */ + { + .callback = thermal_temp_before_trip, + .ident = "HP Compaq 6715b", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), + DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq 6715b"), + }, + }, + { + .callback = thermal_temp_before_trip, + .ident = "HP Compaq 6715s", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), + DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq 6715s"), + }, + }, {} };