All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thermal/intel/intel_soc_dts_iosf: Fix reporting wrong temperatures
@ 2023-06-14 10:07 Hans de Goede
  2023-06-15  2:33 ` Zhang, Rui
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2023-06-14 10:07 UTC (permalink / raw)
  To: Rafael J . Wysocki, Daniel Lezcano
  Cc: Hans de Goede, Zhang Rui, linux-pm, Bernhard Krug, stable

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")
Reported-by: Bernhard Krug <b.krug@elektronenpumpe.de>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
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(-)

diff --git a/drivers/thermal/intel/intel_soc_dts_iosf.c b/drivers/thermal/intel/intel_soc_dts_iosf.c
index f99dc7e4ae89..db97499f4f0a 100644
--- a/drivers/thermal/intel/intel_soc_dts_iosf.c
+++ b/drivers/thermal/intel/intel_soc_dts_iosf.c
@@ -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
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] thermal/intel/intel_soc_dts_iosf: Fix reporting wrong temperatures
  2023-06-14 10:07 [PATCH] thermal/intel/intel_soc_dts_iosf: Fix reporting wrong temperatures Hans de Goede
@ 2023-06-15  2:33 ` Zhang, Rui
  2023-06-15 16:10   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang, Rui @ 2023-06-15  2:33 UTC (permalink / raw)
  To: hdegoede, rafael, daniel.lezcano; +Cc: linux-pm, b.krug, stable

On Wed, 2023-06-14 at 12:07 +0200, Hans de Goede wrote:
> 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")
> Reported-by: Bernhard Krug <b.krug@elektronenpumpe.de>
> Cc: Zhang Rui <rui.zhang@intel.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Acked-by: Zhang Rui <rui.zhang@intel.com>

thanks,
rui

> ---
> 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(-)
> 
> diff --git a/drivers/thermal/intel/intel_soc_dts_iosf.c
> b/drivers/thermal/intel/intel_soc_dts_iosf.c
> index f99dc7e4ae89..db97499f4f0a 100644
> --- a/drivers/thermal/intel/intel_soc_dts_iosf.c
> +++ b/drivers/thermal/intel/intel_soc_dts_iosf.c
> @@ -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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] thermal/intel/intel_soc_dts_iosf: Fix reporting wrong temperatures
  2023-06-15  2:33 ` Zhang, Rui
@ 2023-06-15 16:10   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2023-06-15 16:10 UTC (permalink / raw)
  To: Zhang, Rui, hdegoede; +Cc: rafael, daniel.lezcano, linux-pm, b.krug, stable

On Thu, Jun 15, 2023 at 4:35 AM Zhang, Rui <rui.zhang@intel.com> wrote:
>
> On Wed, 2023-06-14 at 12:07 +0200, Hans de Goede wrote:
> > 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")
> > Reported-by: Bernhard Krug <b.krug@elektronenpumpe.de>
> > Cc: Zhang Rui <rui.zhang@intel.com>
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>
> Acked-by: Zhang Rui <rui.zhang@intel.com>

Applied as 6.4-rc material, thanks!

> > ---
> > 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(-)
> >
> > diff --git a/drivers/thermal/intel/intel_soc_dts_iosf.c
> > b/drivers/thermal/intel/intel_soc_dts_iosf.c
> > index f99dc7e4ae89..db97499f4f0a 100644
> > --- a/drivers/thermal/intel/intel_soc_dts_iosf.c
> > +++ b/drivers/thermal/intel/intel_soc_dts_iosf.c
> > @@ -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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-15 16:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-14 10:07 [PATCH] thermal/intel/intel_soc_dts_iosf: Fix reporting wrong temperatures Hans de Goede
2023-06-15  2:33 ` Zhang, Rui
2023-06-15 16:10   ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.