rpms/lm_sensors/F-8 lm_sensors-2.10.6-r5147.patch, NONE, 1.1 lm_sensors-2.10.6-r5234.patch, NONE, 1.1 lm_sensors-2.10.6-r5247.patch, NONE, 1.1 lm_sensors.spec, 1.56, 1.57

Hans de Goede (jwrdegoede) fedora-extras-commits at redhat.com
Tue Jul 1 10:10:28 UTC 2008


Author: jwrdegoede

Update of /cvs/extras/rpms/lm_sensors/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26555

Modified Files:
	lm_sensors.spec 
Added Files:
	lm_sensors-2.10.6-r5147.patch lm_sensors-2.10.6-r5234.patch 
	lm_sensors-2.10.6-r5247.patch 
Log Message:
* Tue Jul  1 2008 Hans de Goede <j.w.r.degoede at hhs.nl> - 2.10.6-2
- Rebuild for new rrdtool (bug 453516)
- Add 3 upstream advised patches from upstream svn:
  - sensors-detect: Do not probe I2C addresses 0x40-0x47 (dangerous)
  - sensors-detect: See if a device is a 1 register device and if so leave it
      alone (aka don't mess with voltages on some Sapphire / DFI motherboards)
  - libsensors: Don't choke on unrecognized devices 


lm_sensors-2.10.6-r5147.patch:

--- NEW FILE lm_sensors-2.10.6-r5147.patch ---
Index: trunk/lib/sysfs.c
===================================================================
--- trunk/lib/sysfs.c (revision 5086)
+++ trunk/lib/sysfs.c (revision 5147)
@@ -183,8 +183,6 @@
 	dlist_for_each_data(clsdevs, clsdev, struct sysfs_class_device) {
 		struct sysfs_device *dev;
-		if (!(dev = sysfs_get_classdev_device(clsdev))) {
-			ret = -SENSORS_ERR_PROC;
-			goto exit;
-		}
+		if (!(dev = sysfs_get_classdev_device(clsdev)))
+			continue;
 		if ((ret = sensors_read_one_sysfs_chip(dev)))
 			goto exit;
Index: trunk/CHANGES
===================================================================
--- trunk/CHANGES (revision 5139)
+++ trunk/CHANGES (revision 5147)
@@ -3,4 +3,5 @@
 
 SVN-HEAD
+  Library: Don't choke on unrecognized devices, part 2
   Program sensors-detect: New device ID for the SMSC SCH5317
 
@@ -8,5 +9,5 @@
   Library: Fix fschrc and fschmd support
            Fix sysfs presence detection
-           Don't choke on unrecognized devices (#2087)
+           Don't choke on unrecognized devices, part 1 (#2087)
            Fix lm93 vid2 access (#2295)
            No in1 on w83783s

lm_sensors-2.10.6-r5234.patch:

--- NEW FILE lm_sensors-2.10.6-r5234.patch ---
Index: trunk/prog/detect/sensors-detect
===================================================================
--- trunk/prog/detect/sensors-detect (revision 5233)
+++ trunk/prog/detect/sensors-detect (revision 5234)
@@ -1129,5 +1129,7 @@
        name => "Maxim MAX6633/MAX6634/MAX6635",
        driver => "lm92",
-       i2c_addrs => [0x40..0x4f],
+       i2c_addrs => [0x48..0x4f], # The MAX6633 can also use 0x40-0x47 but we
+                                  # don't want to probe these addresses, it's
+                                  # dangerous.
        i2c_detect => sub { lm92_detect(2, @_); },
      },
Index: trunk/CHANGES
===================================================================
--- trunk/CHANGES (revision 5231)
+++ trunk/CHANGES (revision 5234)
@@ -17,4 +17,5 @@
                           Add Asus F8000 detection
                           Add Intel ICH10 (bus) detection
+                          Don't probe I2C addresses 0x40-0x47
 
 2.10.6 "Welcome Home Lina" (20080306)

lm_sensors-2.10.6-r5247.patch:

--- NEW FILE lm_sensors-2.10.6-r5247.patch ---
Index: trunk/prog/detect/sensors-detect
===================================================================
--- trunk/prog/detect/sensors-detect (revision 5244)
+++ trunk/prog/detect/sensors-detect (revision 5247)
@@ -2762,4 +2762,41 @@
 }
 
+# $_[0]: Reference to an opened file handle
+# Returns: 1 if the device is safe to access, 0 else.
+# This function is meant to prevent access to 1-register-only devices,
+# which are designed to be accessed with SMBus receive byte and SMBus send
+# byte transactions (i.e. short reads and short writes) and treat SMBus
+# read byte as a real write followed by a read. The device detection
+# routines would write random values to the chip with possibly very nasty
+# results for the hardware. Note that this function won't catch all such
+# chips, as it assumes that reads and writes relate to the same register,
+# but that's the best we can do.
+sub i2c_safety_check
+{
+  my ($file) = @_;
+  my $data;
+
+  # First we receive a byte from the chip, and remember it.
+  $data = i2c_smbus_read_byte($file);
+  return 1 if ($data < 0);
+
+  # We receive a byte again; very likely to be the same for
+  # 1-register-only devices.
+  return 1 if (i2c_smbus_read_byte($file) != $data);
+
+  # Then we try a standard byte read, with a register offset equal to
+  # the byte we received; we should receive the same byte value in return.
+  return 1 if (i2c_smbus_read_byte_data($file, $data) != $data);
+
+  # Then we try a standard byte read, with a slightly different register
+  # offset; we should again receive the same byte value in return.
+  return 1 if (i2c_smbus_read_byte_data($file, $data ^ 1) != ($data ^ 1));
+
+  # Apprently this is a 1-register-only device, restore the original register
+  # value and leave it alone.
+  i2c_smbus_read_byte_data($file, $data);
+  return 0;
+}
+
 ####################
 # ADAPTER SCANNING #
@@ -3108,4 +3145,8 @@
     next unless i2c_probe(\*FILE, $addr, $funcs);
     printf "Client found at address 0x%02x\n",$addr;
+    if (!i2c_safety_check(\*FILE)) {
+      print "Seems to be a 1-register-only device, skipping.\n";
+      next;
+    }
 
     $| = 1;
Index: trunk/CHANGES
===================================================================
--- trunk/CHANGES (revision 5244)
+++ trunk/CHANGES (revision 5247)
@@ -19,4 +19,5 @@
                           Don't probe I2C addresses 0x40-0x47
                           Fix the parsing of I2C addresses not to scan
+                          Detect and skip 1-register-only I2C devices
 
 2.10.6 "Welcome Home Lina" (20080306)


Index: lm_sensors.spec
===================================================================
RCS file: /cvs/extras/rpms/lm_sensors/F-8/lm_sensors.spec,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- lm_sensors.spec	12 Mar 2008 19:33:52 -0000	1.56
+++ lm_sensors.spec	1 Jul 2008 10:09:42 -0000	1.57
@@ -1,6 +1,6 @@
 Name: lm_sensors
 Version: 2.10.6
-Release: 1%{?dist}
+Release: 2%{?dist}
 URL: http://www.lm-sensors.org/
 Source: http://dl.lm-sensors.org/lm-sensors/releases/%{name}-%{version}.tar.gz
 Source1: lm_sensors.sysconfig
@@ -9,6 +9,9 @@
 Source3: sensord.init
 Patch0: lm_sensors-2.10.6-service-default-off.patch
 Patch1: lm_sensors-2.10.6-lsb-retcodes.patch
+Patch2: lm_sensors-2.10.6-r5147.patch
+Patch3: lm_sensors-2.10.6-r5234.patch
+Patch4: lm_sensors-2.10.6-r5247.patch
 Summary: Hardware monitoring tools
 Group: Applications/System
 License: GPLv2+
@@ -63,6 +66,9 @@
 %setup -q 
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
 mv prog/init/README prog/init/README.initscripts
 chmod -x prog/init/fancontrol.init
 
@@ -164,6 +170,14 @@
 
 
 %changelog
+* Tue Jul  1 2008 Hans de Goede <j.w.r.degoede at hhs.nl> - 2.10.6-2
+- Rebuild for new rrdtool (bug 453516)
+- Add 3 upstream advised patches from upstream svn:
+  - sensors-detect: Do not probe I2C addresses 0x40-0x47 (dangerous)
+  - sensors-detect: See if a device is a 1 register device and if so leave it
+      alone (aka don't mess with voltages on some Sapphire / DFI motherboards)
+  - libsensors: Don't choke on unrecognized devices 
+
 * Wed Mar 12 2008 Hans de Goede <j.w.r.degoede at hhs.nl> - 2.10.6-1
 - New upstream bugfix release 2.10.6 (fixes bz 436767)
 - Add a patch to make the initscript returncodes LSB compliant (bug 431884)




More information about the scm-commits mailing list