[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230913164659.9345-2-sumitg@nvidia.com>
Date: Wed, 13 Sep 2023 22:16:58 +0530
From: Sumit Gupta <sumitg@...dia.com>
To: <rafael@...nel.org>, <rui.zhang@...el.com>, <lenb@...nel.org>,
<treding@...dia.com>, <jonathanh@...dia.com>,
<linux-acpi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-tegra@...r.kernel.org>
CC: <sumitg@...dia.com>, <sanjayc@...dia.com>, <ksitaraman@...dia.com>,
<srikars@...dia.com>, <jbrasen@...dia.com>, <bbasu@...dia.com>
Subject: [Patch v2 1/2] ACPI: thermal: Add Thermal fast Sampling Period (_TFP) support
From: Jeff Brasen <jbrasen@...dia.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@...dia.com>
Signed-off-by: Sumit Gupta <sumitg@...dia.com>
---
drivers/acpi/thermal.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index f14e68266ccd..d0bbf42cae9c 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -102,7 +102,7 @@ struct acpi_thermal_passive {
struct acpi_handle_list devices;
unsigned long tc1;
unsigned long tc2;
- unsigned long tsp;
+ unsigned long passive_delay;
};
struct acpi_thermal_active {
@@ -287,11 +287,17 @@ static void __acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
tz->trips.passive.tc2 = tmp;
status = acpi_evaluate_integer(tz->device->handle,
- "_TSP", NULL, &tmp);
- if (ACPI_FAILURE(status))
- tz->trips.passive.trip.valid = false;
- else
- tz->trips.passive.tsp = tmp;
+ "_TFP", NULL, &tmp);
+ if (ACPI_FAILURE(status)) {
+ status = acpi_evaluate_integer(tz->device->handle,
+ "_TSP", NULL, &tmp);
+ if (ACPI_FAILURE(status))
+ tz->trips.passive.trip.valid = false;
+ else
+ tz->trips.passive.passive_delay = tmp * 100;
+ } else {
+ tz->trips.passive.passive_delay = tmp;
+ }
}
}
}
@@ -683,7 +689,6 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
{
struct acpi_thermal_trip *acpi_trip;
struct thermal_trip *trip;
- int passive_delay = 0;
int trip_count = 0;
int result;
int i;
@@ -694,10 +699,8 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
if (tz->trips.hot.valid)
trip_count++;
- if (tz->trips.passive.trip.valid) {
+ if (tz->trips.passive.trip.valid)
trip_count++;
- passive_delay = tz->trips.passive.tsp * 100;
- }
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE && tz->trips.active[i].trip.valid; i++)
trip_count++;
@@ -746,7 +749,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
0, tz,
&acpi_thermal_zone_ops,
NULL,
- passive_delay,
+ tz->trips.passive.passive_delay,
tz->polling_frequency * 100);
if (IS_ERR(tz->thermal_zone)) {
result = PTR_ERR(tz->thermal_zone);
--
2.17.1
Powered by blists - more mailing lists