Skip to contentSkip to conversation

thermal/intel/intel_soc_dts_iosf: Fix reporting wrong temperatures

PATCH Applied Hans de Goede 3 participants 3 messages Jun 14, 2023 – Jun 15, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal/intel/intel_soc_dts_iosf: Fix reporting wrong temperatures

Since commit 955fb8719efb ("thermal/intel/intel_soc_dts_iosf: Use Intel TCC library") intel_soc_dts_iosf is reporting the wrong temperature.

The driver expects tj_max to be in milli-degrees-celcius but after the switch to the TCC library this is now in degrees celcius so instead of e.g. 90000 it is set to 90 causing a temperature 45 degrees below tj_max to be reported as -44910 milli-degrees instead of as 45000 milli-degrees.

Fix this by adding back the lost factor of 1000.

Fixes 955fb8719efb ("thermal/intel/intel_soc_dts_iosf: Use Intel TCC library")
Cc Zhang Rui <[email protected]>

---
Note reported by private email, so no Closes: tag

---
 drivers/thermal/intel/intel_soc_dts_iosf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/intel/intel_soc_dts_iosf.c +1 -1
index f99dc7e4ae89..db97499f4f0a 100644
@@ -398,7 +398,7 @@ struct intel_soc_dts_sensors *intel_soc_dts_iosf_init(
 	spin_lock_init(&sensors->intr_notify_lock);
 	mutex_init(&sensors->dts_update_lock);
 	sensors->intr_type = intr_type;
-	sensors->tj_max = tj_max;
+	sensors->tj_max = tj_max * 1000;
 	if (intr_type == INTEL_SOC_DTS_INTERRUPT_NONE)
 		notification = false;
 	else
Signature · 1 line
2.40.1
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Hans de Goede

Since commit 955fb8719efb ("thermal/intel/intel_soc_dts_iosf: Use Intel
TCC library") intel_soc_dts_iosf is reporting the wrong temperature.

The driver expects tj_max to be in milli-degrees-celcius but after the switch to the TCC library this is now in degrees celcius so instead of e.g. 90000 it is set to 90 causing a temperature 45 degrees below tj_max to be reported as -44910 milli-degrees instead of as 45000 milli-degrees.

Quoted 8 lines

Fix this by adding back the lost factor of 1000.

Fixes 955fb8719efb ("thermal/intel/intel_soc_dts_iosf: Use Intel TCC

library")

thanks,
rui

Quoted 21 lines

---
Note reported by private email, so no Closes: tag
---
 drivers/thermal/intel/intel_soc_dts_iosf.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/intel/intel_soc_dts_iosf.c +1 -1
index f99dc7e4ae89..db97499f4f0a 100644
@@ -398,7 +398,7 @@ struct intel_soc_dts_sensors
 *intel_soc_dts_iosf_init(
         spin_lock_init(&sensors->intr_notify_lock);
         mutex_init(&sensors->dts_update_lock);
         sensors->intr_type = intr_type;
-       sensors->tj_max = tj_max;
+       sensors->tj_max = tj_max * 1000;
         if (intr_type == INTEL_SOC_DTS_INTERRUPT_NONE)
                 notification = false;

        else

maintainer Applied
#2 lore raw
Quoted 14 lines · Rui
Quoted 12 lines · Hans de Goede

Since commit 955fb8719efb ("thermal/intel/intel_soc_dts_iosf: Use Intel
TCC library") intel_soc_dts_iosf is reporting the wrong temperature.

The driver expects tj_max to be in milli-degrees-celcius but after the switch to the TCC library this is now in degrees celcius so instead of e.g. 90000 it is set to 90 causing a temperature 45 degrees below tj_max to be reported as -44910 milli-degrees instead of as 45000 milli-degrees.

Fix this by adding back the lost factor of 1000.

Quoted 8 lines
Quoted 6 lines
Fixes 955fb8719efb ("thermal/intel/intel_soc_dts_iosf: Use Intel TCC

library")

Applied as 6.4-rc material, thanks!

Quoted 22 lines
Quoted 21 lines

---
Note reported by private email, so no Closes: tag

---
 drivers/thermal/intel/intel_soc_dts_iosf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/intel/intel_soc_dts_iosf.c +1 -1
index f99dc7e4ae89..db97499f4f0a 100644
@@ -398,7 +398,7 @@ struct intel_soc_dts_sensors
 *intel_soc_dts_iosf_init(
        spin_lock_init(&sensors->intr_notify_lock);
        mutex_init(&sensors->dts_update_lock);
        sensors->intr_type = intr_type;
-       sensors->tj_max = tj_max;
+       sensors->tj_max = tj_max * 1000;
        if (intr_type == INTEL_SOC_DTS_INTERRUPT_NONE)
                notification = false;

else