Skip to contentSkip to conversation

hwmon: (coretemp) Delete tjmax debug message

PATCH Applied Zhang Rui 2 participants 4 messages Mar 30, 2023 – Apr 7, 2023

Subsystems (2)
lore
Share & tools
lore

Zhang Rui

author
#0 lore raw

PATCH v2 1/2 hwmon: (coretemp) Delete tjmax debug message

After commit c0c67f8761ce ("hwmon: (coretemp) Add support for dynamic tjmax"), tjmax value is retrieved from MSR every time the temperature is read.
This means that, with debug message enabled, the tjmax debug message is printed out for every single temperature read for any CPU. This spams the syslog.

Ideally, as tjmax is package scope unique, the debug message should show once when tjmax is changed for one package. But this requires inventing some new per-package data in the coretemp driver, and this is overkill.

To keep the code simple, delete the tjmax debug message.

---
 drivers/hwmon/coretemp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/hwmon/coretemp.c +1 -3
index 30d77f451937..fe3d4d0dcbed 100644
@@ -286,10 +286,8 @@ static int get_tjmax(struct temp_data *tdata, struct device *dev)
 		 * If the TjMax is not plausible, an assumption
 		 * will be used
 		 */
-		if (val) {
-			dev_dbg(dev, "TjMax is %d degrees C\n", val);
+		if (val)
 			return val * 1000;
-		}
 	}
 
 	if (force_tjmax) {
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH v2 2/2 hwmon: (coretemp) Delete an obsolete comment

The refinement of tjmax value retrieved from MSR_IA32_TEMPERATURE_TARGET has been changed for several times.

Now, the raw value from MSR is used without refinement. Thus remove the obsolete comment.

---
 drivers/hwmon/coretemp.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/hwmon/coretemp.c +0 -4
index fe3d4d0dcbed..eba94f68585a 100644
@@ -282,10 +282,6 @@ static int get_tjmax(struct temp_data *tdata, struct device *dev)
 			dev_warn(dev, "Unable to read TjMax from CPU %u\n", tdata->cpu);
 	} else {
 		val = (eax >> 16) & 0xff;
-		/*
-		 * If the TjMax is not plausible, an assumption
-		 * will be used
-		 */
 		if (val)
 			return val * 1000;
 	}
Signature · 1 line
2.25.1
maintainer Applied
#2 lore raw

Re: [PATCH v2 2/2] hwmon: (coretemp) Delete an obsolete comment

Quoted 7 lines · Zhang Rui

The refinement of tjmax value retrieved from MSR_IA32_TEMPERATURE_TARGET has been changed for several times.

Now, the raw value from MSR is used without refinement. Thus remove the obsolete comment.

Applied.

Thanks,
Guenter

Quoted 19 lines
---
 drivers/hwmon/coretemp.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/hwmon/coretemp.c +0 -4
index fe3d4d0dcbed..eba94f68585a 100644
@@ -282,10 +282,6 @@ static int get_tjmax(struct temp_data *tdata, struct device *dev)
 			dev_warn(dev, "Unable to read TjMax from CPU %u\n", tdata->cpu);
 	} else {
 		val = (eax >> 16) & 0xff;
-		/*
-		 * If the TjMax is not plausible, an assumption
-		 * will be used
-		 */
 		if (val)
 			return val * 1000;
 	}
maintainer Applied
#3 lore raw
In reply to Zhang Rui
Quoted 7 lines · Zhang Rui

After commit c0c67f8761ce ("hwmon: (coretemp) Add support for dynamic tjmax"), tjmax value is retrieved from MSR every time the temperature is read.
This means that, with debug message enabled, the tjmax debug message is printed out for every single temperature read for any CPU. This spams the syslog.

Quoted 7 lines

Ideally, as tjmax is package scope unique, the debug message should show once when tjmax is changed for one package. But this requires inventing some new per-package data in the coretemp driver, and this is overkill.

To keep the code simple, delete the tjmax debug message.

Applied.

Thanks,
Guenter

Quoted 20 lines
---
 drivers/hwmon/coretemp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/hwmon/coretemp.c +1 -3
index 30d77f451937..fe3d4d0dcbed 100644
@@ -286,10 +286,8 @@ static int get_tjmax(struct temp_data *tdata, struct device *dev)
 		 * If the TjMax is not plausible, an assumption
 		 * will be used
 		 */
-		if (val) {
-			dev_dbg(dev, "TjMax is %d degrees C\n", val);
+		if (val)
 			return val * 1000;
-		}
 	}
 
 	if (force_tjmax) {