]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ACPI / thermal: do not always return THERMAL_TREND_RAISING for active trip points
authorZhang Rui <rui.zhang@intel.com>
Fri, 26 Apr 2013 09:19:53 +0000 (09:19 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 May 2013 03:08:22 +0000 (20:08 -0700)
commit928c5edbe6f7cb0d1c71bc2353d091bc5b114fe3
treeb192899bd04bd65d935f555c026d2a9f19d4cb04
parentc80044245f076dfef574cbb11b47f2ce611291e2
ACPI / thermal: do not always return THERMAL_TREND_RAISING for active trip points

commit 94a409319561ec1847fd9bf996a2d5843ad00932 upstream.

Commit 4ae46be "Thermal: Introduce thermal_zone_trip_update()"
introduced a regression causing the fan to be always on even when
the system is idle.

My original idea in that commit is that:
 - when the current temperature is above the trip point,
   keep the fan on, even if the temperature is dropping.
 - when the current temperature is below the trip point,
   turn on the fan when the temperature is raising,
   turn off the fan when the temperature is dropping.

But this is what the code actually does:
 - when the current temperature is above the trip point,
   the fan keeps on.
 - when the current temperature is below the trip point,
   the fan is always on because thermal_get_trend()
   in driver/acpi/thermal.c returns THERMAL_TREND_RAISING.
Thus the fan keeps running even if the system is idle.

Fix this in drivers/acpi/thermal.c.

[rjw: Changelog]
References: https://bugzilla.kernel.org/show_bug.cgi?id=56591
References: https://bugzilla.kernel.org/show_bug.cgi?id=56601
References: https://bugzilla.kernel.org/show_bug.cgi?id=50041#c45
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Matthias <morpheusxyz123@yahoo.de>
Tested-by: Ville Syrjälä <syrjala@sci.fi>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/acpi/thermal.c