Skip to content

Commit 0adc752

Browse files
Sanman Pradhangroeck
authored andcommitted
hwmon: (peci/cputemp) Fix crit_hyst returning delta instead of absolute temperature
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: bf3608f ("hwmon: peci: Add cputemp driver") Cc: [email protected] Signed-off-by: Sanman Pradhan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 3075a39 commit 0adc752

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

Documentation/hwmon/peci-cputemp.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ temp1_max Provides thermal control temperature of the CPU package
5151
temp1_crit Provides shutdown temperature of the CPU package which
5252
is also known as the maximum processor junction
5353
temperature, Tjmax or Tprochot.
54-
temp1_crit_hyst Provides the hysteresis value from Tcontrol to Tjmax of
55-
the CPU package.
54+
temp1_crit_hyst Provides the hysteresis temperature of the CPU
55+
package. Returns Tcontrol, the temperature at which
56+
the critical condition clears.
5657

5758
temp2_label "DTS"
5859
temp2_input Provides current temperature of the CPU package scaled
@@ -62,8 +63,9 @@ temp2_max Provides thermal control temperature of the CPU package
6263
temp2_crit Provides shutdown temperature of the CPU package which
6364
is also known as the maximum processor junction
6465
temperature, Tjmax or Tprochot.
65-
temp2_crit_hyst Provides the hysteresis value from Tcontrol to Tjmax of
66-
the CPU package.
66+
temp2_crit_hyst Provides the hysteresis temperature of the CPU
67+
package. Returns Tcontrol, the temperature at which
68+
the critical condition clears.
6769

6870
temp3_label "Tcontrol"
6971
temp3_input Provides current Tcontrol temperature of the CPU

drivers/hwmon/peci/cputemp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static int get_temp_target(struct peci_cputemp *priv, enum peci_temp_target_type
131131
*val = priv->temp.target.tjmax;
132132
break;
133133
case crit_hyst_type:
134-
*val = priv->temp.target.tjmax - priv->temp.target.tcontrol;
134+
*val = priv->temp.target.tcontrol;
135135
break;
136136
default:
137137
ret = -EOPNOTSUPP;

0 commit comments

Comments
 (0)