Bug ID 1181890
Summary Sensors: /usr/sbin/pwmconfig reaches line 456 with $OS being unset
Classification openSUSE
Product openSUSE Tumbleweed
Version Current
Hardware Other
OS Linux
Status NEW
Severity Normal
Priority P5 - None
Component Other
Assignee screening-team-bugs@suse.de
Reporter 7eggert@gmx.de
QA Contact qa-bugs@suse.de
Found By ---
Blocker ---

In the script /usr/sbin/pwmconfig, these lines are reached with $OS being unset
or "", causing "3*/4" to be evaluated.

                echo "  $j ... speed was $OS now $S"
                let threshold=3*$OS/4

Dump the log from my system here and everything I remember to generate:

--->8---

root@mysystem# /usr/sbin/pwmconfig
# pwmconfig version 3.6.0
This program will search your sensors for pulse width modulation (pwm)
controls, and test each one to see if it controls a fan on
your motherboard. Note that many motherboards do not have pwm
circuitry installed, even if your sensor chip supports pwm.

We will attempt to briefly stop each fan using the pwm controls.
The program will attempt to restore each fan to full speed
after testing. However, it is ** very important ** that you
physically verify that the fans have been to full speed
after the program has completed.

Found the following devices:
   hwmon0 is dell_smm
   hwmon1 is coretemp
   hwmon2 is amdgpu

Found the following PWM controls:
   hwmon0/pwm1           current value: 255
   hwmon0/pwm2           current value: 255
   hwmon2/pwm1           current value: 22

Giving the fans some time to reach full speed...
Found the following fan sensors:
   hwmon0/fan1_input     current speed: 3432 RPM
   hwmon0/fan2_input     current speed: 2202 RPM
cat: hwmon2/fan1_input: Invalid argument
   hwmon2/fan1_input     current speed:  RPM

Warning!!! This program will stop your fans, one at a time,
for approximately 5 seconds each!!!
This may cause your processor temperature to rise!!!
If you do not want to do this hit control-C now!!!
Hit return to continue: 

Testing pwm control hwmon0/pwm1 ...
cat: hwmon2/fan1_input: Invalid argument
  hwmon0/fan1_input ... speed was 3432 now 1492
    It appears that fan hwmon0/fan1_input
    is controlled by pwm hwmon0/pwm1
Would you like to generate a detailed correlation (y)? 
Note: If you had gnuplot installed, I could generate a graphical plot.
    PWM 255 FAN 3579
    PWM 240 FAN 3597
    PWM 225 FAN 3597
    PWM 210 FAN 3614
    PWM 195 FAN 3614
    PWM 180 FAN 2332
    PWM 165 FAN 1489
    PWM 150 FAN 1495
    PWM 135 FAN 1486
    PWM 120 FAN 1498
    PWM 105 FAN 1501
    PWM 90 FAN 1504
    PWM 75 FAN 1498
    PWM 60 FAN 1489
    PWM 45 FAN 1495
    PWM 30 FAN 1492
    PWM 28 FAN 1486
    PWM 26 FAN 1486
    PWM 24 FAN 1489
    PWM 22 FAN 1489
    PWM 20 FAN 1489
    PWM 18 FAN 1489
    PWM 16 FAN 1489
    PWM 14 FAN 1486
    PWM 12 FAN 1492
    PWM 10 FAN 1495
    PWM 8 FAN 1489
    PWM 6 FAN 1492
    PWM 4 FAN 1489
    PWM 2 FAN 1489
    PWM 0 FAN 1498

  hwmon0/fan2_input ... speed was 2202 now 2209
    no correlation
  hwmon2/fan1_input ... speed was  now 
/usr/sbin/pwmconfig: line 455: let: threshold=3*/4: syntax error: operand
expected (error token is "/4")
/usr/sbin/pwmconfig: line 456: [: -lt: unary operator expected
    no correlation

Testing pwm control hwmon0/pwm2 ...
cat: hwmon2/fan1_input: Invalid argument
  hwmon0/fan1_input ... speed was 3432 now 3546
    no correlation
  hwmon0/fan2_input ... speed was 2202 now 2242
    no correlation
  hwmon2/fan1_input ... speed was  now 
/usr/sbin/pwmconfig: line 455: let: threshold=3*/4: syntax error: operand
expected (error token is "/4")
/usr/sbin/pwmconfig: line 456: [: -lt: unary operator expected
    no correlation

No correlations were detected.
There is either no fan connected to the output of hwmon0/pwm2,
or the connected fan has no rpm-signal connected to one of
the tested fan sensors. (Note: not all motherboards have
the pwm outputs connected to the fan connectors,
check out the hardware database on http://www.almico.com/forumindex.php)

Did you see/hear a fan stopping during the above test (n)? y

Testing pwm control hwmon2/pwm1 ...
cat: hwmon2/fan1_input: Invalid argument
  hwmon0/fan1_input ... speed was 3432 now 3614
    no correlation
  hwmon0/fan2_input ... speed was 2202 now 2202
    no correlation
  hwmon2/fan1_input ... speed was  now 
/usr/sbin/pwmconfig: line 455: let: threshold=3*/4: syntax error: operand
expected (error token is "/4")
/usr/sbin/pwmconfig: line 456: [: -lt: unary operator expected
    no correlation

No correlations were detected.
There is either no fan connected to the output of hwmon2/pwm1,
or the connected fan has no rpm-signal connected to one of
the tested fan sensors. (Note: not all motherboards have
the pwm outputs connected to the fan connectors,
check out the hardware database on http://www.almico.com/forumindex.php)

Did you see/hear a fan stopping during the above test (n)? 

Testing is complete.
Please verify that all fans have returned to their normal speed.

The fancontrol script can automatically respond to temperature changes
of your system by changing fanspeeds.
Do you want to set up its configuration file now (y)? 
What should be the path to your fancontrol config file (/etc/fancontrol)? 

Select fan output to configure, or other action:
1) hwmon0/pwm2
2) hwmon0/pwm1
3) Change INTERVAL
4) Just quit
5) Save and quit
6) Show configuration
select (1-n): 2

