From: Sumit Gupta <sumitg@nvidia.com>
To: <rafael@kernel.org>, <rui.zhang@intel.com>, <lenb@kernel.org>,
<linux-acpi@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: <treding@nvidia.com>, <jonathanh@nvidia.com>, <bbasu@nvidia.com>,
<sumitg@nvidia.com>, <sanjayc@nvidia.com>,
<ksitaraman@nvidia.com>, <srikars@nvidia.com>,
<jbrasen@nvidia.com>
Subject: [Patch v5 1/2] ACPI: thermal: Add Thermal fast Sampling Period (_TFP) support
Date: Sat, 14 Oct 2023 16:24:25 +0530 [thread overview]
Message-ID: <20231014105426.26389-2-sumitg@nvidia.com> (raw)
In-Reply-To: <20231014105426.26389-1-sumitg@nvidia.com>
From: Jeff Brasen <jbrasen@nvidia.com>
Add support of "Thermal fast Sampling Period (_TFP)" for Passive cooling.
As per [1], _TFP overrides the "Thermal Sampling Period (_TSP)" if both
are present in a Thermal zone.
[1] ACPI Specification 6.4 - section 11.4.17. _TFP (Thermal fast Sampling
Period)"
Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
---
drivers/acpi/thermal.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index d98ff69303b3..a91e3d566858 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -90,7 +90,7 @@ struct acpi_thermal_passive {
struct acpi_thermal_trip trip;
unsigned long tc1;
unsigned long tc2;
- unsigned long tsp;
+ unsigned long passive_delay;
};
struct acpi_thermal_active {
@@ -404,11 +404,16 @@ static bool passive_trip_params_init(struct acpi_thermal *tz)
tz->trips.passive.tc2 = tmp;
- status = acpi_evaluate_integer(tz->device->handle, "_TSP", NULL, &tmp);
- if (ACPI_FAILURE(status))
- return false;
+ status = acpi_evaluate_integer(tz->device->handle, "_TFP", NULL, &tmp);
+ if (ACPI_FAILURE(status)) {
+ status = acpi_evaluate_integer(tz->device->handle, "_TSP", NULL, &tmp);
+ if (ACPI_FAILURE(status))
+ return false;
- tz->trips.passive.tsp = tmp;
+ tz->trips.passive.passive_delay = tmp * 100;
+ } else {
+ tz->trips.passive.passive_delay = tmp;
+ }
return true;
}
@@ -904,7 +909,7 @@ static int acpi_thermal_add(struct acpi_device *device)
acpi_trip = &tz->trips.passive.trip;
if (acpi_thermal_trip_valid(acpi_trip)) {
- passive_delay = tz->trips.passive.tsp * 100;
+ passive_delay = tz->trips.passive.passive_delay;
trip->type = THERMAL_TRIP_PASSIVE;
trip->temperature = acpi_thermal_temp(tz, acpi_trip->temp_dk);
--
2.17.1
next prev parent reply other threads:[~2023-10-14 10:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-14 10:54 [Patch v5 0/2] Add support for _TFP and change throttle pctg Sumit Gupta
2023-10-14 10:54 ` Sumit Gupta [this message]
2023-10-18 11:48 ` [Patch v5 1/2] ACPI: thermal: Add Thermal fast Sampling Period (_TFP) support Rafael J. Wysocki
2023-10-19 18:30 ` Sumit Gupta
2023-10-14 10:54 ` [Patch v5 2/2] ACPI: processor: reduce CPUFREQ thermal reduction pctg for Tegra241 Sumit Gupta
2023-10-18 13:04 ` Rafael J. Wysocki
2023-10-20 8:30 ` Sumit Gupta
2023-10-20 8:30 ` Sumit Gupta
2023-11-09 7:50 ` Hanjun Guo
2023-11-09 7:50 ` Hanjun Guo
2023-11-09 11:36 ` Sumit Gupta
2023-11-09 11:36 ` Sumit Gupta
2023-10-23 8:53 ` Sudeep Holla
2023-10-25 12:51 ` Sumit Gupta
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=20231014105426.26389-2-sumitg@nvidia.com \
--to=sumitg@nvidia.com \
--cc=bbasu@nvidia.com \
--cc=jbrasen@nvidia.com \
--cc=jonathanh@nvidia.com \
--cc=ksitaraman@nvidia.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
--cc=sanjayc@nvidia.com \
--cc=srikars@nvidia.com \
--cc=treding@nvidia.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 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.