linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* TCC cooling on Meteorlake
       [not found] <f733005155e64d489ae18d7d357bada9@secunet.com>
@ 2025-02-24 11:27 ` Gwara, Mateusz
  0 siblings, 0 replies; 6+ messages in thread
From: Gwara, Mateusz @ 2025-02-24 11:27 UTC (permalink / raw)
  To: rafael@kernel.org, daniel.lezcano@linaro.org, rui.zhang@intel.com,
	lukasz.luba@arm.com
  Cc: linux-pm@vger.kernel.org, Wassenberg, Dennis

Hi,

Sorry, my first mail was sent as HTML due to a corporate policy preset.
So here's my initial mail:


Hello dear maintainers!

I was comparing the behavior of the Intel TCC cooling driver on a kernel we develop and also on regular Ubuntu kernel releases(based on Linux kernel up to 6.13).
On a Raptorlake CPU you’ll see the TCC node with e.g.:

/sys/class/thermal/cooling_device8/type
/sys/class/thermal/cooling_device8/cur_state

Endpoints

This allows reading/setting the offsets as expected.

This was made possible in
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers?h=next-20250212&id=be6bfb29c55e48567983e24aba7b6bf9a66a45ab/https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/thermal?h=next-20250212&id=be6bfb29c55e48567983e24aba7b6bf9a66a45ab/https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/thermal/intel?h=next-20250212&id=be6bfb29c55e48567983e24aba7b6bf9a66a45ab/https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/thermal/intel/intel_tcc_cooling.c?h=next-20250212&id=be6bfb29c55e48567983e24aba7b6bf9a66a45ab

with a patch that added 
> +       X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE,           &temp_tigerlake),
> +       X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_L,         &temp_tigerlake),
> +       X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE,          &temp_tigerlake),
> +       X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_P,        &temp_tigerlake),
> +       X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_S,        &temp_tigerlake),

Among other changes, where intel_tcc_get_offset_mask would get the correct Tjunction offset for each CPU.

I was trying to add a similar entry corresponding to the Meteorlake Model names but this did not have the same effect and there was no TCC node present like on a Raptorlake device.
                
As I see in
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/thermal/intel/intel_tcc_cooling.c?h=next-20250219
the last CPU added here still is the Raptorlake model.

I checked the repositories where Intel maintains their CPU patches but there was also no mention of Meteorlake (and later models)regarding TCC support.
As there have been several ARROW&LUNAR-lake patches handling different issues regarding clocking the different core variants.

I’d like to know if there is something I’m missing(maybe NO TCC support since Meteorlake?) or if there is TCC support planned?
I’d be willing to help test anything regarding this issue.


Sorry for the lengthy mail and thank you for you work on the Linux Kernel so far :)



Mateusz 


-- 
Mateusz Gwara
Senior Software Developer
Department Network & Client Security
Division Public Authorities
secunet Security Networks AG

Tel.: +49 201 54 54-2934
E-Mail: mailto:mateusz.gwara@secunet.com
Alt-Moabit 96, 10559 Berlin
http://www.secunet.com
______________________________________________________________________

secunet Security Networks AG
Sitz: Kurfürstenstraße 58, 45138 Essen, Deutschland
Amtsgericht Essen HRB 13615
Vorstand: Axel Deininger (Vors.), Torsten Henn, Dr. Kai Martius, Jessica Nospers
Aufsichtsratsvorsitzender: Dr. Ralf Wintergerst
______________________________________________________________________


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

* Re: TCC cooling on Meteorlake
@ 2025-03-11 12:19 Gwara, Mateusz
  2025-03-13  5:29 ` Zhang, Rui
  0 siblings, 1 reply; 6+ messages in thread
From: Gwara, Mateusz @ 2025-03-11 12:19 UTC (permalink / raw)
  To: Gwara, Mateusz
  Cc: Wassenberg, Dennis, daniel.lezcano@linaro.org,
	linux-pm@vger.kernel.org, lukasz.luba@arm.com, rafael@kernel.org,
	rui.zhang@intel.com

Hi,

I wanted to make sure that there is no confusion because there seems to be two sets of drivers handling TCC.
As the workings of drivers/thermal/intel/int340x_thermal/int3403_thermal.c are visible in
/sys/bus/pci/devices/0000:00:04.0/tcc_offset_degree_celsius
and defined in drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
do have a wrong offset, which does not take into account that Meteor Lake CPUs have a TJunction of 110°C instead of 100°C.

