- lm_sensors-r6163-pwmconfig-raise-threshold.diff: pwmconfig: Raise

the detection threshold to 3/4 (bnc#810344).
- lm_sensors-r6164-pwmconfig-drop-comment.diff: pwmconfig: Drop a
  stray comment.
- lm_sensors-r6165-pwmconfig-multiple-fans.diff:  pwmconfig:
  Properly deal with multiple fan control (bnc#810344).
- lm_sensors-r6172-fancontrol-absolute-paths.diff: fancontrol: Fix
  handling of absolute paths in config (bnc#810344).

- fancontrol.service: Cleanups.
- Add fancontrol.service (bnc#810344).

OBS-URL: https://build.opensuse.org/package/show/Base:System/sensors?expand=0&rev=61
This commit is contained in:
Jean Delvare 2013-05-23 16:49:01 +00:00 committed by Git OBS Bridge
parent 0709fdf52c
commit 54ca40543a
7 changed files with 163 additions and 4 deletions

View File

@ -1,13 +1,10 @@
[Unit]
Description=Start fan control, if configured
ConditionFileNotEmpty=/etc/fancontrol
After=lm_sensors.service
After=syslog.target
[Service]
Type=simple
Restart=always
PIDFile=/var/run/fancontrol.pid
EnvironmentFile=/etc/sysconfig/lm_sensors
ExecStart=/usr/sbin/fancontrol

View File

@ -0,0 +1,22 @@
Subject: pwmconfig: Raise the detection threshold to 3/4
Upstream: yes, r6163
References: bnc#810344
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.
---
prog/pwm/pwmconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/prog/pwm/pwmconfig
+++ b/prog/pwm/pwmconfig
@@ -448,7 +448,7 @@ do
OS=`echo $SPEEDS | cut -d' ' -f$count`
S=`echo $CURRENT_SPEEDS | cut -d' ' -f$count`
echo " $j ... speed was $OS now $S"
- let threshold=2*$OS/3
+ let threshold=3*$OS/4
if [ $S -lt $threshold ]
then
echo " It appears that fan $j"

View File

@ -0,0 +1,19 @@
Subject: pwmconfig: Drop a stray comment
Upstream: yes, r6164
fancontrol supports multiple controlled fans for quite some time now.
---
prog/pwm/pwmconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/prog/pwm/pwmconfig
+++ b/prog/pwm/pwmconfig
@@ -471,7 +471,7 @@ do
exit 1
fi
else
- fanactive="$j+${fanactive}" #not supported yet by fancontrol
+ fanactive="$j+${fanactive}"
fanactive_min="$S+${fanactive_min}"
fi
S=`cat $j`

View File

@ -0,0 +1,65 @@
Subject: pwmconfig: Properly deal with multiple fan control
Upstream: yes, r6165
References: bnc#810344
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.
---
prog/pwm/pwmconfig | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
--- a/prog/pwm/pwmconfig
+++ b/prog/pwm/pwmconfig
@@ -443,6 +443,7 @@ do
let pwmactivecount=0
let count=1
+ S_MIN=
for j in $GOODFAN
do
OS=`echo $SPEEDS | cut -d' ' -f$count`
@@ -461,7 +462,6 @@ do
let pwmactivecount=1
pwmactive="$i ${pwmactive}"
fanactive="$j ${fanactive}"
- fanactive_min="$S ${fanactive_min}"
# Give all correlated fans time to return to full speed
sleep $DELAY
@@ -472,8 +472,14 @@ do
fi
else
fanactive="$j+${fanactive}"
- fanactive_min="$S+${fanactive_min}"
fi
+
+ # Keep track of the slowest fan controlled by one PWM
+ if [ -z "$S_MIN" ] || [ $S -lt $S_MIN ]
+ then
+ S_MIN=$S
+ fi
+
S=`cat $j`
if [ $S -lt $threshold ]
then
@@ -506,8 +512,11 @@ do
if [ "$X" = "y" -o "$X" = "Y" ]
then
pwmactive="$i ${pwmactive}"
+ fanactive_min="0 $fanactive_min"
fi
echo
+ else
+ fanactive_min="$S_MIN $fanactive_min"
fi
done

View File

@ -0,0 +1,31 @@
Subject: fancontrol: Fix handling of absolute paths in config
Upstream: yes, r6172
References: bnc#810344
Reported by Marc Ferland. Make DEVPATH and DEVNAME mandatory only when
using relative paths. Optionally support DEVNAME check when using
absolute paths.
---
prog/pwm/fancontrol | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/prog/pwm/fancontrol
+++ b/prog/pwm/fancontrol
@@ -289,11 +289,16 @@ fi
cd $DIR
# Check for configuration change
-if [ -z "$DEVPATH" -o -z "$DEVNAME" ]
+if [ "$DIR" != "/" ] && [ -z "$DEVPATH" -o -z "$DEVNAME" ]
then
echo "Configuration is too old, please run pwmconfig again" >&2
exit 1
fi
+if [ "$DIR" = "/" -a -n "$DEVPATH" ]
+then
+ echo "Unneeded DEVPATH with absolute device paths" >&2
+ exit 1
+fi
if ! ValidateDevices "$DEVPATH" "$DEVNAME"
then
echo "Configuration appears to be outdated, please run pwmconfig again" >&2

View File

@ -1,7 +1,24 @@
-------------------------------------------------------------------
Thu May 23 18:30:31 CEST 2013 - jdelvare@suse.de
- lm_sensors-r6163-pwmconfig-raise-threshold.diff: pwmconfig: Raise
the detection threshold to 3/4 (bnc#810344).
- lm_sensors-r6164-pwmconfig-drop-comment.diff: pwmconfig: Drop a
stray comment.
- lm_sensors-r6165-pwmconfig-multiple-fans.diff: pwmconfig:
Properly deal with multiple fan control (bnc#810344).
- lm_sensors-r6172-fancontrol-absolute-paths.diff: fancontrol: Fix
handling of absolute paths in config (bnc#810344).
-------------------------------------------------------------------
Thu May 23 18:06:50 CEST 2013 - jdelvare@suse.de
- fancontrol.service: Cleanups.
-------------------------------------------------------------------
Sat May 18 11:58:47 UTC 2013 - werner@suse.com
- Add fancontrol.service
- Add fancontrol.service (bnc#810344).
-------------------------------------------------------------------
Fri Apr 5 12:06:46 UTC 2013 - idonmez@suse.com

View File

@ -40,6 +40,10 @@ Patch6: lm_sensors-r6112-detection-AMD-family-16h.diff
Patch7: lm_sensors-r6113-ITE-IT877x-IT878x-driver.diff
Patch8: lm_sensors-r6117-detection-ITE-IT8752F.diff
Patch9: lm_sensors-r6123-AnalogDev-ADT7410-driver.diff
Patch10: lm_sensors-r6163-pwmconfig-raise-threshold.diff
Patch11: lm_sensors-r6164-pwmconfig-drop-comment.diff
Patch12: lm_sensors-r6165-pwmconfig-multiple-fans.diff
Patch13: lm_sensors-r6172-fancontrol-absolute-paths.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExcludeArch: s390 s390x
@ -147,6 +151,10 @@ Authors:
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%build
RPM_OPT_FLAGS="$RPM_OPT_FLAGS"