linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simone Piunno <pioppo@ferrara.linux.it>
To: Andrew Morton <akpm@osdl.org>
Cc: djg@pdp8.net, greg@kroah.com, sensors@stimpy.netroedge.com,
	linux-kernel@vger.kernel.org
Subject: 2.6.10-mm2: it87 sensor driver stops CPU fan
Date: Sat, 8 Jan 2005 01:50:42 +0100	[thread overview]
Message-ID: <200501080150.44653.pioppo@ferrara.linux.it> (raw)


Hi,

Today I've tried 2.6.10-mm2 compiled for x86_64 and found something bad.
As soon as I modprobe it87 (one of the i2c sensors drivers) the CPU fan 
completely halts and the CPU temperature skyrockets even while idle.
For context:
I have an Athlon64 3200+ on a Gigabyte K8VT800 motherboard (i2c_viapro module)
running Gentoo compiled in x86_64 mode, it87 is controlled through ISA bus, 
VT8237 ISA bridge.

The same setup doesn't show the problem on vanilla 2.6.10 and neither on the 
last -mm I tried, which IIRC was 2.6.9-rc4-mm1.

After some tweaking, it looks like ACPI is not the problem (tried to look at 
full debug trace, nothing appears when loading it87).  Instead, I've found I 
can control the fan speed using /sys/devices/platform/i2c-0/0-0290/pwm1 and
initially it is set to 225, but setting it to 0 the fan runs at max speed.
Intermediate values works as well: the higher the value, the slower the fan.

I've google for this sysfs interface and found than everyone expects pwm* 
values to have the reverse meaning: 255 should be max speed and 0 should halt 
the fan.  So apparently the problem is really in the it87 driver, using the 
wrong coefficient for this scale and therefore setting it to the wrong 
default value.

Comparing drivers/i2c/chips/it87.c in 2.6.10 vanilla and 2.6.10-mm2, I've 
found only -mm tree includes the pwm fan controller.  

I think a quick fix could be the following, but didn't try it.

--- drivers/i2c/chips/it87.c    2005-01-07 15:13:52.000000000 +0100
+++ drivers/i2c/chips/it87.c.new        2005-01-08 01:41:16.000000000 +0100
@@ -163,8 +163,8 @@

 #define ALARMS_FROM_REG(val) (val)

-#define PWM_TO_REG(val)   ((val) >> 1)
-#define PWM_FROM_REG(val) (((val)&0x7f) << 1)
+#define PWM_TO_REG(val)   ((255-val) >> 1)
+#define PWM_FROM_REG(val) (255-(((val)&0x7f) << 1))

 static int DIV_TO_REG(int val)
 {

Regards,
  Simone Piunno
-- 
http://thisurlenablesemailtogetthroughoverzealousspamfilters.org

             reply	other threads:[~2005-01-08  0:47 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-08  0:50 Simone Piunno [this message]
2005-01-08  9:34 ` 2.6.10-mm2: it87 sensor driver stops CPU fan Jean Delvare
2005-01-10 22:41   ` Simone Piunno
2005-01-11  9:26     ` Jean Delvare
2005-01-11 20:24       ` Jonas Munsin
2005-01-11 20:56         ` Jean Delvare
2005-01-11 22:41         ` Greg KH
2005-01-11 21:04       ` Simone Piunno
2005-01-12  9:44         ` Jean Delvare
2005-01-12 22:27       ` Jonas Munsin
2005-01-13 23:29         ` Greg KH
2005-01-14 14:40           ` Jean Delvare
2005-01-15 15:30             ` [PATCH 2.6] I2C: Allow it87 pwm reconfiguration Jean Delvare
2005-01-15 17:18               ` Simone Piunno
2005-01-19 23:23               ` Greg KH
2005-01-15 15:54             ` 2.6.10-mm2: it87 sensor driver stops CPU fan Simone Piunno
2005-01-15 16:55               ` Jean Delvare
2005-01-16 22:32                 ` Simone Piunno
2005-01-17 19:19                   ` Jean Delvare
2005-01-17 19:37                     ` 2.6 Series Mem Mgmt Chris Bookholt
2005-01-17 19:56                       ` Brian Gerst
2005-01-08 16:20 ` 2.6.10-mm2: it87 sensor driver stops CPU fan Jean Delvare
2005-01-08 19:23   ` Simone Piunno
2005-01-10 19:23     ` Simone Piunno
2005-01-10 19:34       ` Jean Delvare
2005-01-19 20:19         ` Nicolas Pitre
2005-01-19 20:52           ` Jean Delvare
2005-01-19 22:10             ` Nicolas Pitre
2005-01-20 11:08               ` Jean Delvare
2005-01-20 16:01                 ` Nicolas Pitre
2005-01-20 16:28                   ` Jean Delvare
2005-01-20 21:19                     ` Nicolas Pitre
2005-01-21  6:46                       ` Jean Delvare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200501080150.44653.pioppo@ferrara.linux.it \
    --to=pioppo@ferrara.linux.it \
    --cc=akpm@osdl.org \
    --cc=djg@pdp8.net \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sensors@stimpy.netroedge.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).