Skip to contentSkip to conversation

bug : mkdev.sh creates devices that sensors-detect cannot use

DISCUSSION stu 2 participants 7 messages May 19, 2005

lore
Share & tools
lore

stu

author
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi everyone

I hope this is the correct forum to report bugs, and that this bug hasn't been reported already. If it isn't the correct forum, please let me know where I should report it.

Just downloaded and installed lm_sensors-2.8.7 from source. I've found a small bug. When I run mkdev.sh, it creates devices named like so :

/dev/i2c-0
/dev/i2c-1
/dev/i2c-2

etc

However, sensors-detect looks for a device named /dev/i2c/0 and can't find it. This causes sensors-detect to skip the probing of my SMBus Via Pro adapter, and gives the error :

Can't open /dev/i2c/0

To get around this I hacked sensors-detect and changed the line :

   $dev_i2c = '/dev/i2c/';

to read

   $dev_i2c = '/dev/i2c-';

in subroutine 'initialize_conf' . This solved my problem.

I'll gladly provide more information if necessary. My apologies if this bug has already been reported.

Regards and best wishes
- --
Stuart Logie
Programmer

UNIVERSAL COMPUTER SERVICES (PTY) LTD

Powered by Debian GNU/Linux
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iQCVAwUBQO15SOuEbVzzghHCAQIy7gQApF6xKKcooqhb5VTPDe44xqpI7+D7F+Ej sJnwYq3eSiSMYMMBAkIKSuqXKUmpYFG0yDNz3V76FTXK04rNLO8rAbUGnKr+TyH+ UBm/nmKuNXNjcvGdikZ5PT7FBx4LMbE6hSG7tpr86/7KSlR25hHaBgSKO7Tt2p6j OdBMfA0JNCk=wJjp
-----END PGP SIGNATURE-----

#1 lore raw
Quoted 11 lines

I hope this is the correct forum to report bugs, and that this bug hasn't been reported already. If it isn't the correct forum, please let me know where I should report it.

Just downloaded and installed lm_sensors-2.8.7 from source. I've found a small bug. When I run mkdev.sh, it creates devices named like so :

/dev/i2c-0
/dev/i2c-1
/dev/i2c-2

Quoted 7 lines

etc

However, sensors-detect looks for a device named /dev/i2c/0 and can't find it. This causes sensors-detect to skip the probing of my SMBus Via Pro adapter, and gives the error :

Can't open /dev/i2c/0

First of all, which version of lm_sensors are you using?

Both names exist, depends on your system. /dev/i2c/0 is for people using devfs. It is created by devfs, no script is needed. /dev/i2c-0 is for other people (not using devfs). It needs to be created manually if your distrubution didn't do it for you.

If the sensors-detect script searches for /dev/i2c/0, it means that it detected that your system uses devfs. Is it true?

If it then complains that it didn't find it, it means that i2c-dev was not loaded as it should. Maybe you miss that driver in your current kernel configuration?

If you are using the latest version if sensors-detect AND you use devfs AND you have i2c-dev loaded AND sensors-detect still complains, then this is likely to be a problem with your bus driver (i2c-viapro).

Signature · 2 lines
Jean Delvare
http://khali.linux-fr.org/
#2 lore raw
In reply to stu
Quoted 4 lines
Quoted 2 lines

First of all, which version of lm_sensors are you using?

As above, version 2.8.7 . I downloaded it yesterday using :

Ooops, sorry. I missed the information at first, my bad.

Quoted 9 lines
Quoted 3 lines

If you are using the latest version if sensors-detect AND you use devfs AND you have i2c-dev loaded AND sensors-detect still complains, then this is likely to be a problem with your bus driver (i2c-viapro).

When I insmod i2c-viapro, devfs doesn't create any new devices. However, after reading your response this morning, I removed all the i2c devices I created, rmmodded all i2c modules except i2c-core and i2c-dev and reran sensors-detect. The same message appeared:

Quoted 4 lines

Can't open /dev/i2c/0

but I continued with the config process, ran sensors and voila! works perfectly.

Hmm, strange. I guess that your hardware monitoring chipset is located on the ISA bus (thus using i2c-isa instead of i2c-viapro)?

