You are not logged in.

#1 2008-03-27 20:52:45

firewalker
Member
From: Hellas (Greece).
Registered: 2006-06-05
Posts: 552

[SOLVED] lm sensors and kernel 2.6.24 problem

I tried to install lm_sensor but I can't make it work with kernel 2.6.24. I also have installed kernel 2.6.21 viper an lm_sensor works fine.

With kernel 2.6.24

/etc/rc.d/sensors start

: Starting Up Sensors                                                   [BUSY]
No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.
                                                                                 [DONE]

Running sensors-detect

# sensors-detect revision 5108 (2008-01-22 13:22:47 +0100)

This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.

We can start with probing for (PCI) I2C or SMBus adapters.
Do you want to probe now? (YES/no): YES
Probing for PCI bus adapters...
Use driver `i2c-viapro' for device 0000:00:07.3: VIA Technologies VT82C596 Apollo ACPI

We will now try to load each adapter module in turn.
Module `i2c-viapro' already loaded.
If you have undetectable or unsupported adapters, you can have them
scanned by manually loading the modules before running this script.

We are now going to do the I2C/SMBus adapter probings. Some chips may
be double detected; we choose the one with the highest confidence
value in that case.
If you found that the adapter hung after probing a certain address,
you can specify that address to remain unprobed.

Next adapter: SMBus Via Pro adapter at 5000 (i2c-0)
Do you want to scan it? (YES/no/selectively): YES
Client found at address 0x50
Handled by driver `eeprom' (already loaded), chip type `eeprom'
    (note: this is probably NOT a sensor chip!)
Client found at address 0x51
Handled by driver `eeprom' (already loaded), chip type `eeprom'
    (note: this is probably NOT a sensor chip!)
Client found at address 0x52
Handled by driver `eeprom' (already loaded), chip type `eeprom'
    (note: this is probably NOT a sensor chip!)

Next adapter: NVIDIA i2c adapter  (i2c-1)
Do you want to scan it? (YES/no/selectively): YES
Client found at address 0x50
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 No
Probing for `EDID EEPROM'...                                Yes
    (confidence 8, not a hardware monitoring chip)
Client found at address 0x51
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 No
Probing for `EDID EEPROM'...                                Yes
    (confidence 8, not a hardware monitoring chip)
Client found at address 0x52
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 No
Probing for `EDID EEPROM'...                                Yes
    (confidence 8, not a hardware monitoring chip)
Client found at address 0x53
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 No
Probing for `EDID EEPROM'...                                Yes
    (confidence 8, not a hardware monitoring chip)

Next adapter: NVIDIA i2c adapter  (i2c-2)
Do you want to scan it? (YES/no/selectively): YES

Next adapter: NVIDIA i2c adapter  (i2c-3)
Do you want to scan it? (YES/no/selectively): YES

Some chips are also accessible through the ISA I/O ports. We have to
write to arbitrary I/O ports to probe them. This is usually safe though.
Yes, you do have ISA I/O ports even if you do not have any ISA slots!
Do you want to scan the ISA I/O ports? (YES/no): YES
Probing for `National Semiconductor LM78' at 0x290...       No
Probing for `National Semiconductor LM78-J' at 0x290...     No
Probing for `National Semiconductor LM79' at 0x290...       No
Probing for `Winbond W83781D' at 0x290...                   No
Probing for `Winbond W83782D' at 0x290...                   Success!
    (confidence 8, driver `w83781d')

