Skip to contentSkip to conversation

2.6.16-rc5: unreasonable temperature reported by

lm-sensors Harald Dunkel 3 participants 10 messages May 19, 2006 – Aug 20, 2006

lore
Share & tools
lore
#0 lore raw

Hi Jean,

Quoted 6 lines · Jean Delvare

Harald,

Quoted 2 lines

Creating a driver on my own sounds pretty cool. Probably it is allowed to use an existing driver as a template?

Quoted 9 lines

Not allowed. Required ;)

I didn't look at the datasheet for your chip yet (no time for this sorry) so I can't tell you exactly which driver to start from. But this should be an i2c-only driver (no platform driver, and no i2c-isa trick.) Maybe lm90 will do, as it's both simple and up-to-date with regards to recent changes. And you can always peek at other drivers for the features your chip has and lm90 doesn't.

I have started working on this (but please don't expect too much). One question about the I2C_DRIVERID_* macros in i2c-id.h: Where could I get an ID for the f75387 driver?

Regards

Harri

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060519/00085aa4/signature.bin

#1 lore raw

Hi Harald,

Quoted 10 lines
Quoted 6 lines

I didn't look at the datasheet for your chip yet (no time for this sorry) so I can't tell you exactly which driver to start from. But this should be an i2c-only driver (no platform driver, and no i2c-isa trick.) Maybe lm90 will do, as it's both simple and up-to-date with regards to recent changes. And you can always peek at other drivers for the features your chip has and lm90 doesn't.

I have started working on this (but please don't expect too much). One question about the I2C_DRIVERID_* macros in i2c-id.h: Where could I get an ID for the f75387 driver?

You don't need any. id is an optional field, just set it to 0 (the default for a statically declared structure anyway) and it'll be fine.

Signature · 1 line
Jean Delvare
#2 lore raw
In reply to Harald Dunkel

Hi Jean,

Quoted 5 lines · Harald Dunkel

I have started working on this (but please don't expect too much). One question about the I2C_DRIVERID_* macros in i2c-id.h: Where could I get an ID for the f75387 driver?

The datasheet of the F75387 doesn't say anything about Packet Error Checking, but I am not sure whether this is a feature of the bus. Is it?

Can something bad happen if I don't support PEC?

Regards

Harri

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060526/5a6e32db/signature.bin

#3 lore raw
In reply to Harald Dunkel

Hi Harald,

Quoted 5 lines · Harald Dunkel

The datasheet of the F75387 doesn't say anything about Packet Error Checking, but I am not sure whether this is a feature of the bus. Is it?

Can something bad happen if I don't support PEC?

PEC is an optional protocol extension, it can be used only when both the master and the slave support it.

The Fintek F75387 datasheet doesn't mention PEC, so I would assume it doesn't support it. Chips supporting PEC are the exception rather than the rule, only the ADM1032 chip (lm90 driver) supports it in our whole driver set. So just forget about PEC, and everything will be fine.

Signature · 1 line
Jean Delvare
#4 lore raw
In reply to Harald Dunkel

Hi Jean,

I've got some very first version, reading temperatures, fan speeds, and voltage. See attachment. (Hopefully it is OK to post it here?)

Except that the values it reports don't match the values shown in the bios. The temperatures shown in the bios are about 4 degrees higher (53 to 54 degree Celsius), the voltages don't match, and the fan speeds are completely mad:

% cat /sys/bus/i2c/devices/0-002d/fan?_input
471
4094
% cat /sys/bus/i2c/devices/0-002d/temp?_input
49125
49125
40250
% cat /sys/bus/i2c/devices/0-002d/in?_input
1576
912
1008
1016

If I compare this to the output of i2cdump, then I don't see a difference. AFAICS the /sys entries and the registers match.

Any idea? Is it possible that the datasheet is not correct?

Regards

Harri

-------------- next part --------------
A non-text attachment was scrubbed...
Name: f75387.c
Type: text/x-csrc
Size: 15096 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060526/935fe4c6/f75387-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060526/935fe4c6/signature-0001.bin

#5 lore raw
In reply to Harald Dunkel

Hi Jean,

Attached is a new version of the f75387 driver. The fan speed is correct now, except that the missing fan is not detected. fan1_input is 550, not 0.

All values are still read-only.

What is the procedure to get support for a new chip into the lm-sensors package?

Regards

Harri

-------------- next part --------------
A non-text attachment was scrubbed...
Name: f75387.c
Type: text/x-csrc
Size: 18315 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060528/dca48a78/f75387.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060528/dca48a78/signature.bin

#6 lore raw
In reply to Harald Dunkel

Hi folks,

It would be very nice if you could send me some feedback. I haven't created a kernel driver before, but IMHO this should not be a reason to ignore my efforts in this completely.

Regards

Harri

Quoted 8 lines · ==============================Harald Dunkel

Hi Jean,

Attached is a new version of the f75387 driver. The fan speed is correct now, except that the missing fan is not detected. fan1_input is 550, not 0.

All values are still read-only.

Quoted 7 lines

What is the procedure to get support for a new chip into the lm-sensors package?

Regards

Harri

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060610/cc2880b3/attachment-0001.bin

#7 lore raw
In reply to Harald Dunkel
Quoted 6 lines · Harald Dunkel

Hi folks,

It would be very nice if you could send me some feedback. I haven't created a kernel driver before, but IMHO this should not be a reason to ignore my efforts in this completely.

Hi,

We do not ignore, I just returned from 2-3 weeks off. Jean was alone here... Not easy to handle all those patches in two... Or alone..

Remember that we are doing this in free time and it eats a lot of it.

I created a ticket with for your driver review.

Regards
Rudolf

#8 lore raw
In reply to Harald Dunkel

Hi Rudolf,

I've got one general question:

AFAICS the values measured by the sensor chips are pretty far away from reality, as it seems. The mapping to real temperatures, and voltages is done in the sensors tool in user space.

But: Ain't this extremely hardware dependent? Looking at the same sensor built into several different mainboards of different manufacturers, I would guess that the range for the measured temperatures or voltages can vary alot, depending upon some external resistors, the position of the chip on the main board, etc. Every second board needs its own sensors.conf, does it?

Or is there some kind of standard, at least for the major chips?

Regards

Harri

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060820/c730fca2/attachment.bin

#9 lore raw
In reply to Harald Dunkel

Hi Harald,

Quoted 5 lines

AFAICS the values measured by the sensor chips are pretty far away from reality, as it seems. The mapping to real temperatures, and voltages is done in the sensors tool in user space.

Quoted 8 lines

But: Ain't this extremely hardware dependent? Looking at the same sensor built into several different mainboards of different manufacturers, I would guess that the range for the measured temperatures or voltages can vary alot, depending upon some external resistors, the position of the chip on the main board, etc. Every second board needs its own sensors.conf, does it?

Well same board should have same sensors.conf. But it is upon manufacturer to wire it as they like. This is the reason for sensors.conf

The driver exports the voltage value measured on ADC pin, but this voltage needs scaling because for example 5V needs to be in range of 0-2.048V The scaling depends on hardware used (two resistors) and there are many ways how to fit 5V into this range.

Temperatures sometimes needs some offsets to add or even more complicated formulas.

Quoted 2 lines

Or is there some kind of standard, at least for the major chips?

Board manufacturer may follow the recommendations found in datasheet for that particular chip. I belive more standards will show when the PECI and SST will become more popular for intel chips.

Regards
Rudolf