I don't use devfs myself, but I think that it is OK not to have /dev/i2c/0 with only i2c-dev loaded. Device files should be created as you load bus driver modules. Could someone with devfs confirm this?

I don't think you told us which (exact) kernel version you were using, did you?

Quoted 5 lines

Now that I have it working, lm_sensors will be installed on all of a client's servers (+- 200) and will be used to provide valuable, hitherto inaccessible information about the state of their cpus and fans. If this is successful, as I'm sure it will be, it is intended to roll out lm_sensors to some of our other clients too.

Do all of these servers have similar hardware? Remember that your experience with lm_sensors depends much on the exact hardware configuration.

Quoted 2 lines

Please accept an apology for my hasty assumption and thanks for a great and essential tool!

I don't see much you should apologize about. Although it didn't seem to prevent you from using lm_sensors, there still is something bad with your hardware/devfs/lm_sensors/kernel combination and we better find out what it is. I admit I don't have many ideas at the moment, mainly because I don't use devfs myself so there is no chance I could reproduce the problem.

At least, one thing we could do: detect devfs at the beginning of mkdev.sh, and bail out with a message instead of silently creating useless device files?

Thanks,
Jean Delvare

author
#3 lore raw
In reply to stu

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 11 lines · On Thu, 8 Jul 2004 22:54:11 +0200 Jean Delvare <[email protected]> wrote:
Quoted 11 lines

I hope this is the correct forum to report bugs, and that this bug hasn't been reported already. If it isn't the correct forum, please let me know where I should report it.

Just downloaded and installed lm_sensors-2.8.7 from source. I've found a small bug. When I run mkdev.sh, it creates devices named like so :

/dev/i2c-0
etc

Quoted 7 lines
Quoted 5 lines

However, sensors-detect looks for a device named /dev/i2c/0 and can't find it. This causes sensors-detect to skip the probing of my SMBus Via Pro adapter, and gives the error :

Can't open /dev/i2c/0

First of all, which version of lm_sensors are you using?

As above, version 2.8.7 . I downloaded it yesterday using :

http://www.lm-sensors.nu/archive/lm_sensors-2.8.7.tar.gz

Quoted 2 lines

If the sensors-detect script searches for /dev/i2c/0, it means that it detected that your system uses devfs. Is it true?

*blush* yes, it does. (me hangs his head in shame for not reading the instructions thoroughly)

Quoted 3 lines

If you are using the latest version if sensors-detect AND you use devfs AND you have i2c-dev loaded AND sensors-detect still complains, then this is likely to be a problem with your bus driver (i2c-viapro).

When I insmod i2c-viapro, devfs doesn't create any new devices. However, after reading your response this morning, I removed all the i2c devices I created, rmmodded all i2c modules except i2c-core and i2c-dev and reran sensors-detect. The same message appeared:

Can't open /dev/i2c/0

but I continued with the config process, ran sensors and voila! works perfectly.

Now that I have it working, lm_sensors will be installed on all of a client's servers (+- 200) and will be used to provide valuable, hitherto inaccessible information about the state of their cpus and fans. If this is successful, as I'm sure it will be, it is intended to roll out lm_sensors to some of our other clients too.

Please accept an apology for my hasty assumption and thanks for a great and essential tool!

- --
Stuart Logie
Programmer

UNIVERSAL COMPUTER SERVICES (PTY) LTD

Powered by Debian GNU/Linux
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iQCVAwUBQO5usOuEbVzzghHCAQLYQwP+N58iMkO3fOMXWAXF7EQgabxycOJ5HB+6 Td3TDV52AoSIQUFeCteWB1dodv6/3/kIsFYLWD7V/AhYpux5w0xtArW7ye0C+vUA NPsCuMBVMW6xxU9PthjxdKu6cblF2XIyPLg5tk2tncTQ3MkN8ZpgAnWJMytIRK3G ZQfbJIUJwsYçdH
-----END PGP SIGNATURE-----

#4 lore raw
In reply to stu
Quoted 1 line
Quoted 1 line

When I insmod i2c-viapro, devfs doesn't create any new devices.

Just had a similar problem today, with the same driver (i2c-viapro). Are you by any chance using any of 2.6.7-mm3, -mm5, -mm6 or -mm7 as your kernel, and are using ACPI?

Thanks.

Signature · 2 lines
Jean "Khali" Delvare
http://www.ensicaen.ismra.fr/~delvare/
#5 lore raw
In reply to stu
Quoted 16 lines

No, the kernel version is 2.4.18. The machine I installed lm_sensors on is unavailable atm, so I can't check whether or not acpi is being used. However, a similar machine's dmesg reveals :

Linux version 2.4.18 ([email protected]) (gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)) #4 SMP Thu May 16 00:39:32 SAST 2002 BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
BIOS-e820: 000000000009fc00 - 00000000000a0000(reserved)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000000f7fc000 (usable)
BIOS-e820: 000000000f7fc000 - 000000000f7ff000 (ACPI data)
BIOS-e820: 000000000f7ff000 - 000000000f800000 (ACPI NVS)
BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)

Quoted 2 lines

Dunno if this means acpi is being used or not, as there are no other entries in dmesg containing this string.

Unless heavily patched, a 2.4.18 kernel couldn't have support for ACPI, as it wasn't even part of the kernel tree back then. When there, the ACPI supports shouts much more than that anyway ;)

Do you have similar results on this second machine as with the original one, or did you just not try lm_sensors (yet)?

Could you please provide the contents of /proc/ioports for this similar machine (or the original one if you ever get access again)?

Quoted 3 lines

Bear in mind though that even without devfs creating any new devices, sensors had enough to work from to give me the info I needed / expected to get ie CPU temp, fan RPMs etc.

I suspect that your hardware monitoring chip was found on the ISA bus (it should show in the form *-isa-* in "sensors"), so your SMBus is actually not used and most likely not working. I would of course appreciate it if you could confirm that. Maybe you don't care (since it seems to work fine) but that's still a problem we'll have to remember of.

Anyway, with such a different version of the kernel, I have to admit that your problem and mine are not related, at least not directly.

Thanks,
Jean Delvare

author
#6 lore raw
In reply to stu

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · On Sun, 11 Jul 2004 20:48:10 +0200 Jean Delvare <[email protected]> wrote:
Quoted 1 line
Quoted 1 line

When I insmod i2c-viapro, devfs doesn't create any new devices.

Just had a similar problem today, with the same driver (i2c-viapro). Are you by any chance using any of 2.6.7-mm3, -mm5, -mm6 or -mm7 as your kernel, and are using ACPI?

No, the kernel version is 2.4.18. The machine I installed lm_sensors on is unavailable atm, so I can't check whether or not acpi is being used. However, a similar machine's dmesg reveals :

Linux version 2.4.18 ([email protected]) (gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)) #4 SMP Thu May 16 00:39:32 SAST 2002 BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
BIOS-e820: 000000000009fc00 - 00000000000a0000(reserved)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000000f7fc000 (usable)
BIOS-e820: 000000000f7fc000 - 000000000f7ff000 (ACPI data)
BIOS-e820: 000000000f7ff000 - 000000000f800000 (ACPI NVS)
BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)

Dunno if this means acpi is being used or not, as there are no other entries in dmesg containing this string.

Bear in mind though that even without devfs creating any new devices, sensors had enough to work from to give me the info I needed / expected to get ie CPU temp, fan RPMs etc.

- --
Stuart Logie
Programmer

UNIVERSAL COMPUTER SERVICES (PTY) LTD

Powered by Debian GNU/Linux
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iQCVAwUBQPZq8uuEbVzzghHCAQIDJgP/Uf8klbFAD8bmuSndDeii2Bgb2u/SLJgO R7URurwGvwRHCTrJGFa3qWmeq/JX6B9MvxdV+fXrLT3hiT6bT8xXzrSL+ZlQMrgq 5bFJBC+X67Ilahzi1Tj1T6bFqfXJeAgANo8mCyiLPoP/A7h6nYa4NhQPRPyHQH2u nPh6s+E+rW8=W8e3
-----END PGP SIGNATURE-----