Probing for `Silicon Integrated Systems SIS5595'...         No
Probing for `VIA VT82C686 Integrated Sensors'...            No
Probing for `VIA VT8231 Integrated Sensors'...              No
Probing for `IPMI BMC KCS' at 0xca0...                      No
Probing for `IPMI BMC SMIC' at 0xca8...                     No

Some Super I/O chips may also contain sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no): YES
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Fintek'...                       No
Trying family `ITE'...                                      No
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Fintek'...                       No
Trying family `ITE'...                                      No

Some CPUs or memory controllers may also contain embedded sensors.
Do you want to scan for them? (YES/no): YES
AMD K8 thermal sensors...                                   No
AMD K10 thermal sensors...                                  No
Intel Core family thermal sensor...                         No
Intel AMB FB-DIMM thermal sensor...                         No

Now follows a summary of the probes I have just done.
Just press ENTER to continue:

Driver `w83781d' (should be inserted):
  Detects correctly:
  * ISA bus, address 0x290
    Chip `Winbond W83782D' (confidence: 8)

Do you want to overwrite /etc/sysconfig/lm_sensors? (YES/no): YES
Copy prog/init/lm_sensors.init to /etc/init.d/lm_sensors
for initialization at boot time.
You should now start the lm_sensors service to load the required
kernel modules.

The /etc/sysconfig/lm_sensors

#    /etc/sysconfig/lm_sensors - Defines modules loaded by
#                                /etc/init.d/lm_sensors
#    Copyright (c) 1998 - 2001  Frodo Looijaard <frodol@dds.nl>
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
# See also the lm_sensors homepage at:
#     http://www.lm-sensors.org/
#
# This file is used by /etc/init.d/lm_sensors and defines the modules to
# be loaded/unloaded. This file is sourced into /etc/init.d/lm_sensors.
#
# The format of this file is a shell script that simply defines the modules
# in order as normal variables with the special names:
#    MODULE_0, MODULE_1, MODULE_2, etc.
#
# List the modules that are to be loaded for your system
#
# Generated by sensors-detect on Thu Mar 27 21:15:48 2008
MODULE_0=i2c-viapro
MODULE_1=eeprom
MODULE_2=w83781d

All the above modules are loaded. Booting the older kernel makes lm_sensor to function normally. What am I doing wrong?

Last edited by firewalker (2008-03-29 20:16:12)


Γίνε ρεαλιστής, μείνε ονειροπόλος ...

Offline

#2 2008-03-28 18:20:28

firewalker
Member
From: Hellas (Greece).
Registered: 2006-06-05
Posts: 552

Re: [SOLVED] lm sensors and kernel 2.6.24 problem

I can't find a solution! I tried with kernel 2.6.22 and it works! I noticed that when I load the module w83781d in kernel others from 2.6.24 dmesg "says" w83781d: Found a w83782 chip at ISA... and some other infos. When loading  w83781d in kernel 2.6.24 (stock) dmesg doesn't "say" anything. I copied w83781d.c from kernel 2.6.22 and compiled it against kernel 2.6.24. I loaded the new module successfully. It loads with no error but sensors doesn't work. [b]dmesg[/g] doesn't produce a message either with the new module. I don't know what to try next.


Γίνε ρεαλιστής, μείνε ονειροπόλος ...

Offline

#3 2008-03-29 15:13:48

firewalker
Member
From: Hellas (Greece).
Registered: 2006-06-05
Posts: 552

Re: [SOLVED] lm sensors and kernel 2.6.24 problem

It have to be a bug. I tried a fresh install of Arch in an old disk of mine and sensors didn't work. I guess it is a kernel bug because I saw that w83781d.c has changed to the last version (2.6.24).


Γίνε ρεαλιστής, μείνε ονειροπόλος ...

Offline

#4 2008-03-29 17:32:09

carlocci
Member
From: Padova - Italy
Registered: 2008-02-12
Posts: 368

Re: [SOLVED] lm sensors and kernel 2.6.24 problem

Offline

#5 2008-03-29 17:33:26

firewalker
Member
From: Hellas (Greece).
Registered: 2006-06-05
Posts: 552

Re: [SOLVED] lm sensors and kernel 2.6.24 problem

Confirmed. It is a kernels bug.

http://www.lm-sensors.org/ticket/2306

Solution:
Download and apply the patch.

Only request I/O ports 0x295-0x296 instead of the full I/O address
range. This solves a conflict with PNP resources on a few motherboards.

Also request the I/O ports in two parts (4 low ports, 4 high ports)
during device detection, otherwise the PNP resource make the request
(and thus the detection) fail.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
---
 drivers/hwmon/w83781d.c |   21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

--- linux-2.6.25-rc4.orig/drivers/hwmon/w83781d.c    2008-02-26 13:37:12.000000000 +0100
+++ linux-2.6.25-rc4/drivers/hwmon/w83781d.c    2008-03-08 10:22:15.000000000 +0100
@@ -1367,7 +1367,8 @@ w83781d_isa_probe(struct platform_device
 
     /* Reserve the ISA region */
     res = platform_get_resource(pdev, IORESOURCE_IO, 0);
-    if (!request_region(res->start, W83781D_EXTENT, "w83781d")) {
+    if (!request_region(res->start + W83781D_ADDR_REG_OFFSET, 2,
+                "w83781d")) {
         err = -EBUSY;
         goto exit;
     }
@@ -1415,7 +1416,7 @@ w83781d_isa_probe(struct platform_device
     device_remove_file(&pdev->dev, &dev_attr_name);
     kfree(data);
  exit_release_region:
-    release_region(res->start, W83781D_EXTENT);
+    release_region(res->start + W83781D_ADDR_REG_OFFSET, 2);
  exit:
     return err;
 }
@@ -1429,7 +1430,7 @@ w83781d_isa_remove(struct platform_devic
     sysfs_remove_group(&pdev->dev.kobj, &w83781d_group);
     sysfs_remove_group(&pdev->dev.kobj, &w83781d_group_opt);
     device_remove_file(&pdev->dev, &dev_attr_name);
-    release_region(data->client.addr, W83781D_EXTENT);
+    release_region(data->client.addr + W83781D_ADDR_REG_OFFSET, 2);
     kfree(data);
 
     return 0;
@@ -1797,8 +1798,17 @@ w83781d_isa_found(unsigned short address
 {
     int val, save, found = 0;
 
-    if (!request_region(address, W83781D_EXTENT, "w83781d"))
+    /* We have to request the region in two parts because some
+       boards declare base+4 to base+7 as a PNP device */
+    if (!request_region(address, 4, "w83781d")) {
+        pr_debug("w83781d: Failed to request low part of region\n");
         return 0;
+    }
+    if (!request_region(address + 4, 4, "w83781d")) {
+        pr_debug("w83781d: Failed to request high part of region\n");
+        release_region(address, 4);
+        return 0;
+    }
 
 #define REALLY_SLOW_IO
     /* We need the timeouts for at least some W83781D-like
@@ -1871,7 +1881,8 @@ w83781d_isa_found(unsigned short address
             val == 0x30 ? "W83782D" : "W83781D", (int)address);
 
  release:
-    release_region(address, W83781D_EXTENT);
+    release_region(address, 4);
+    release_region(address + 4, 4);
     return found;
 }

Γίνε ρεαλιστής, μείνε ονειροπόλος ...

Offline

Board footer

Powered by FluxBB