That's why I was wondering why the new definitions in
drivers/thermal/intel/intel_tcc_cooling.c
does not contain any Meteor Lake (or Arrow&Lunar Lake ) definitions.
Where the results should be visible in /sys/class/thermal as mentioned in the initial post.

Regards

MG

-- 
Mateusz Gwara
Senior Software Developer
Department Network & Client Security
Division Public Authorities
secunet Security Networks AG

Tel.: +49 201 54 54-2934
E-Mail: mateusz.gwara@secunet.com
Alt-Moabit 96, 10559 Berlin
www.secunet.com
______________________________________________________________________

secunet Security Networks AG
Sitz: Kurfürstenstraße 58, 45138 Essen, Deutschland
Amtsgericht Essen HRB 13615
Vorstand: Axel Deininger (Vors.), Torsten Henn, Dr. Kai Martius, Jessica Nospers
Aufsichtsratsvorsitzender: Dr. Ralf Wintergerst
______________________________________________________________________


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

* Re: TCC cooling on Meteorlake
  2025-03-11 12:19 Gwara, Mateusz
@ 2025-03-13  5:29 ` Zhang, Rui
  0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Rui @ 2025-03-13  5:29 UTC (permalink / raw)
  To: 163ff391dc6d4f828ecff95e87f5003d@secunet.com, Gwara, Mateusz
  Cc: Neri, Ricardo, lukasz.luba@arm.com, linux-pm@vger.kernel.org,
	Wassenberg, Dennis, daniel.lezcano@linaro.org,
	Pandruvada, Srinivas, rafael@kernel.org

CC Srinivas and Ricardo.

On Tue, 2025-03-11 at 12:19 +0000, Gwara, Mateusz wrote:
> Hi,
> 
> I wanted to make sure that there is no confusion because there seems
> to be two sets of drivers handling TCC.
> As the workings of
> drivers/thermal/intel/int340x_thermal/int3403_thermal.c are visible
> in
> /sys/bus/pci/devices/0000:00:04.0/tcc_offset_degree_celsius
> and defined in
> drivers/thermal/intel/int340x_thermal/processor_thermal_device.c

yes.

> do have a wrong offset,

what do you see from
/sys/bus/pci/devices/0000:00:04.0/tcc_offset_degree_celsius?

It should return 0 if noone changes the offset.

>  which does not take into account that Meteor Lake CPUs have a
> TJunction of 110°C instead of 100°C.

tcc offset is an offset to tjmax, no matter what the tjmax value is,
right?

> 
> That's why I was wondering why the new definitions in
> drivers/thermal/intel/intel_tcc_cooling.c
> does not contain any Meteor Lake (or Arrow&Lunar Lake ) definitions.
> Where the results should be visible in /sys/class/thermal as
> mentioned in the initial post.

yeah. We should add this. Patch will be submitted soon.

thanks,
rui
> 
> Regards
> 
> MG
> 


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

* Re: TCC cooling on Meteorlake
@ 2025-03-17 10:31 Gwara, Mateusz
  2025-03-24  0:17 ` Zhang, Rui
  0 siblings, 1 reply; 6+ messages in thread
From: Gwara, Mateusz @ 2025-03-17 10:31 UTC (permalink / raw)
  To: rui.zhang@intel.com
  Cc: 163ff391dc6d4f828ecff95e87f5003d@secunet.com,
	daniel.lezcano@linaro.org, Wassenberg, Dennis,
	linux-pm@vger.kernel.org, lukasz.luba@arm.com, Gwara, Mateusz,
	rafael@kernel.org, ricardo.neri@intel.com,
	srinivas.pandruvada@intel.com

> what do you see from
> /sys/bus/pci/devices/0000:00:04.0/tcc_offset_degree_celsius?

>It should return 0 if noone changes the offset.

The offset is set to 14°C on a Meteor Lake CPU.
This behavior applies to our custom kernel(based on vanilla 6.8) as well as the regular Ubuntu kernel builds (tested with 6.8 and 6.14)


> tcc offset is an offset to tjmax, no matter what the tjmax value is,
> right?

That's true.
We run our Raptor Lake devices with a TCC Offset of 3°C which is what is usually set for those and generations before on a regular Ubuntu for example.
This means we actively make sure this value is set to 3 as 0 would mean being too close to tjmax and risking an uncontrolled shutdown(i.e. actually reaching tjmax).
Having this value so close to tjmax allows to prevent premature thermal throttling.
So, the much higher default value for Meteor Lake TCC offset basically cancels out their higher temperature range.

> yeah. We should add this. Patch will be submitted soon.

Thanks in advance!

Mateusz


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

* Re: TCC cooling on Meteorlake
  2025-03-17 10:31 Gwara, Mateusz
@ 2025-03-24  0:17 ` Zhang, Rui
  0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Rui @ 2025-03-24  0:17 UTC (permalink / raw)
  To: 5e9075f31acbd5a1ef549cc3cd2236173a41353a.camel@intel.com
  Cc: Neri, Ricardo, daniel.lezcano@linaro.org, lukasz.luba@arm.com,
	163ff391dc6d4f828ecff95e87f5003d@secunet.com, Wassenberg, Dennis,
	rafael@kernel.org, Gwara, Mateusz, linux-pm@vger.kernel.org,
	Pandruvada, Srinivas

[-- Attachment #1: Type: text/plain, Size: 2825 bytes --]

On Mon, 2025-03-17 at 10:31 +0000, Gwara, Mateusz wrote:
> > what do you see from
> > /sys/bus/pci/devices/0000:00:04.0/tcc_offset_degree_celsius?
> 
> > It should return 0 if noone changes the offset.
> 
> The offset is set to 14°C on a Meteor Lake CPU.

do you know who sets it?

> This behavior applies to our custom kernel(based on vanilla 6.8) as
> well as the regular Ubuntu kernel builds (tested with 6.8 and 6.14)
> 
> 
> > tcc offset is an offset to tjmax, no matter what the tjmax value
> > is,
> > right?
> 
> That's true.
> We run our Raptor Lake devices with a TCC Offset of 3°C which is what
> is usually set

and who sets it?

>  for those and generations before on a regular Ubuntu for example.
> This means we actively make sure this value is set to 3 as 0 would
> mean being too close to tjmax and risking an uncontrolled
> shutdown(i.e. actually reaching tjmax).
> Having this value so close to tjmax allows to prevent premature
> thermal throttling.
> So, the much higher default value for Meteor Lake TCC offset
> basically cancels out their higher temperature range.
> 
> > yeah. We should add this. Patch will be submitted soon.
> 
I have applied this patch on a couple of machines that I can access but
unfortunately they all have TCC offset bit locked. So please check if
it works as expected or not.

And FYI, both intel_tcc_cooling and the proc_thermal
"tcc_offset_degree_celsius" attribute are based on the same tcc
helpers, so I don't think there is any difference between these two
knobs.

From 55b58b8ba7426d8bfde26d78855d4939066918da Mon Sep 17 00:00:00 2001
From: Zhang Rui <rui.zhang@intel.com>
Date: Thu, 13 Mar 2025 13:31:33 +0800
Subject: [PATCH] thermal: intel: intel_tcc_cooling: Add support for recent
 client platforms

Add tcc cooling support for recent client platforms including
MeteorLake, ArrowLake and LunarLake.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/thermal/intel/intel_tcc_cooling.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/thermal/intel/intel_tcc_cooling.c b/drivers/thermal/intel/intel_tcc_cooling.c
index 9ff0ebdde0ef..be8af2694367 100644
--- a/drivers/thermal/intel/intel_tcc_cooling.c
+++ b/drivers/thermal/intel/intel_tcc_cooling.c
@@ -64,6 +64,12 @@ static const struct x86_cpu_id tcc_ids[] __initconst = {
 	X86_MATCH_VFM(INTEL_RAPTORLAKE, NULL),
 	X86_MATCH_VFM(INTEL_RAPTORLAKE_P, NULL),
 	X86_MATCH_VFM(INTEL_RAPTORLAKE_S, NULL),
+	X86_MATCH_VFM(INTEL_METEORLAKE, NULL),
+	X86_MATCH_VFM(INTEL_METEORLAKE_L, NULL),
+	X86_MATCH_VFM(INTEL_ARROWLAKE, NULL),
+	X86_MATCH_VFM(INTEL_ARROWLAKE_H, NULL),
+	X86_MATCH_VFM(INTEL_ARROWLAKE_U, NULL),
+	X86_MATCH_VFM(INTEL_LUNARLAKE_M, NULL),
 	{}
 };
 
-- 
2.43.0



















[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-thermal-intel-intel_tcc_cooling-Add-support-for-rece.patch --]
[-- Type: text/x-patch; name="0001-thermal-intel-intel_tcc_cooling-Add-support-for-rece.patch", Size: 1191 bytes --]

From 55b58b8ba7426d8bfde26d78855d4939066918da Mon Sep 17 00:00:00 2001
From: Zhang Rui <rui.zhang@intel.com>
Date: Thu, 13 Mar 2025 13:31:33 +0800
Subject: [PATCH] thermal: intel: intel_tcc_cooling: Add support for recent
 client platforms

Add tcc cooling support for recent client platforms including
MeteorLake, ArrowLake and LunarLake.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/thermal/intel/intel_tcc_cooling.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/thermal/intel/intel_tcc_cooling.c b/drivers/thermal/intel/intel_tcc_cooling.c
index 9ff0ebdde0ef..be8af2694367 100644
--- a/drivers/thermal/intel/intel_tcc_cooling.c
+++ b/drivers/thermal/intel/intel_tcc_cooling.c
@@ -64,6 +64,12 @@ static const struct x86_cpu_id tcc_ids[] __initconst = {
 	X86_MATCH_VFM(INTEL_RAPTORLAKE, NULL),
 	X86_MATCH_VFM(INTEL_RAPTORLAKE_P, NULL),
 	X86_MATCH_VFM(INTEL_RAPTORLAKE_S, NULL),
+	X86_MATCH_VFM(INTEL_METEORLAKE, NULL),
+	X86_MATCH_VFM(INTEL_METEORLAKE_L, NULL),
+	X86_MATCH_VFM(INTEL_ARROWLAKE, NULL),
+	X86_MATCH_VFM(INTEL_ARROWLAKE_H, NULL),
+	X86_MATCH_VFM(INTEL_ARROWLAKE_U, NULL),
+	X86_MATCH_VFM(INTEL_LUNARLAKE_M, NULL),
 	{}
 };
 
-- 
2.43.0


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

* Re: TCC cooling on Meteorlake
@ 2025-03-26 17:46 Gwara, Mateusz
  0 siblings, 0 replies; 6+ messages in thread
From: Gwara, Mateusz @ 2025-03-26 17:46 UTC (permalink / raw)
  To: rui.zhang@intel.com
  Cc: 17a637f633a7560ca87d7461fc56632e5f9e41cc.camel@intel.com,
	daniel.lezcano@linaro.org, Wassenberg, Dennis,
	linux-pm@vger.kernel.org, lukasz.luba@arm.com, Gwara, Mateusz,
	rafael@kernel.org, ricardo.neri@intel.com,
	srinivas.pandruvada@intel.com

>> The offset is set to 14°C on a Meteor Lake CPU.

> do you know who sets it?

On most systems this value is being set in the BIOS by the OEM to match
the cooling system performance in which the CPU is used in.


>> We run our Raptor Lake devices with a TCC Offset of 3°C which is what
>> is usually set

> and who sets it?

This value is derived from what a OEM (in our case, Lenovo) sets in their BIOS,
but as we experienced problems that occur after thermal events or system suspend/recume cycles
we have our own service runnig on our custom linux based operating system
that makes sure the value is always set correctly.

> I have applied this patch on a couple of machines that I can access but
> unfortunately they all have TCC offset bit locked. So please check if
> it works as expected or not.

Will do gladly. Thanks for pointing this out. It's possible that other OEMs won't allow to change this value.

> And FYI, both intel_tcc_cooling and the proc_thermal
> "tcc_offset_degree_celsius" attribute are based on the same tcc
> helpers, so I don't think there is any difference between these two
> knobs.

That's true. I've seen that they point to the same address.

-- 
Mateusz Gwara
Senior Software Developer
Department Network & Client Security
Division Public Authorities
secunet Security Networks AG

Tel.: +49 201 54 54-2934
E-Mail: mateusz.gwara@secunet.com
Alt-Moabit 96, 10559 Berlin
www.secunet.com
______________________________________________________________________

secunet Security Networks AG
Sitz: Kurfürstenstraße 58, 45138 Essen, Deutschland
Amtsgericht Essen HRB 13615
Vorstand: Axel Deininger (Vors.), Torsten Henn, Dr. Kai Martius, Jessica Nospers
Aufsichtsratsvorsitzender: Dr. Ralf Wintergerst
______________________________________________________________________


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

end of thread, other threads:[~2025-03-26 17:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <f733005155e64d489ae18d7d357bada9@secunet.com>
2025-02-24 11:27 ` TCC cooling on Meteorlake Gwara, Mateusz
2025-03-11 12:19 Gwara, Mateusz
2025-03-13  5:29 ` Zhang, Rui
  -- strict thread matches above, loose matches on Subject: below --
2025-03-17 10:31 Gwara, Mateusz
2025-03-24  0:17 ` Zhang, Rui
2025-03-26 17:46 Gwara, Mateusz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).