[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4940808.31r3eYUQgx@rjwysocki.net>
Date: Fri, 05 Jul 2024 21:46:26 +0200
From: "Rafael J. Wysocki" <rjw@...ysocki.net>
To: Linux PM <linux-pm@...r.kernel.org>
Cc: Daniel Lezcano <daniel.lezcano@...aro.org>,
LKML <linux-kernel@...r.kernel.org>, Lukasz Luba <lukasz.luba@....com>
Subject:
[PATCH v2 2/2] thermal: core: Add sanity check for polling_delay and
passive_delay
From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
If polling_delay is nonzero and passive_delay is 0, the thermal zone
will use polling except when tz->passive is nonzero, which does not make
sense.
Also if polling_delay is nonzero and passive_delay is greater than
polling_delay, the thermal zone temperature will be updated less often
when tz->passive is nonzero. This does not make sense either.
Ensure that none of the above will happen.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
---
v1 -> v2: The patch actually matches the changelog
---
drivers/thermal/thermal_core.c | 3 +++
1 file changed, 3 insertions(+)
Index: linux-pm/drivers/thermal/thermal_core.c
===================================================================
--- linux-pm.orig/drivers/thermal/thermal_core.c
+++ linux-pm/drivers/thermal/thermal_core.c
@@ -1440,6 +1440,9 @@ thermal_zone_device_register_with_trips(
td->threshold = INT_MAX;
}
+ if (polling_delay && (passive_delay > polling_delay || !passive_delay))
+ passive_delay = polling_delay;
+
thermal_set_delay_jiffies(&tz->passive_delay_jiffies, passive_delay);
thermal_set_delay_jiffies(&tz->polling_delay_jiffies, polling_delay);
Powered by blists - more mailing lists