
Sensors FAQ
-----------

[Internal comments/questions/uncertainties are in square brackets.]

1 What sensors are available on my PC?
1.1 What is an "LM78/LM78-J/LM79/LM80/W83781D"?
1.2 What is an "LM75"?
1.3 Where do I find out more about any of these LMxx chips?

2 How are these sensors read?
2.1 What is the SMBus?
2.2 What sensors does the Pentium 2 have?
2.3 How often are the sensor values updated?
2.4 How are alarms triggered?

3 Problems:
3.1 Why do my fans report exactly half/double their values by your code 
compared to the BIOS? Or, why are my voltages different readings than what 
my BIOS reports? 
3.2 My manufacturer swears that my mainboard has an SMBus, but your code 
reports that it can't find it.  What's wrong?
3.3 The modules won't load, saying 'SMBus not detected'.
3.4 Why do my two LM75's report "-48 degrees"? 
3.5 Why do I have two Vcore readings, I have only one processor! 
3.6 How do those ALARMS work? The current value is within range but there
is still an ALARM warning in /proc/sensors.
3.7 My voltage readings seem to drift a bit. Is something wrong with my power
supply?
3.8 Vcore is way out of range. What happened? 
3.9 I try to read /proc/sensors, and I get a "No sensor data yet (try again in 
a few moments)" message. Why? 
3.10 I try to read /proc/sensors several times a second, but it seems to be
updated only each second or so. Why?
3.11 It sometimes seems to take a fraction of a second before I see the
results of a 'cat /proc/sensors'. Why? 
3.12 Can I be alerted when an ALARM occurs?
3.13 SMBus transactions simply don't work (timeouts happen).  Why? [NEW]
3.14 My BIOS reports a much higher CPU temperature than your module! [NEW]
3.15 On my Dell, a LM80 is detected, but all readings are 0! [NEW]

4 How to ask for help: [NEW]
4.1 What to do if it won't insert? [NEW]
4.2 What to do if it inserts, but the SMBus is not detected? [NEW]
4.3 What to do if /proc/sensors output has some strange values? [NEW]
4.4 What to do if you have other problems? [NEW]
4.5 What if it just works like a charm? [NEW]

-------------------------------------------------------------

1 What sensors are available on my PC?

	Most medium/high-end computers since late 1997 now come with a LM78 or 
LM79 hardware health monitoring chip and an SMBus. 
	
	
1.1 What is an "LM78/LM78-J/LM79/LM80/W83781D"?

	The LM78 is a chip made by National Semiconductor which can monitor 7 
voltages (5 positive, 2 negative) from 0 to 4.08V.  The inputs are usually in 
series with voltage dividers which lower the 12+/-V and 5+/-V supplies to 
measurable range.  Therefore, the readings for such inputs need to be 
re-scaled appropriately by software. 
	The LM78 also has 3 fan speed monitoring inputs, an internal 
temperature sensor, a chassis intrusion sensor, and a couple maskable interrupt 
inputs.  The LM78 can also relay the processor's (P6 or Pent II) VID lines
which are hardwired and used to indicate to the power regulator (usually on 
the mainboard close to the processor socket/slot) what voltage to supply to 
the processor. 
	The LM78 can be interfaced to a system via the ISA bus and/or the 
SMBus. 
	The LM78-J is identical to the LM78 but slightly newer.
	The LM79 is also very similar to the LM78, but has an additional VID 
line for processors which have 5 VID lines.
	The LM80 is a SMBus-only version of the LM78
	The W83781D is a LM79 clone which also simulates two LM75 chips. It 
is made by Winbond.
	See doc/Chips for more information about the differences between these
chips.

	
1.2 What is an "LM75"?

	The LM75 is another chip made by National Semiconductor intended to be 
used as a remote temperature sensor connected to the system's SMBus. 
	The LM75 can report temperature as well as trigger an alert (OS Out) 
if a programmed limit has been exceeded. 
	

1.3 Where do I find out more about any of these LMxx chips?

	National Semiconductor has an excellent documentation resource on their
web-site.  Complete specs on the LMxx chips talked about in this FAQ can be 
downloaded at: 
	http://www.national.com
The Winbond documentation can be found at:
	http://www.winbond.com.tw/produ/perso7.htm


2 How are these sensors read?

	The LM78 and most other chips (simply referred to as "LM78" from this
point on) sensors are usually read through the ISA bus.  Our code looks for
the presence of the LM78 on the ISA bus and attempts to read the sensors from
it by reading different internal registers in the LM78. 
	The LM78 also has an SMBus interface, but seems to be used only in 
