100 Commits
Author SHA1 Message Date
Jean Delvare 8fb3922219 isadump: Fix compilation under musl
From Brendan Heading:

You may be aware of the musl C-library implementation, which tries to
be strictly standards compliant, avoids non-standard extensions, etc.
Some distributions have adopted it as their standard C library, in
others (such as buildroot) it is a configuration alternative.

Vanilla lm-sensors does not compile under musl, due to the following
excerpt which appears in four different places. The code is checking
that the glibc version is greater than 2.0.

#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 0
#include <sys/io.h>
#else
#include <asm/io.h>
#endif

This fails under musl does not define __GLIBC__ (in fact, by design,
it doesn't provide any way to identify itself at all) - which causes
it to try to include <asm/io.h> rather than <sys/io.h>.

It's a long time since glibc 2.0.1 was released - 1997. Accordingly,
it seems to make little sense at this stage to try to retain
compatibility with very old libcs - so maybe it should be removed
entirely.
2015-08-31 07:34:51 +00:00
Jean Delvare 6507372685 sensors-detect: Only probe I/O ports on x86
Contributed by Aurelien Jarno.
2015-08-10 09:04:53 +00:00
Jean Delvare 991c8d5f9a sensors.1: Add reference to sensors-detect
Contributed by Aurelien Jarno.
2015-08-10 08:23:41 +00:00
Jean Delvare 76e050dc2f sensors-detect: Add detection of Fintek F81768 2015-07-06 12:11:15 +00:00
Jean Delvare b26a85f06c sensors-detect: Fix systemd paths 2015-07-06 11:51:24 +00:00
Jean Delvare 75dbc240d9 Fix URL format 2015-07-06 11:50:45 +00:00
Jean Delvare 580149a3ab Post-release version update. 2015-06-25 11:47:43 +00:00
Jean Delvare f9185e5c06 Prepare for release. 2015-06-25 11:24:47 +00:00
Jean Delvare 096a5fc953 fancontrol: Reduce memory consumption
Construct "wait $!" causes bash to remember the exit status of the
children. This consumes memory. We don't need the status code and we
are only waiting for a single child, so we can simply use "wait". This
will reduce the memory usage.

This partly fixes ticket #2391.
http://www.lm-sensors.org/ticket/2391

The actual leak is in bash 4.3 and should be fixed there.
2015-06-25 10:34:52 +00:00
Jean Delvare 59df826a29 Freecode is gone. 2015-06-17 10:53:44 +00:00
Jean Delvare 955a371506 Be more flexible when parsing address list 2015-05-31 12:00:33 +00:00
Jean Delvare b457bc7c63 sensors-detect: Skip addresses 0x37 and 0x4f on DDC channels
We already skip EDID addresses (0x50-0x57) by default on graphics card
I2C/DDC buses. Also skip 0x37 (DDC/CI) and 0x4f which was recently
reported as corrupting a laptop's display when probed.

This closes ticket #2392.
http://www.lm-sensors.org/ticket/2392
2015-05-31 11:58:16 +00:00
Jean Delvare 332c6fe2b9 sensors-detect: Detect graphics card in all cases
On recent kernels, the i2c bus may not be an immediate child of the
graphics device, instead there can be a drm class device in between.
Treat all drm class devices as graphics devices so that probing the
i2c bus is disabled by default as intended.
2015-05-31 11:53:30 +00:00
Jean Delvare 15cafdf597 Don't probe address 0x37 for TMP435, this address is known to be
problematic.
2015-05-28 06:01:18 +00:00
Jean Delvare b200f794b3 libsensors: Fix sparse warnings
Sparse wants forward declarations of static functions to be static as
well. For sensors_eval_expr, do that. For the error callbacks,
rearrange the code so that the forward declarations are no longer
needed.
2015-05-15 11:24:28 +00:00
Jean Delvare 64629dc2f2 healthd.sh: Drop PATH manipulations
Altering PATH shouldn't be needed, everything that is required should
be already available.
2015-03-03 09:14:15 +00:00
Jean Delvare f86fd47838 healthd.sh: Revert to regular sleep
The read trick did not work when the daemon is started by systemd.
So we call sleep again, but we try to use the builtin flavor when
available.
2015-03-03 09:02:31 +00:00
Jean Delvare 1f5ef824c8 healthd.sh: Bump version 2015-02-28 10:15:00 +00:00
Jean Delvare 53d852c9b5 healthd.sh: Decrease the resource consumption by replacing the
external commands with the built-in bash commands. Contributed by
vbooh.
2015-02-28 09:11:05 +00:00
Jean Delvare f18f5531b2 Map the IT8786E to the it87 driver 2015-02-24 10:42:36 +00:00
Jean Delvare d992ea2039 Map the IT8781F to the it87 driver 2015-02-24 08:43:33 +00:00
Jean Delvare 5ef0b34a86 Add detection of Intel 5500/5520/X58 2015-01-26 09:27:46 +00:00
Jean Delvare 76c0970e3b Update the note about libsensors license. libsensors is released
under the LGPL now, thanks Guenter for pointing out the overlook.
2014-11-27 10:35:06 +00:00
Jean Delvare bf885a77c5 Add detection of Nuvoton NCT6792D 2014-11-17 08:21:25 +00:00
Jean Delvare af447db31a fancontrol: Fix shell error when FCFANS is not set
The bug was introduced when I added support for multiple fans
controlled by the same PWM output, in r6000. lm-sensors versions
affected: 3.3.2 to 3.3.5.

This fixes SUSE bug #903520:
https://bugzilla.suse.com/show_bug.cgi?id=903520
2014-11-05 07:28:35 +00:00
Jean Delvare 2b9a6ee146 Print the kernel version and the processor information, to make user
support easier.
2014-09-10 19:18:25 +00:00
Jean Delvare caa118e4a7 I2C address 0x2c is already probed for dozens of chips so there's no
reason to not probe it for SMSC EMC1072, EMC1073 and EMC1074.
2014-05-12 07:14:50 +00:00
Jean Delvare e0abfe8c5d Add libsensors.map to the list of dependencies for libsensors.so. 2014-05-09 05:53:10 +00:00
Jean Delvare da5b14dc0c sensors.conf.5: Enhance the hysteresis documentation
Mention all supported temperature hysteresis attributes. Recommend
setting each limit before its hysteresis.
2014-04-23 15:17:24 +00:00
Jean Delvare 69b3b10fa6 sensors: Add support for temp[1-*]_min_hyst and temp[1-*]_lcrit_hyst 2014-04-22 08:09:29 +00:00
Jean Delvare f09b1c6483 libsensors: Add support for temp[1-*]_min_hyst and temp[1-*]_lcrit_hyst
Add support for sysfs attributes temp[1-*]_min_hyst (already
implemented by drivers adt7x10, lm77 and lm92) and
temp[1-*]_lcrit_hyst (no known users yet.)
2014-04-22 08:05:14 +00:00
Jean Delvare eb5cf8b2ec Update my e-mail address and copyright years 2014-03-20 10:23:35 +00:00
Jean Delvare 5a159bc648 Add detection of ITE IT8623E 2014-03-18 09:42:22 +00:00
Jean Delvare 9a91bf414b Add detection of ITE IT8620E 2014-03-16 09:48:49 +00:00
Jean Delvare d70aec7eac Add detection of AMD family 16h Kabini and Mullins CPU sensors 2014-03-12 09:19:08 +00:00
Jean Delvare fce1cdf36e sensors.conf.default: Add support for NCT6779 and NCT6791 2014-02-21 08:07:42 +00:00
Jean Delvare c29be769f1 libsensors: Avoid insane memory allocations
While there is no longer a hard limit to the number of sensor of a
given type per chip, I feel a little uncomfortable having no limit at
all on the amount of memory we may try to allocate. Add an arbitrary
safety limit so that a design error or a bug in a hwmon driver can't
result into an insane memory allocation.
2014-01-30 12:45:23 +00:00
Jean Delvare b9361dc088 libsensors: Adjust memory pre-allocation steps
Make memory pre-allocation steps depend on the sensor type. Things like
voltages, temperatures or fans are typically plenty, however vid and
chassis intrusion are typically only a few, and there can only be one
beep_enable by design. This saves a small amount of temporary memory
for cheap.
2014-01-29 14:39:34 +00:00
Jean Delvare 0159202226 libsensors: Get rid of FEATURE_SIZE
max_subfeatures is computed the first time it is needed, we can do
exactly the same with FEATURE_SIZE. Introduce feature_size as a static
variable so that we don't have to recompute it again and again.
2014-01-29 14:11:12 +00:00
Jean Delvare 8b4299252b Bumb libsensors version, part 2 2014-01-29 09:28:08 +00:00
Jean Delvare ff7e16dafa Bump libsensors version 2014-01-29 09:27:23 +00:00
Jean Delvare 883f4e49a3 libsensors: Get rid of arbitrary limit on per-type sensor count
When gathering the attributes of each hwmon chip, libsensors uses a
temporary structure in memory to order and group all the attributes
into features. This temporary structure used to be a single array with
room for every possible attribute/subfeature. While simple, this
approach required to predefine a maximum number of per-type sensor
that could be handled.

In order to get rid of this arbitrary limit, which we hit and had to
raise three times already, I changed the temporary structure to an
array of dynamically allocated per-type subattribute arrays. This lets
us not allocate any memory for types which aren't implemented by a
given chip, and more importantly, this lets us reallocate room for
more attributes of a given type as needed.

I decided to allocate chunks of 8 attributes at a time, as this seemed
a good compromise between two frequent reallocations and
over-provisioning. It could be tweaked if needed.

Icing on the cake, I benchmarked this change on two different systems
and it results in performance gains. The total heap usage as reported
by valgrind is down by 50% on average, with peak memory consumption
(as reported by valgrind's massif) also down by 43% on average. The
total instructions count (as reported by valgrind's callgrind) is down
by 11% on average, with measured execution time also down by a few
percents. Valgrind rocks, BTW.

I have some ideas to optimize the memory allocations further, but I do
not expect such a huge gain from them. They may not even improve peak
memory consumption as massif shows the peak is somewhere else now at
least in some cases.
2014-01-29 09:25:31 +00:00
Jean Delvare 18853526ec libsensors: rename function sensors_compute_max
The new function name, sensors_compute_max_sf, better reflects what
the function is actually doing.
2014-01-28 21:47:41 +00:00
Jean Delvare 0c0e29f297 fancontrol: Deal with moving hwmon attributes
Several kernel drivers have already moved their attributes from the
hardware device to the hwmon class device, and others will follow.
Teach fancontrol about this possibility and let it adjust the attribute
paths transparently.
2014-01-28 21:40:55 +00:00
Jean Delvare 3b04ee5cba Post-release version update. 2014-01-22 08:27:30 +00:00
Jean Delvare f8cdcc35bf Prepare for release. 2014-01-22 08:11:15 +00:00
Jean Delvare db290fb999 Do not order services after syslog.target
With recent (>202) systemd release, syslog.target is no longer provided:
services are ensured they are started after logging socket is setup, so
journal will capture all syslog messages and will store them and forward
them to syslog implementation (if running).

Patch from Ville Skyttä.
2014-01-19 16:57:33 +00:00
Jean Delvare da18d98522 Spelling fixes from Ville Skyttä 2014-01-19 15:59:11 +00:00
Jean Delvare f5d3e6a256 Add another PCI ID for new family 15h AMD processors.
Patch from Phil Pokorny.
2014-01-14 21:51:58 +00:00
Jean Delvare 2252b49e2b libsensors: Increase MAX_SENSORS_PER_TYPE to 33
This is needed to properly support all temperatures reported by the
coretemp driver on recent hardware.
2014-01-14 14:49:04 +00:00
Jean Delvare 72b72f40fc Map the IT8603E to the it87 driver. 2013-11-22 12:43:52 +00:00
Jean Delvare cb00a51d89 Add detection of SMSC EMC2104. 2013-11-22 12:38:12 +00:00
Jean Delvare 3a10e75529 Add detection of Texas Instruments TMP451 2013-10-09 15:58:33 +00:00
Jean Delvare 19a38a226d sensors-conf-convert: Add a manual page
Contributed by Jaromir Capik.
2013-09-11 12:18:59 +00:00
Jean Delvare fbfbb9c9a8 sensors-detect: Fix use of uninitialized value 'vendor_id' on ppc64
Based on a report and an original patch from Jaromir Capik:

There's no vendor_id entry in the /proc/cpuinfo file in case of PPC64
systems and consequently the script returns 3 screens full of the
following errors:

Use of uninitialized value in string eq at /usr/sbin/sensors-detect
line 6444
Use of uninitialized value in string eq at /usr/sbin/sensors-detect
line 6459
Use of uninitialized value in string eq at /usr/sbin/sensors-detect
line 6473
2013-09-11 12:07:25 +00:00
Jean Delvare a3f215218f Extend the documentation of sensors_init() and
sensors_get_adapter_name(). Paul Crawford asked questions about these
as he found the original documentation unclear. I'm including my
answers to his questions here, reformatted, so that other developers
can benefit from them too.
2013-09-11 11:56:08 +00:00
Jean Delvare ec4160f771 sensors-detect: Rework option handling
Rework the way command line options are handled. If we ever need more
than this, we should consider moving to some GetOpt perl module.
2013-09-11 11:51:57 +00:00
Jean Delvare 5b6f3f26e0 sensors-detect: Detect incorrect non-interactive runs
It is better to use option --auto for non-interactive runs of the
sensors-detect script than faking an input to get the default answers
to all questions.
2013-09-11 11:46:48 +00:00
Jean Delvare feb19f45c6 sensors-detect: Introduce automatic mode
Add option --auto to sensors-detect, for non-interactive use. Default
answer is assumed to every question.
2013-09-11 11:22:37 +00:00
Jean Delvare 993f8cb621 Add PCI ID for new family 15h AMD processors. 2013-08-31 13:18:15 +00:00
Jean Delvare b67af39649 sensors-detect: Add detection of F71868A 2013-07-16 15:07:19 +00:00
Jean Delvare f8248e8c21 sensors-detect: Handle built-in modules properly
We now have everything we need to handle built-in modules properly, so
do it. It should work fine since kernel 2.6.33.
2013-06-10 13:03:44 +00:00
Jean Delvare 256811bc9e sensors-detect: Use modules.builtin instead of /sys/module
/sys/module doesn't actually contain all built-in modules, only the
ones which have a version or at least one parameter. Better use file
modules.builtin which is generated since kernel 2.6.33, it is complete
and this will let us handle built-in modules properly.
2013-06-10 13:02:47 +00:00
Jean Delvare 2dec06a2a9 Fix EnvironmentFile in service files
* EnvironmentFile is mandatory for sensord.
* fancontrol needs no EnvironmentFile.
2013-06-03 12:36:47 +00:00
Jean Delvare a276f56993 sensors-detect: Report built-in drivers as such 2013-05-28 11:51:36 +00:00
Jean Delvare 91fa8d0694 Reorder post-release items in the order I actually do them. 2013-05-28 08:36:56 +00:00
Jean Delvare 7fbd617dbf Post-release version update. 2013-05-27 13:08:02 +00:00
Jean Delvare c70bea4f9c Prepare for release. 2013-05-27 10:33:26 +00:00
Jean Delvare a133842b93 Add missing dependency. 2013-05-24 13:28:38 +00:00
Jean Delvare 98f280797c Add sensord service file for systemd
Original file contributed by Nikola Pajkovsky.
2013-05-24 10:53:19 +00:00
Jean Delvare 1e3fb43118 Add fancontrol service file for systemd 2013-05-24 10:39:23 +00:00
Jean Delvare 62ed6f484b Fix handling of absolute paths in config
Reported by Marc Ferland. Make DEVPATH and DEVNAME mandatory only when
using relative paths. Optionally support DEVNAME check when using
absolute paths.
2013-05-23 14:09:22 +00:00
Jean Delvare 8f4461622c Drop unreliable DS1621/DS1631 detection
Detection of the Dallas/Maxim DS1621, DS1625 and DS1631 chips is weak
and likely to result in false positive. There's no rationale for
keeping it in sensors-detect as these chips are not found in desktop
computer systems. So drop detection of these chips altogether.
2013-05-20 19:25:22 +00:00
Jean Delvare 74252b1dd3 Move SMBus company ID list to a better place. 2013-05-01 11:48:38 +00:00
Jean Delvare c28d953cd8 Drop all outdated or redundant information from document chips/SUMMARY. 2013-05-01 11:46:36 +00:00
Jean Delvare da22a37aec Delete outdated document chips/MODPARMS. 2013-05-01 11:40:43 +00:00
Jean Delvare 7e2b5c3376 pwm: Declare local variables as such 2013-05-01 11:37:47 +00:00
Jean Delvare e46e4e519f pwmconfig: Properly deal with multiple fan control
When a given PWM output controls more than one fan,
fanactive_min is no longer a space-separated list of numbers, it will
also include items of the form "A+B". The tests in the rest of the
code do not expect that and choke with errors like:

/usr/sbin/pwmconfig: line 926: [: 538+799: integer expression expected
/usr/sbin/pwmconfig: line 952: [: 538+799: integer expression expected

As the only thing we really care about is whether any fan stops
completely when PWM is 0, we can simply record the minimum of the
lowest speed of all affected fans.
2013-05-01 10:31:00 +00:00
Jean Delvare f2b3e95c59 pwmconfig: Drop a stray comment
fancontrol supports multiple controlled fans for quite some time now.
2013-05-01 10:30:22 +00:00
Jean Delvare 58ec80bf54 pwmconfig: Raise the detection threshold to 3/4
Detection threshold of 2/3 of the maximum speed is too low, some fans
will slow down to about that speed so controlled fans may be missed.
Use 3/4 as the threshold to avoid these false negatives.
2013-05-01 10:29:57 +00:00
Jean Delvare 2096d14c18 pwmconfig: Print the initial PWM values
Print the initial PWM values before letting the user change them. This
should be useful to better understand what happens next, and for user
support in general.
2013-05-01 10:29:00 +00:00
Jean Delvare d5ffa33d39 Update the dead items that went to trash. 2013-03-14 08:58:47 +00:00
Jean Delvare ad51e05f16 We have a driver for the ADT7410 since kernel 3.7.
ADT7420 is register compatible with the ADT7410.
2013-02-28 09:18:34 +00:00
Jean Delvare 1b77fd669b Avoid unwanted sensors-detect termination when /dev/port is missing
Patch from Jaromir Capik.

The device file /dev/port might be missing in some cases
and the sensors detection is terminated when the user
tries to detect sensors dependent on it's existence.
That's not correct -> it's not a reason for terminating
the detection.
2013-01-23 09:33:59 +00:00
Jean Delvare 6734fae250 The new sysconfig configuration file syntax is in place since December
2009, I think we can safely remove the old one, nobody should be using
it any longer.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6115 7894878c-1315-0410-8ee3-d5d059ff63e0
2013-01-16 18:11:30 +00:00
Jean Delvare 319f9b8f68 If a driver is built into the kernel, it doesn't show up in
/proc/modules so we will try to load it, even though it's already
available. It will succeed, however later attempts to remove the
driver will fail and such failures are reported at the end of the
script, which can be confusing.

So, use /sys/module instead of /proc/modules where available, as
built-in drivers are listed there too so we no longer attempt to load
already available drivers. As a consequence we also no longer attempt
to remove the drivers in question, thus clearing the error message.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6114 7894878c-1315-0410-8ee3-d5d059ff63e0
2013-01-16 17:33:38 +00:00
Jean Delvare 1971bc6ff1 Map IT8771E, IT8772E, IT8782F and IT8783F to it87.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6113 7894878c-1315-0410-8ee3-d5d059ff63e0
2013-01-16 14:26:48 +00:00
Jean Delvare 9c91c2897e Add detection of AMD family 16h power sensors. Patch from Boris
Ostrovsky.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6112 7894878c-1315-0410-8ee3-d5d059ff63e0
2013-01-12 14:35:31 +00:00
Jean Delvare 8714492f6b Add detection of Winbond W83627SF/GF (no sensors.)
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6111 7894878c-1315-0410-8ee3-d5d059ff63e0
2013-01-11 20:52:59 +00:00
Jean Delvare 122780fc96 sensors.conf.5: Mention "sensors -u" to get the raw feature names.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6091 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-11-12 09:48:37 +00:00
Jean Delvare f915436019 sensors: Clarify what option -u is good for.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6090 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-11-12 09:35:59 +00:00
Jean Delvare c6c1c5d67c Post-release version update.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6089 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-11-06 20:32:29 +00:00
Jean Delvare f8e6c7fd6e Prepare for release.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6087 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-11-06 20:10:47 +00:00
Jean Delvare 717e87b4d2 Fix % in format.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6086 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-11-06 19:44:01 +00:00
Jean Delvare d1d5799d51 sensors-detect: Fix parent class discovery when multiplexer is present
Take multiplexers into account when looking up the parent device of
each I2C adapter. We don't bother with old kernels as they didn't have
support for multiplexers anyway.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6085 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-10-30 17:18:45 +00:00
Jean Delvare e817653329 sensors-detect: Do not scan I2C adapters on graphics cards by default.
Don't probe I2C buses on graphics cards by default. Their drivers will
typically instantiate the I2C slave devices themselves as needed, and
such probes have been occasionally reported to cause serious trouble.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6084 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-10-30 17:11:37 +00:00
Jean Delvare 6a2798ccc0 sensors/man - missing long switches
Patch from Jaromir Capik.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6076 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-10-22 11:51:27 +00:00
Jean Delvare f0af8775a1 Update fan-divisors: fan divisors are optional, recent monitoring chips
don't have them so the document doesn't apply to these chips.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6071 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-09-14 11:35:43 +00:00
Jean Delvare 6ee8f6096d Merge 4 regular expressions into a single one, this is faster.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6046 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-04-19 13:21:00 +00:00
Jean Delvare 08d713c412 libsensors: Fix warning about library path not in /etc/ld.so.conf
On recent systems, extra configuration files can live in
/etc/ld.so.conf.d, so check this directory too, before warning.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6045 7894878c-1315-0410-8ee3-d5d059ff63e0
2012-04-19 13:18:45 +00:00