[ltp] Re: [PATCH] In-kernel automatic fan control

Graziano Obertelli linux-thinkpad@linux-thinkpad.org
Wed, 30 Nov 2005 15:23:34 -0800


Hello,

just for completeness: I cannot find the extra 3 sensors on my T41
(2378). On my mchine (which is plagued by the almost always on behaviour
of the fan) the GPU seems to be worst offender. 

graziano

On Wed, 2005-11-30 at 21:25 +0200, Shem Multinymous wrote:
> Hi,
> 
> A few comments about Yury's patch and the ensuing discussion:
> 
> Looking only at the maximum temperature is dangerous. Each sensor
> monitors a different component, and each component has a different
> spec and different cooling system. For example, the CPU is rated to 97
> degrees Celsius, the 2200BG mini-PCI card is rated at 80 degrees and
> the battery will die out quite quickly at 50 degrees. The embedded
> controller uses different thresholds for each sensor, for a good
> reason.
> 
> Yury's patch only monitors the 8 temperature sensors recognized by
> ibm-acpi (embedded controller offsets 0x78-0x7F). There are at least 3
> more sensors, at EC offsets 0xC0 to 0xC3 (and 0xC4-0xC7 look like
> they're reserved for more sensors). It has been observed by several
> people that the BIOS often steps up the fan speed because of these
> extra sensors. You mustn't ignored them, and you mustn't apply the
> too-generous CPU thresholds to them either. See this discussion:
> 
> http://www.thinkwiki.org/wiki/Talk:Problem_with_fan_noise#Secret_sensor_and_the_cause_of_fan_always_on 
> 
> As Paul said, it's much better to keep a stable low fan speed than to
> have bursts of high speed - due to fan wear, thermal expansion and
> (subjectively) annoyance effect.
> 
> Several people here referred to the 2nd and 3rd sensors (0x79 and
> 0x7A) as "MiniPCI" and "HDD respectively". This is NOT generally true.
> On the T43, sensor 0x79 seems to be in the HDAPS accelerometer chip
> (which sits between the Mini-PCI and the well-ventilated PCMCIA slots,
> so it doesn't reflect Mini-PCI temperature well), and sensor 0x7A
> gives values that are completely uncorrelated with the HDD temperature
> reported by the HDD's SMART interface. For the best available guess
> about the location of the sensors and the appropriate temperatures,
> see the top of the script mentioned earlier:
> 
> http://www.thinkwiki.org/wiki/ACPI_fan_control_script#Variable_speed_control_scripts 
> 
> Anyway, fan control can be done in kernel despite this complication -
> the core algorithm used by the above script, stripped of comments and
> support code, is just a dozen lines of code. Performance-wise, a
> kernelspace governer is unnecessary (it wakes up only every few
> seconds anyway, just like the embedded controller). Yes, it could
> prevent things like ungraceful death by OOM (graceful death is fine -
> the above script restore the default fan behavior when it's killed).
> But if you care only about ungraceful death then it suffices to have a
> tiny kernel patch that kicks the fan to default speed if it didn't get
> a keep-alive signal (say, a write to /etc/acpi/ibm/fan) for N seconds.
> 
> For userspace control of fan speed, there's this patch:
>   http://www.thinkwiki.org/wiki/Patch_for_controlling_fan_speed
> At the bottom of that page you can find the relevant hardware specs
> (including a surprise). But if you don't care about a bit of ugliness,
> you don't even need this patch - just force a certain speed this way:
> 
> echo 0x2F 0x00 > /proc/acpi/ibm/ecdump   # fan off
> echo 0x2F 0x01 > /proc/acpi/ibm/ecdump   # fan at low speed
> echo 0x2F 0x04 > /proc/acpi/ibm/ecdump   # fan at medium speed
> echo 0x2F 0x07 > /proc/acpi/ibm/ecdump   # fan at high speed
> echo 0x2F 0x80 > /proc/acpi/ibm/ecdump   # back to automatic speed
> 
> Have fun and don't fry your laptop! If it works for you, please report
> your ThinkPad model on the Wiki.
> 
>   Shem
> 
> P.S. there's also a ThinkPad fan control tool for Windows based on the
> above specs:
>   http://forum.thinkpads.com/viewtopic.php?t=17715
>   http://forum.thinkpads.com/viewtopic.php?t=17733
> 
-- 
+-----------------------+--------------------------+
| Graziano Obertelli    | CS Dept. Rm 102          |
| graziano@cs.ucsb.edu  | University of California |
| (805) 893-5212        | Santa Barbara, CA 93106  |
+-----------------------+--------------------------+