Accepting request 872259 from Base:System

- pwmconfig-handle-fan-input-error.patch: pwmconfig: Deal
  gracefully with unreadable fan inputs (boo#1181890).
- pwmconfig-raise-fan-threshold.patch: pwmconfig: Further raise the
  fan threshold (boo#1181890).

OBS-URL: https://build.opensuse.org/request/show/872259
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/sensors?expand=0&rev=105
This commit is contained in:
Dominique Leuenberger 2021-02-18 19:38:37 +00:00 committed by Git OBS Bridge
commit 672a6bfb7e
4 changed files with 71 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From: Jean Delvare <jdelvare@suse.de>
Subject: pwmconfig: Deal gracefully with unreadable fan inputs
References: boo#1181890
Upstream: not yet, submitted 2021-02-11 but upstream is dead
If a hwmon driver exposes an unreadable fan input, let the user know
and skip that input. Otherwise we hit syntax errors later on.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
prog/pwm/pwmconfig | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- lm-sensors.orig/prog/pwm/pwmconfig 2020-05-07 14:29:34.731733274 +0200
+++ lm-sensors/prog/pwm/pwmconfig 2021-02-11 11:31:40.636126815 +0100
@@ -283,8 +283,11 @@ sleep $DELAY
echo 'Found the following fan sensors:'
for i in $FAN
do
- S=$(cat $i)
- if [ "$S" = "0" -o "$S" = "-1" ]
+ S=$(cat $i 2> /dev/null)
+ if [ $? -ne 0 ]
+ then
+ echo " $i current speed: can't read ... skipping!"
+ elif [ "$S" = "0" -o "$S" = "-1" ]
then
echo " $i current speed: 0 ... skipping!"
else

View File

@ -0,0 +1,27 @@
From: Jean Delvare <jdelvare@suse.de>
Subject: pwmconfig: Further raise the fan threshold
References: boo#1181890
Upstream: not yet, submitted 2021-02-11 but upstream is dead
Modern 4-pin fans can have a minimum speed (PWM=0) which is still
relatively high. I've seen 4500 RPM fans lower their speed to only
3500 RPM, which is 77% of the maximum speed, above our current
detection threshold (3/4 or 75%). Increase the threshold to 5/6
(roughly 83%) to make sure such fans are handled properly.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
prog/pwm/pwmconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- lm-sensors.orig/prog/pwm/pwmconfig 2021-02-11 11:31:40.636126815 +0100
+++ lm-sensors/prog/pwm/pwmconfig 2021-02-11 15:30:12.831007617 +0100
@@ -455,7 +455,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=3*$OS/4
+ let threshold=5*$OS/6
if [ $S -lt $threshold ]
then
echo " It appears that fan $j"

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Thu Feb 11 14:41:45 UTC 2021 - Jean Delvare <jdelvare@suse.com>
- pwmconfig-handle-fan-input-error.patch: pwmconfig: Deal
gracefully with unreadable fan inputs (boo#1181890).
- pwmconfig-raise-fan-threshold.patch: pwmconfig: Further raise the
fan threshold (boo#1181890).
-------------------------------------------------------------------
Tue May 12 09:12:56 UTC 2020 - Jean Delvare <jdelvare@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package sensors
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -45,6 +45,10 @@ Patch7: lm_sensors-3.4.0-sensors-detect-add-ftsteutates-support.patch
Patch8: lm_sensors-3.5.0-libsensors-fix-soname.patch
#PATCH-FEATURE-UPSTREAM add ftsteutates support
Patch9: lm_sensors-3.6.0-sensors-detect-fix-driver-for-w83677hgi.patch
#PATCH-FIX-UPSTREAM Deal gracefully with unreadable fan inputs
Patch10: pwmconfig-handle-fan-input-error.patch
#PATCH-FIX-UPSTREAM Further raise the fan threshold
Patch11: pwmconfig-raise-fan-threshold.patch
BuildRequires: bison
BuildRequires: flex
BuildRequires: rrdtool-devel
@ -114,6 +118,8 @@ sense to the user.
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%build
RPM_OPT_FLAGS="%{optflags}"