All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] ACPI reads wrong temperature after loading
Date: Wed, 05 Nov 2008 17:33:59 +0000	[thread overview]
Message-ID: <20081105183359.5dc3e963@hyperion.delvare> (raw)
In-Reply-To: <20081101103904.7ea43d94@hyperion.delvare>

Hi Peter,

Sorry for the late answer, I fell ill and had to stay in bad for a
couple days.

On Sun, 02 Nov 2008 12:25:25 +0100, Peter Mahlknecht wrote:
> > OK. This confirms that ACPI is using the SMBus so we shouldn't. With
> > kernels >= 2.6.27, you can boot with parameter
> > acpi_enforce_resources=strict and the i2c-i801 driver will decline
> > attaching to the SMBus.
> 
> Has this the same effect as just not loading the i2c-i801 driver? Or
> what other functions then attaching to the SMBus has the i2c-i801?

This has roughly the same effect, yes. The only difference is that
acpi_enforce_resources=strict doesn't prevent the i2c-i801 driver from
loading, so it still appears in "lsmod" and wastes a small amount of
memory. But I doubt you really care in practice.

> > Another test I'd like you to do is:
> > 
> > # rmmod em28xx_cx25843
> > # rmmod lm90
> > # modprobe i2c-i801
> > # modprobe i2c-dev
> > # i2cdetect -l
> > (find the i2c bus number for "SMBus I801 adapter at 18e0")
> > # i2cdetect n
> > (where n is the bus number in question)
> > 
> > I wonder if this will confuse ACPI the same way loading em28xx_cx25843
> > does.
> 
> It does:
> laptop-mali:/home/mali# i2cdetect -l
> i2c-0	smbus     	SMBus I801 adapter at 18e0      	SMBus adapter
> laptop-mali:/home/mali# cat /proc/acpi/thermal_zone/THRM/temperature 
> temperature:             41 C
> laptop-mali:/home/mali# i2cdetect 0
> WARNING! This program can confuse your I2C bus, cause data loss and worse!
> I will probe file /dev/i2c-0.
> I will probe address range 0x03-0x77.
> Continue? [Y/n] y
>      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
> 00:          -- -- -- -- -- 08 -- -- -- -- -- -- -- 
> 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
> 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
> 30: 30 -- 32 -- -- -- -- -- -- -- -- -- -- -- -- -- 
> 40: -- -- -- -- 44 -- -- -- -- -- -- -- 4c -- -- -- 
> 50: 50 -- 52 -- -- -- -- -- -- -- -- -- -- -- -- -- 
> 60: -- -- -- -- -- -- -- -- -- 69 -- -- -- -- -- -- 
> laptop-mali:/home/mali# cat /proc/acpi/thermal_zone/THRM/temperature 
> temperature:             65535 C

OK, so the mere fact of probing the bus with "SMBus quick commands" is
enough to confuse ACPI. I guess that the i2c-i801 driver is changing
some hardware settings (.e.g. SMBus vs. I2C timing or PEC flag) to
something ACPI doesn't expect. If we want the i2c-i801 driver to ever
cooperate on hardware like yours, we will have to teach the i2c-i801
driver how to only touch the configuration registers when it needs to
and how to restore all the settings when it is done. But at the moment
there is no safe way to do this anyway so I won't spend time on this.
The back-listing should work well enough.

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

      parent reply	other threads:[~2008-11-05 17:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-01  9:39 [lm-sensors] ACPI reads wrong temperature after loading Jean Delvare
2008-11-01 15:28 ` Markus Rechberger
2008-11-01 16:14 ` Jean Delvare
2008-11-01 17:11 ` Markus Rechberger
2008-11-01 17:33 ` Jean Delvare
2008-11-01 18:47 ` Peter Mahlknecht
2008-11-01 22:16 ` Peter Mahlknecht
2008-11-02  9:07 ` Jean Delvare
2008-11-02 11:25 ` Peter Mahlknecht
2008-11-05 17:33 ` Jean Delvare [this message]

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=20081105183359.5dc3e963@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=lm-sensors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.