rare cases. The LM80 can only be connected to the SMBus.
	The LM75 temp sensors are read via the PIIX4's SMBus port, explained 
more in detail below. 
	

2.1 What is the SMBus?

	The SMBus is the "System Management Bus".  More specifically, it is a 
2-wire, low-speed serial communication bus used for basic health monitoring 
and hardware management. 
	The SMBus usually starts at the PIIX4, which contains a hardware 'host'
interface for starting transactions on the SMBus.  From the host interface, the
devices communicated with are the 'slave' devices.  Each slave device has a
unique 7-bit address in which the host must refer to it with. 
	Comminucations on the SMBus can be of five different types: 
	QUICK_WRITE -- Only the address of the slave device is sent on the SMBus
along with a 1-bit instruction (to make up a complete byte).  This is for 
really simple devices which can be turned on or off. 
	BYTE -- This is also known as the 'command' instruction.  It works the 
same as the QUICK_READ, but is also followed by a one byte 'command' to the 
slave. 
	BYTE_DATA -- Works like the BYTE communication, but is followed 
additionally by a byte of data.  [Actually, I'm not positive that the command 
byte is sent too, but it would seem silly if it wasn't.  I.e., it would be 
effectively the same thing.]
	WORD_DATA -- Again, works like the BYTE_DATA, but sends another 
additional byte of information. 
	BLOCK_DATA -- And, lastly, this is a way to send a whole block of data 
(up to 32 bytes) to a SMBus slave. 
	

2.2 What sensors does the Pentium 2 (and P6) have?

	The Pentium 2 'boxed' processor usually has an LM75 very close to the 
base of the box. It can be read through the SMBus to report the approximate 
temperature of the processor.  The processor also contains an internal 
temperature sensor (of low accuracy) used as a fail-safe to disable the 
processor in case it gets much too hot (usually around 130 degrees C).  And, 
the Pentium 2 also has a hard-wired signal (VID lines) on it's SEC (single 
edge connector) which indicates what power supply is required to operate the 
processor.
	Apparently, the SEC connector has connectivity to the thermal sensor 
for devices like the Analog Devices ADM1021 which has circuitry for 
converting the sense information into temperature degrees.  The Winbond 
chip's external temperature lines may be compatible with the P2 temperature 
lines as well.
	The P6 (Pentium-Pro) may have an LM75 in or just under the socket.  
P6's also have VID lines.
	Pentiums and Pentium w/ MMX do not have VID lines, and sometimes have 
LM75's under the sockets (depends on the mainboard, and how 'modern' the 
mainboard is).
	The P2 Xeon will be the first Intel processor to include the SMBus 
interface on the P2 Xeon SEC.
	

2.3 How often are the sensor values updated?

	The LM78 reads its sensors one by one. A complete scanning sweep will
take about 1.5 seconds. The LM78 stops readings sensors if you try to
access it, so if you access it very often (by reading sensor values;
writing new limits is safe) it will not find the time to update its sensor
values at all! Fortunately, the kernel module takes care not to do this.


2.4 How are alarms triggered?

	It is possible to monitor each sensor and let an alarm go off if
it crosses some pre-determined limits.  There are two sorts of interrupts
which can be generated by the LM78 if this happens (it depends a bit on
the actual chip if both are supported; the LM80, for example, has only
IRQ interrupts): IRQ interrupts and SMI interrupts.  IRQ stands for 
Interrupt Request and are the interrupt lines you can find in /proc/interrupts.
SMI stands for System Management Interrupt, and is a special interrupt which
puts the processor in a secure environment independent of any other things
running.  SMI is currently not supported by the Linux kernel.  IRQs are 
supported, of course.
	Even if no interrupt is generated, some bits in a status register
will be set until the register is read the next time. If the alarm condition
persists after that, the bits will be set on the next scanning sweep, etc.
	At this moment, interrupts are not supported.


3.1 Why do my fans report exactly half/double their values by your code
compared to the BIOS? 

	The problem with much of the sensor data is that it is impossible to 
properly interpret some of the readings without knowing what the hardware 
configuration is.  Because of this, we have had to make some assumptions based 
on the mainboards we have tested our code out on, but it is almost garanteed 
that there will be mainboards out there which use different values. 
	We have, however, tried to make some of the constants adjustable so as 
to easily custimize the code to your particular hardware. 
	

3.2 My manufacturer swears that my mainboard has an SMBus, but your code 
reports that it can't find it.  What's wrong? 

	Currently, our code only assumes that an SMBus exists if it originates 
