Help with sensors3.conf

A recent kernel update (to 6.11.0) brought with the awareness of sensor jc42, which monitors the temperature of DIMMs. I discovered it by the following entry in the system journal:

2024-10-01T10:34:40-07:00 sma-station14l sensord[148139]: Sensor alarm: Chip jc42-i2c-6-1b: DIMM Temp: 40.2 C (min = 0.0 C, max = 0.0 C) [ALARM]

The min and max values are not appropriate values. I created a conf file for jc42, jc42.conf, since none was standard in sensors3.conf and added it to /etc/sensors.d/. Contents:

#  Chip: jc42-i2c-6-1b
#  Adapter: SMBus PIIX4 adapter port 0 at 0b00
#
chip "jc42-*"
    label "temp1" "DIMM Temp"

    set temp1_min      00
    set temp1_max      60
    set temp1_max_hyst 56
#

The only entry that had an effect is “label.” The set commands do nothing.

Am I missing something?

$ sensors
...
jc42-i2c-6-1b
Adapter: SMBus PIIX4 adapter port 0 at 0b00
DIMM Temp:    +40.2°C  (low  =  +0.0°C)                  ALARM (HIGH, CRIT)
                       (high =  +0.0°C, hyst =  +0.0°C)
                       (crit =  +0.0°C, hyst =  +0.0°C)
...

See also THe sudden appearance of "jc42"; sensord is clueless

Based on this document:

https://www.kernel.org/doc/Documentation/hwmon/jc42

You can set min/max just using sysfs parameters.

How do I do that?

I did find this:

/sys/devices/pci0000\:00/0000\:00\:14.0/i2c-6/6-001b/hwmon/hwmon3/

which contains:

-rw-r--r-- 1 root root 4.0K Oct  1 10:50 temp1_crit
-r--r--r-- 1 root root 4.0K Oct  1 10:50 temp1_crit_alarm
-rw-r--r-- 1 root root 4.0K Oct  1 10:50 temp1_crit_hyst
-r--r--r-- 1 root root 4.0K Oct  1 09:00 temp1_input
-rw-r--r-- 1 root root 4.0K Oct  1 09:00 temp1_max
-r--r--r-- 1 root root 4.0K Oct  1 09:00 temp1_max_alarm
-r--r--r-- 1 root root 4.0K Oct  1 10:50 temp1_max_hyst
-rw-r--r-- 1 root root 4.0K Oct  1 09:00 temp1_min
-r--r--r-- 1 root root 4.0K Oct  1 10:50 temp1_min_alarm

It seems unlikely, though, that I should edit these files directly.

sysfs parameters are not permanent, after a reboot they are gone so I would just give it a try (as root)

On how to set these parameters “normally”

Module parameters are like kernel parameters, but they specify a particular component of the kernel, usually a specific driver. Despite the name, these parameters apply whether the corresponding driver is compiled directly in the kernel or as a module. When the component is included in the main kernel image, you need to pass COMPONENT_NAME.PARAMETER_NAME=VALUE on the kernel command line. When the component is loaded as a module, you need to pass PARAMETER_NAME=VALUE to insmod.

From Change kernel parameters at runtime

No luck there. I modified the temp1_max file, setting it to 40; it was immediately reverted to 0.

I read “Change kernel parameters at runtime.” Oof. Browsing source files and system settings yielded very little for modifying jc42 values. I suspect naming conventions have changed in the 10 years since that was written.

I finally gave up; I added “ignore temp1” to the jc42.conf file. Along with “label” the “ignore” command worked as well. There is no temperature value in the system journal, and there is no alarm, which is what I ultimately wanted.

You modified it how exactly?

I tried two methods (as root).

  1. echo "60" > /path/to/temp1_max
  2. vi /path/to/temp1_max; change ‘0’ to ‘60’; save.

In both cases inspecting the content of the file showed ‘0’.

After changing sysfs the file (sensors3.conf…) is not automagically updated.

Is the value still present if you do a cat /path/to/temp1_max?

The units used by hwmon temperature attributes are millidegree Celsius. Also, the chip itself has more coarse resolution, so 60 is likely rounded down to 0. 60°C would be 60000 (may be slightly off due to chip resolution).

Do not use editor on sysfs attributes. sysfs is not designed to be editable. You are expected to write the whole value atomically and who knows what editors do.

Ah ha! That worked. Thank you.

# echo "60000" > /path/to/temp1_max
# cat /path/to/temp1_max
60000
#
2024-10-02T13:20:44-07:00 sma-station14l sensord[299088]: Chip: jc42-i2c-6-1b
2024-10-02T13:20:44-07:00 sma-station14l sensord[299088]: Adapter: SMBus PIIX4 adapter port 0 at 0b00
2024-10-02T13:20:44-07:00 sma-station14l sensord[299088]:   DIMM Temp: 40.0 C (min = 0.0 C, max = 60.0 C)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.