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

Yury Polyanskiy linux-thinkpad@linux-thinkpad.org
Mon, 28 Nov 2005 20:01:02 -0500


--=-xIN6JW/ebMsFdzANTEFX
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi!

Just in case anyone interested.

I did a small modification to a kernel ibm-acpi driver. 
It adds "auto" command for fan (in addition to enable/disable). 

After doing "echo auto > /proc/acpi/ibm/fan" kernel thread is spawned to
monitor max temperature and start fan if temp exceeds high threshold or
stop fan if temp goes below low threshold.

Defaults are low = 55 C, high = 65 C. These can be adjusted in arguments
to auto (i.e. echo auto 52 61 > /proc/acpi/ibm/fan).

I prefer to do this in kernel as this seems to be a very critical part
for lifetime of the laptop and so I do not trust user space scripts or
microdaemons. Moreover in this way it consumes far lees resources.

Patch against mainstream ibm-acpi-0.11.tar.gz attached.

Yury Polyanskiy.


--=-xIN6JW/ebMsFdzANTEFX
Content-Disposition: attachment; filename=ibm-acpi-0.11-up1.patch.gz
Content-Type: application/x-gzip; name=ibm-acpi-0.11-up1.patch.gz
Content-Transfer-Encoding: base64

H4sICHwCfEMAA2libS1hY3BpLTAuMTEtdXAxLnBhdGNoAL0aaVPbWPKz+BUdT4VIWLZlGwPh2hBw
ZrwbjuXYyU5CqYT0jFWWJY8Ojsnw37e739PhA5JM7a5DWX5Xd7++uxXPHw6hcZLF4N9MGo479RtW
s91u4cimUdOdXWhMHitrK41G49mDWseyeo221WhvgNXdXu9u9942rfwDDWvdslbq9fpLCBSMNsHo
dLetze313gyMHsJ49w4a7bfmJtT5+927FYA1gA9RFnpO6kehCYPQbZrQewuXYjINBJwFjitMuMj8
VEC3a5nwPkpS2nl8AGB12oSya20CXF0cELjWCqw0fvLE0A8FDN4f2//qn18MTk+gRkTXVurPrjWy
Ka7DCrTWJF2HIye8FUF0u82Ub3XMDajjd7vNpP/kh26QeQJ2iQUt+rK92L8TcdIc7S9ZD52JSKa8
hmQUq4EfZg+te8dPaWlhQcTx0vlxOoqF482tOcmklYiJMx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