From: "Zhang, Rui" <rui.zhang@intel.com>
To: "srinivas.pandruvada@linux.intel.com"
<srinivas.pandruvada@linux.intel.com>,
"lukasz.luba@arm.com" <lukasz.luba@arm.com>,
"rafael@kernel.org" <rafael@kernel.org>,
"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>
Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] thermal: intel: int340x: Add throttling control interface to PTC
Date: Mon, 16 Jun 2025 00:46:55 +0000 [thread overview]
Message-ID: <0dc5ad78ecd3e9a692c50ffb860bb1b0f93fef39.camel@intel.com> (raw)
In-Reply-To: <20250613214923.2910397-1-srinivas.pandruvada@linux.intel.com>
On Fri, 2025-06-13 at 14:49 -0700, Srinivas Pandruvada wrote:
> Firmware-based thermal temperature control loops may aggressively
> throttle performance to prevent temperature overshoots relative to the
> defined target temperature. This can negatively impact performance.
> User
> space may prefer to prioritize performance, even if it results in
> temperature overshoots with in acceptable range.
>
> For example, user space might tolerate temperature overshoots when the
> device is placed on a desk, as opposed to when it's on a lap. To
> accommodate such scenarios, an optional attribute is provided to
> specify
> a tolerance level for temperature overshoots while maintaining
> acceptable
> performance.
>
> Attribute:
> thermal_tolerance:
yeah, this is much better to me.
> This attribute ranges from 0 to 7, where 0 represents
> the most aggressive control to avoid any temperature overshoots, and 7
> represents a more graceful approach, favoring performance even at the
> expense of temperature overshoots.
> Note: This level may not scale linearly. For example, a value of 3 does
> not
> necessarily imply a 50% improvement in performance compared to a value
> of
> 0.
>
> Signed-off-by: Srinivas Pandruvada
> <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Zhang Rui <rui.zhang@intel.com>
-rui
> ---
> v2:
> - Changed commit description
> - Change "gain" to "thermal_tolerance" analogous to latency_tolerance.
> - Dropped "min_performance" attribute for next patch set
>
> Documentation/driver-api/thermal/intel_dptf.rst | 9 +++++++++
> .../intel/int340x_thermal/platform_temperature_control.c | 8 +++++++-
> 2 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/driver-api/thermal/intel_dptf.rst
> b/Documentation/driver-api/thermal/intel_dptf.rst
> index ec5769accae0..c51ac793dc06 100644
> --- a/Documentation/driver-api/thermal/intel_dptf.rst
> +++ b/Documentation/driver-api/thermal/intel_dptf.rst
> @@ -206,6 +206,15 @@ All these controls needs admin privilege to
> update.
> Update a new temperature target in milli degree celsius for
> hardware to
> use for the temperature control.
>
> +``thermal_tolerance`` (RW)
> + This attribute ranges from 0 to 7, where 0 represents
> + the most aggressive control to avoid any temperature
> overshoots, and
> + 7 represents a more graceful approach, favoring performance
> even at
> + the expense of temperature overshoots.
> + Note: This level may not scale linearly. For example, a value
> of 3 does
> + not necessarily imply a 50% improvement in performance
> compared to a
> + value of 0.
> +
> Given that this is platform temperature control, it is expected that a
> single user-level manager owns and manages the controls. If multiple
> user-level software applications attempt to write different targets,
> it
> diff --git
> a/drivers/thermal/intel/int340x_thermal/platform_temperature_control.c
> b/drivers/thermal/intel/int340x_thermal/platform_temperature_control.c
> index 2d6504514893..7850e91a6e2c 100644
> ---
> a/drivers/thermal/intel/int340x_thermal/platform_temperature_control.c
> +++
> b/drivers/thermal/intel/int340x_thermal/platform_temperature_control.c
> @@ -49,7 +49,7 @@ struct mmio_reg {
> };
>
> #define MAX_ATTR_GROUP_NAME_LEN 32
> -#define PTC_MAX_ATTRS 3
> +#define PTC_MAX_ATTRS 4
>
> struct ptc_data {
> u32 offset;
> @@ -57,6 +57,7 @@ struct ptc_data {
> struct attribute *ptc_attrs[PTC_MAX_ATTRS];
> struct device_attribute temperature_target_attr;
> struct device_attribute enable_attr;
> + struct device_attribute thermal_tolerance_attr;
> char group_name[MAX_ATTR_GROUP_NAME_LEN];
> };
>
> @@ -78,6 +79,7 @@ static u32 ptc_offsets[PTC_MAX_INSTANCES] = {0x5B20,
> 0x5B28, 0x5B30};
> static const char * const ptc_strings[] = {
> "temperature_target",
> "enable",
> + "thermal_tolerance",
> NULL
> };
>
> @@ -177,6 +179,8 @@ PTC_SHOW(temperature_target);
> PTC_STORE(temperature_target);
> PTC_SHOW(enable);
> PTC_STORE(enable);
> +PTC_SHOW(thermal_tolerance);
> +PTC_STORE(thermal_tolerance);
>
> #define ptc_init_attribute(_name)\
> do {\
> @@ -193,9 +197,11 @@ static int ptc_create_groups(struct pci_dev *pdev,
> int instance, struct ptc_data
>
> ptc_init_attribute(temperature_target);
> ptc_init_attribute(enable);
> + ptc_init_attribute(thermal_tolerance);
>
> data->ptc_attrs[index++] = &data-
> >temperature_target_attr.attr;
> data->ptc_attrs[index++] = &data->enable_attr.attr;
> + data->ptc_attrs[index++] = &data->thermal_tolerance_attr.attr;
> data->ptc_attrs[index] = NULL;
>
> snprintf(data->group_name, MAX_ATTR_GROUP_NAME_LEN,
next prev parent reply other threads:[~2025-06-16 0:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-13 21:49 [PATCH v2 1/2] thermal: intel: int340x: Add throttling control interface to PTC Srinivas Pandruvada
2025-06-13 21:49 ` [PATCH v2 2/2] thermal: intel: int340x: Allow temperature override Srinivas Pandruvada
2025-06-16 1:03 ` Zhang, Rui
2025-06-16 0:46 ` Zhang, Rui [this message]
2025-06-16 12:05 ` [PATCH v2 1/2] thermal: intel: int340x: Add throttling control interface to PTC Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0dc5ad78ecd3e9a692c50ffb860bb1b0f93fef39.camel@intel.com \
--to=rui.zhang@intel.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=rafael@kernel.org \
--cc=srinivas.pandruvada@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox