From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] Using hwmon in-kernel
Date: Sun, 19 Oct 2008 16:20:00 +0000 [thread overview]
Message-ID: <20081019182000.29e50529@hyperion.delvare> (raw)
In-Reply-To: <20081008003041.GA20169@srcf.ucam.org>
Hi Matthew,
On Wed, 8 Oct 2008 01:30:41 +0100, Matthew Garrett wrote:
> I'm possibly missing something here, but. I'm working on improving the
> thermal management of nvidia cards in nouveau. I've got I2C up and
> running and I can bind appropriate hwmon drivers to the chips and read
> temperatures. I've got a couple of remaining problems:
>
> 1) I know the offsets that need to be applied to the lm99 sensors. How
> do I do that in-kernel?
Depends on what you're speaking of exactly. If you refer to the +16
degrees offset that must be applied to all LM99 readings per hardware
design, the problem is that the LM89 can't be differentiated from the
LM99 by probing (they have the same die revision code register value.)
The LM99 needs the +16 degrees offset while the LM89 doesn't, so it
isn't possible to get both right when the devices are auto-detected.
For this reason, I decided to not handle the offset in the lm90 driver.
Instead, it is handled in user-space using a compute statement
in /etc/sensors.conf, assuming that users know whether they have an
LM89 or LM99 chip.
As the lm90 driver has been converted to a new-style i2c device driver,
it is now possible to explicitly instantiate an LM89 or LM99 chip,
without relying on auto-detection. So I admit that it would make sense
to handle the +16 degrees offset in the driver for the LM99. This will
cause some compatibility issues during the transition period though, as
using a recent lm90 driver with an old sensors.conf file will report a
temperature 16 degrees higher than it really is.
If you instead refer to a board-specific offset that should be applied
to compensate for the distance between the thermal sensor and the
graphics core, or for a non-standard thermal diode, the lm90 driver
exposes attribute temp2_offset so user-space can set and read the
temperature offset.
> 2) How do I read the temperature in-kernel? This only seems to be
> exported via sysfs, which is obviously not ideal (I'm not willing to
> leave the thermal management up to userspace).
You are right, there is no in-kernel interface to read temperature
values, only a sysfs interface. The reason for that is that in most
cases, the kernel doesn't have enough information about the wirings to
make the information useful. The labelling and voltage scaling is all
done in user-space.
Why do you want to retrieve the temperature value from the kernel?
Please explain your use case.
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2008-10-19 16:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-08 0:30 [lm-sensors] Using hwmon in-kernel Matthew Garrett
2008-10-19 16:20 ` Jean Delvare [this message]
2008-10-19 18:02 ` Matthew Garrett
2008-10-20 7:05 ` Jean Delvare
2008-10-20 7:13 ` Hans de Goede
2008-10-20 10:00 ` Matthew Garrett
2008-10-20 16:13 ` Matthew Garrett
2008-10-22 18:48 ` Trent Piepho
2008-10-22 19:01 ` Matthew Garrett
2008-10-29 23:33 ` Trent Piepho
2008-10-30 0:03 ` Matthew Garrett
2008-10-30 1:45 ` Trent Piepho
2008-10-30 2:12 ` Matthew Garrett
2008-10-30 8:28 ` Jean Delvare
2008-10-30 9:39 ` Trent Piepho
2008-10-30 20:16 ` Henrique de Moraes Holschuh
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=20081019182000.29e50529@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.