Devices:
hwmon0 is dell_smm
hwmon1 is coretemp
hwmon2 is amdgpu

Current temperature readings are as follows:
hwmon1/temp2_input      36
hwmon1/temp3_input      36
hwmon1/temp4_input      34
hwmon1/temp5_input      37
hwmon2/temp1_input      42

Select a temperature sensor as source for hwmon0/pwm1:
1) hwmon1/temp2_input                    3) hwmon1/temp4_input                 
  5) hwmon2/temp1_input
2) hwmon1/temp3_input                    4) hwmon1/temp5_input                 
  6) None (Do not affect this PWM output)
select (1-n): 5

Enter the low temperature (degree C)
below which the fan should spin at minimum speed (20): 30

Enter the high temperature (degree C)
over which the fan should spin at maximum speed (60): 46

Enter the PWM value (0-255) to use when the temperature
is over the high temperature limit (255): 


Select fan output to configure, or other action:
1) hwmon0/pwm2
2) hwmon0/pwm1
3) Change INTERVAL
4) Just quit
5) Save and quit
6) Show configuration
select (1-n): 5

Saving configuration to /etc/fancontrol...
Configuration saved

--->8---

# lspci
00:00.0 Host bridge: Intel Corporation Core Processor DMI (rev 11)
00:03.0 PCI bridge: Intel Corporation Core Processor PCI Express Root Port 1
(rev 11)
00:08.0 System peripheral: Intel Corporation Core Processor System Management
Registers (rev 11)
00:08.1 System peripheral: Intel Corporation Core Processor Semaphore and
Scratchpad Registers (rev 11)
00:08.2 System peripheral: Intel Corporation Core Processor System Control and
Status Registers (rev 11)
00:08.3 System peripheral: Intel Corporation Core Processor Miscellaneous
Registers (rev 11)
00:10.0 System peripheral: Intel Corporation Core Processor QPI Link (rev 11)
00:10.1 System peripheral: Intel Corporation Core Processor QPI Routing and
Protocol Registers (rev 11)
00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series
Chipset HECI Controller (rev 06)
00:1a.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2
Enhanced Host Controller (rev 06)
00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High
Definition Audio (rev 06)
00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express
Root Port 1 (rev 06)
00:1d.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2
Enhanced Host Controller (rev 06)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev a6)
00:1f.0 ISA bridge: Intel Corporation H57 Chipset LPC Interface Controller (rev
06)
00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 6 port
SATA AHCI Controller (rev 06)
00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller
(rev 06)
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI]
Tahiti XT [Radeon HD 7970/8970 OEM / R9 280X]
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti HDMI Audio
[Radeon HD 7870 XT / 7950/7970]
02:00.0 Ethernet controller: Broadcom Inc. and subsidiaries NetLink BCM57780
Gigabit Ethernet PCIe (rev 01)
03:01.0 SCSI storage controller: Adaptec AHA-2930CU (rev 03)
ff:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture
Generic Non-Core Registers (rev 04)
ff:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture
System Address Decoder (rev 04)
ff:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 04)
ff:02.1 Host bridge: Intel Corporation Core Processor QPI Physical 0 (rev 04)
ff:03.0 Host bridge: Intel Corporation Core Processor Integrated Memory
Controller (rev 04)
ff:03.1 Host bridge: Intel Corporation Core Processor Integrated Memory
Controller Target Address Decoder (rev 04)
ff:03.4 Host bridge: Intel Corporation Core Processor Integrated Memory
Controller Test Registers (rev 04)
ff:04.0 Host bridge: Intel Corporation Core Processor Integrated Memory
Controller Channel 0 Control Registers (rev 04)
ff:04.1 Host bridge: Intel Corporation Core Processor Integrated Memory
Controller Channel 0 Address Registers (rev 04)
ff:04.2 Host bridge: Intel Corporation Core Processor Integrated Memory
Controller Channel 0 Rank Registers (rev 04)
ff:04.3 Host bridge: Intel Corporation Core Processor Integrated Memory
Controller Channel 0 Thermal Control Registers (rev 04)
ff:05.0 Host bridge: Intel Corporation Core Processor Integrated Memory
Controller Channel 1 Control Registers (rev 04)
ff:05.1 Host bridge: Intel Corporation Core Processor Integrated Memory
Controller Channel 1 Address Registers (rev 04)
ff:05.2 Host bridge: Intel Corporation Core Processor Integrated Memory
Controller Channel 1 Rank Registers (rev 04)
ff:05.3 Host bridge: Intel Corporation Core Processor Integrated Memory
Controller Channel 1 Thermal Control Registers (rev 04)