from the Intel PIIX4 (82371AB).  If your computer doesn't have one, or if your 
SMBus originates from a different SMBus 'host', then you are out of luck. :'( 
Our experience is, though, that most machines have a PIIX4, and that it is 
where the SMBus is hosted.
	Please contact us if you have a motherboard with another SMBus host,
and are willing to help us by testing new code to support them.

Regarding the VIA chip set(s):
	Right now, the SMBus code depends on the Intel PIIX4 chip to handle 
SMBus transactions.  The VIA chip set is NOT supported at this time because 
it forces much of the SMBus protocol to be implemented by software.
	To implement the SMBus correctly with the VIA chip, it needs to be 
written at a low level to be quick.  A more attractive alternative is to 
use the Bios SMBus interface (not always available nor standard).


3.3 The modules won't load, saying 'SMBus not detected'.

        Try to recompile, this time setting SMBUS_MODULE to 0 in the Makefile.
As the SMBus is not detected, module smbus.o can not be inserted, and 
lm_sensors.o is dependant on it (depending on the version of the module).


3.4 Why do my two LM75's report "-48 degrees"?

	For starters, those aren't LM75's.  Your mainboard actually has the 
Winbond W83781D which emulates two LM75's, but many systems which use the 
Winbond chip (such as the Asus P2B) don't have the thermo-resisters connected 
to the chip resulting in these strange -48 degree readings.
	If you have an Asus P2B and want more information on adding thermal
sensing capability, check out:
http://ultimatepc.fsn.net/techinfo/p2bthermistor/p2bthermistor.htm
	We are currently working to support the Winbond chip better. Check
the website for new releases (it should be weeks at most).


3.5 Why do I have two Vcore readings, I have only one processor!

	The LM78 family has seven voltage sensors. All of them are displayed
in /proc/sensors, if you did not change anything in lm78.h, even if not
connected.
	Note that Vcore2 is usually the same as Vcore on motherboards which
only support one processor. It is possible, though, that is monitors something
else, so you should not be too surprised if the values are completely 
different.


3.6 How do those ALARMS work? The current value is within range but there
is still an ALARM warning in /proc/sensors.

	An ALARM will go off when a minimum or maximum limit is crossed. It 
will stay there until the next update of /proc/sensors - which will be
the next time you read /proc/sensors or any of the files in 
/proc/sys/dev/lm_sensors/. And even if you read those files, they will only
be updated once in the 1.5 seconds. So an ALARM can be very old if you do
not regularly read /proc/sensors, and it will stay up to 1.5 seconds after
you have read it. After that, it will only stay if the current value is
out of range.


3.7 My voltage readings seem to drift a bit. Is something wrong with my power
supply?

	No, probably not. If your motherboard heats up a bit, the sensed
voltages will drift a bit. If your power supply is loaded (because a disk
gets going, for example), the voltages may get a bit lower. As long as they
stay within a sensible range (say 10% of the expected value), there is no
reason to worry.


3.8 Vcore is way out of range. What happened?

	The module looks at the VID lines to determine what core voltage
is used by the processor(s). Regrettably, on plain Pentium or Pentium MMX
processors, these are not available. Also, either mainboard manufacturers
which use Winbond chips often do not connect these lines to the Winbond
chip, or there is some trick in reading them.
	If the VID lines value seems suspect (3.50V is such a value; this
is encoded by all-zero VID lines bits) the VCore limits are initialized
to a hard-coded default. You can change this default by editing lmconfig.h.


3.9 I try to read /proc/sensors, and I get a "No sensor data yet (try again in 
a few moments)" message. Why?

	It takes about 1.5 seconds for the LM78 to update all its sensor 
values.  If we would try to read it before it finished that, you would get
old garbage instead. So you have to wait 1.5 seconds after the module is
inserted before you can access /proc/sensors.
	Module versions 1.3.7 and later let the process sleep if it tries
to access sensor data right after insertion time, and do not display this
message anymore.


3.10 I try to read /proc/sensors several times a second, but it seems to be
updated only each second or so. Why?

	If we would read the LM78 registers more often, it would not find the
time to update them. So we only update our readings once each 1.5 seconds.


3.11 It sometimes seems to take a fraction of a seconds before I see the
results of a 'cat /proc/sensors'. Why?

	ISA bus access is fast, but SMBus access is really slow. If you have
a lot of LM75 sensors, or if you have a LM80 or a LM78 on the SMBus, it just
takes a lot of time to access them. Fortunately, this has almost no impact
on the system as a whole, as another job can run while we are waiting for
the transaction to finish.
	In 1.3.10 and later, this is much improved.


3.12 Can I be alerted when an ALARM occurs?

	No, you can't; and it may well be never supported.
	Almost no mainboard we have encountered have actually connected the
IRQ-out pin of the LM78. That means that we could enable IRQ reporting, but
nothing would happen. Also, even if a motherboard has it connected, it is
unclear what interrupt number would be triggered. And IRQ lines are a scarce
facility, which means that almost nobody would be able to use it anyway.
	The SMI interrupt is only available on a few types of chips. It is
really a very obscure way to handle interrupts, and supporting it under Linux
might be quite hard to do.
	Your best bet would be to poll /proc/sys/dev/lm_sensors/alarm with
a user-land daemon which alerts you if an alarm is raised. I am not aware
of any program which does the job, though you might want to examine
wmlm78 (http://users.ox.ac.uk/~kebl0850/wmlm78/), a graphic monitor under X.


3.13 SMBus transactions simply don't work (timeouts happen).  Why?

	Some chips which mainboard makers connect to the SMBus are not SMBus 
devices.  An example is the 91xx clock generator chips.  When read, these 
devices can lock up the SMBus until the next hard reboot.  This is because 
they have a similar serial interface (like the I2C), but don't conform to 
Intel's SMBus standard.
	Why did they connect these devices to the SMBus if they aren't 
compatible?  Good question! :')  Actually, these devices may support being 
written to, but lock things up when they are read.


3.14 My BIOS reports a much higher CPU temperature than your module!

	We display the actual temperature of the sensor. This may not be the 
temperature you are interested in, though.  If a sensor should measure
the CPU temperature, it must be in thermal contact with it.  In practice,
it is just somewhere near it. Your BIOS may correct for this (by adding,
for example, thirty degrees to the measured temperature).  The correction 
factor is regrettably different for each mainboard, so we can not do this.
We may implement a way to specify such a factor, but it is quite low on
our to-do list.


3.15 On my Dell, a LM80 is detected, but all readings are 0!

	This is a bug we have only observed on Dell computers. There is
probably a problem with the way the SMBus is accessed; but it is not yet
clear whether the problem is in our code or with the Dells.
	There are very probably no sensor chips at all on your computer;
but until somebody contacts Dell about this and tells us the results, we
can not be sure.


4 How to ask for help:

	We are always willing to answer questions if things don't work out.
You can mail either Philip Edelbrock <phil@netroedge.com> or Frodo Looijaard
<frodol@dds.nl>, or even better, mail both of us at once.


4.1 What to do if it won't insert?

	Always inspect the output of 'dmesg' and send it to us. Check
/proc/pci to see whether you have a PIIX4, and tell us. Check whether
you actually have a sensor chip - sometimes, it is only an upgrade option.
If your mainboard manual happens to mention the chip type, send it too.
Tell us what mainboard you own.


4.2 What to do if it inserts, but the SMBus is not detected?

	Check /proc/pci to see whether you have a PIIX4. If it is not there,
we do not support it. Future version may do it. If you want, you can send
us an email telling you have a such-and-so mainboard, together with the
PCI output - that way, we can see what SMBus hosts are used most.


4.3 What to do if /proc/sensors output has some strange values?

	It is normal to have one bogus LM75 if you own a Winbond W83781D.
It is normal to have one or two fans unconnected. It is somewhat normal
to read strange values for Vcore2. Anything else may be a bug or problem.
	Please send us the output of 'dmesg' and /proc/sensors. Check your
mainboard manual for the chip type. 


4.4 What to do if you have other problems?

	Again, send the output of 'dmesg', /proc/sensors and /proc/pci.


4.5 What if it just works like a charm?

	Drop us a mail if you feel like it, mentioning the mainboard and
detected chip type. That way, we have some positive feedback, too!


-----------
Rev 1.10 (Frodo) Modified 3.8, updated some other things, 19980924
Rev 1.9 (Frodo) Added 3.15, 19980906
Rev 1.8 (Frodo) Added 3.14, 19980905
Rev 1.7 (Phil) Added 3.13 and some other minor changes, 19980901
Rev 1.6 (Frodo) Added 4, 4.1, 4.2, 4.3, 4.4, 4.5, 19980901
Rev 1.5 (Frodo) Added 2.3, 2.4, 3.9, 3.10, 3.11, 19980826
Rev 1.4 (Frodo) Added some more Winbond information, and 3.5-3.8, 19980817
Rev 1.3 Added info on the Winbond chip, 19980816
Rev 1.2 Adapation by Frodo Looijaard, 19980810
Rev 1.1 Modifications by Philip Edelbrock, 19980809
Rev 1.0 Written by Philip Edelbrock, 19980803
