]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hwmon: (peci/cputemp) Fix crit_hyst returning delta instead of absolute temperature
authorSanman Pradhan <psanman@juniper.net>
Mon, 23 Mar 2026 00:24:25 +0000 (00:24 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 24 Mar 2026 14:55:34 +0000 (07:55 -0700)
The hwmon sysfs ABI expects tempN_crit_hyst to report the temperature at
which the critical condition clears, not the hysteresis delta from the
critical limit.

The peci cputemp driver currently returns tjmax - tcontrol for
crit_hyst_type, which is the hysteresis margin rather than the
corresponding absolute temperature.

Return tcontrol directly, and update the documentation accordingly.

Fixes: bf3608f338e9 ("hwmon: peci: Add cputemp driver")
Cc: stable@vger.kernel.org
Signed-off-by: Sanman Pradhan <psanman@juniper.net>
Link: https://lore.kernel.org/r/20260323002352.93417-2-sanman.pradhan@hpe.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Documentation/hwmon/peci-cputemp.rst
drivers/hwmon/peci/cputemp.c

index fe0422248dc5ea7a3c8c951cd6730d4211af9bd6..266b62a46f49c29222dd0056bd3a00be264b4896 100644 (file)
@@ -51,8 +51,9 @@ temp1_max             Provides thermal control temperature of the CPU package
 temp1_crit             Provides shutdown temperature of the CPU package which
                        is also known as the maximum processor junction
                        temperature, Tjmax or Tprochot.
-temp1_crit_hyst                Provides the hysteresis value from Tcontrol to Tjmax of
-                       the CPU package.
+temp1_crit_hyst                Provides the hysteresis temperature of the CPU
+                       package. Returns Tcontrol, the temperature at which
+                       the critical condition clears.
 
 temp2_label            "DTS"
 temp2_input            Provides current temperature of the CPU package scaled
@@ -62,8 +63,9 @@ temp2_max             Provides thermal control temperature of the CPU package
 temp2_crit             Provides shutdown temperature of the CPU package which
                        is also known as the maximum processor junction
                        temperature, Tjmax or Tprochot.
-temp2_crit_hyst                Provides the hysteresis value from Tcontrol to Tjmax of
-                       the CPU package.
+temp2_crit_hyst                Provides the hysteresis temperature of the CPU
+                       package. Returns Tcontrol, the temperature at which
+                       the critical condition clears.
 
 temp3_label            "Tcontrol"
 temp3_input            Provides current Tcontrol temperature of the CPU
index b2fc936851e14562cd4d99a70d236e62064d6dcf..badec53ff4461cf6ed80282204fcce20bdbdbf28 100644 (file)
@@ -131,7 +131,7 @@ static int get_temp_target(struct peci_cputemp *priv, enum peci_temp_target_type
                *val = priv->temp.target.tjmax;
                break;
        case crit_hyst_type:
-               *val = priv->temp.target.tjmax - priv->temp.target.tcontrol;
+               *val = priv->temp.target.tcontrol;
                break;
        default:
                ret = -EOPNOTSUPP;