--->8---

# /usr/bin/sensors
amdgpu-pci-0100
Adapter: PCI adapter
fan1:             N/A
edge:         +41.0������C  (crit = +120.0������C, hyst = +90.0������C)

dell_smm-virtual-0
Adapter: Virtual device
Processor Fan:   1498 RPM
Motherboard Fan: 2248 RPM

coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +38.0������C  (high = +83.0������C, crit = +99.0������C)
Core 1:       +39.0������C  (high = +83.0������C, crit = +99.0������C)
Core 2:       +36.0������C  (high = +83.0������C, crit = +99.0������C)
Core 3:       +40.0������C  (high = +83.0������C, crit = +99.0������C)

--->8---

# /usr/sbin/sensors-detect
# sensors-detect version 3.6.0
# System: Dell Inc. Precision T1500 [00]
# Board: Dell Inc. 0XC7MM
# Kernel: 5.10.9-1-default x86_64
# Processor: Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz (6/30/5)

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.

Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): 
Module cpuid loaded successfully.
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD Family 10h thermal sensors...                           No
AMD Family 11h thermal sensors...                           No
AMD Family 12h and 14h thermal sensors...                   No
AMD Family 15h thermal sensors...                           No
AMD Family 16h thermal sensors...                           No
AMD Family 17h thermal sensors...                           No
AMD Family 15h power sensors...                             No
AMD Family 16h power sensors...                             No
Hygon Family 18h thermal sensors...                         No
Intel digital thermal sensor...                             Success!
    (driver `coretemp')
Intel AMB FB-DIMM thermal sensor...                         No
Intel 5500/5520/X58 thermal sensor...                       No
VIA C7 thermal sensor...                                    No
VIA Nano thermal sensor...                                  No

Some Super I/O chips contain embedded 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): 
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor/ITE'...               No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Nuvoton/Fintek'...               No
Trying family `ITE'...                                      No
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor/ITE'...               No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Nuvoton/Fintek'...               Yes
Found `Fintek F71882FG/F71883FG Super IO Sensors'           Success!
    (address 0xa00, driver `f71882fg')

Some systems (mainly servers) implement IPMI, a set of common interfaces
through which system health data may be retrieved, amongst other things.
We first try to get the information from SMBIOS. If we don't find it
there, we have to read from arbitrary I/O ports to probe for such
interfaces. This is normally safe. Do you want to scan for IPMI
interfaces? (YES/no): 
Probing for `IPMI BMC KCS' at 0xca0...                      No
Probing for `IPMI BMC SMIC' at 0xca8...                     No

Some hardware monitoring chips are 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): 

Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no): 
Using driver `i2c-i801' for device 0000:00:1f.3: Intel 3400/5 Series (PCH)
Module i2c-dev loaded successfully.

Next adapter: SMBus I801 adapter at 0400 (i2c-0)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: AMDGPU i2c bit bus 0x90 (i2c-1)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: AMDGPU i2c bit bus 0x91 (i2c-2)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: AMDGPU i2c bit bus 0x92 (i2c-3)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: AMDGPU i2c bit bus 0x93 (i2c-4)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: AMDGPU i2c bit bus 0x94 (i2c-5)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: AMDGPU i2c bit bus 0x95 (i2c-6)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: AMDGPU i2c bit bus 0x96 (i2c-7)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: AMDGPU i2c bit bus 0x97 (i2c-8)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: card0-DP-1 (i2c-9)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: card0-DP-2 (i2c-10)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: card0-DP-3 (i2c-11)
Do you want to scan it? (yes/NO/selectively): 


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

Driver `coretemp':
  * Chip `Intel digital thermal sensor' (confidence: 9)

Driver `f71882fg':
  * ISA bus, address 0xa00
    Chip `Fintek F71882FG/F71883FG Super IO Sensors' (confidence: 9)

Do you want to generate /etc/sysconfig/lm_sensors? (YES/no): 
Created symlink /etc/systemd/system/multi-user.target.wants/lm_sensors.service
��������� /usr/lib/systemd/system/lm_sensors.service.
Unloading i2c-dev... OK
Unloading cpuid... OK

--->8---

# uname -a
Linux be10 5.10.9-1-default #1 SMP Wed Jan 20 07:26:11 UTC 2021 (b7732a5)
x86_64 x86_64 x86_64 GNU/Linux


You are receiving this mail because: