]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-6.8/thermal-of-assume-polling-delay-passive-0-when-absen.patch
Linux 6.6.27
[thirdparty/kernel/stable-queue.git] / queue-6.8 / thermal-of-assume-polling-delay-passive-0-when-absen.patch
1 From 9f23779736c74ff3dbdcccf12b30b50a83ef2a12 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Thu, 25 Jan 2024 13:11:16 +0100
4 Subject: thermal/of: Assume polling-delay(-passive) 0 when absent
5
6 From: Konrad Dybcio <konrad.dybcio@linaro.org>
7
8 [ Upstream commit 488164006a281986d95abbc4b26e340c19c4c85b ]
9
10 Currently, thermal zones associated with providers that have interrupts
11 for signaling hot/critical trips are required to set a polling-delay
12 of 0 to indicate no polling. This feels a bit backwards.
13
14 Change the code such that "no polling delay" also means "no polling".
15
16 Suggested-by: Bjorn Andersson <andersson@kernel.org>
17 Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
18 Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
19 Reviewed-by: Bjorn Andersson <andersson@kernel.org>
20 Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
21 Link: https://lore.kernel.org/r/20240125-topic-thermal-v1-2-3c9d4dced138@linaro.org
22 Signed-off-by: Sasha Levin <sashal@kernel.org>
23 ---
24 drivers/thermal/thermal_of.c | 12 ++++++++----
25 1 file changed, 8 insertions(+), 4 deletions(-)
26
27 diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
28 index 4d6c22e0ed85b..61bbd42aa2cb4 100644
29 --- a/drivers/thermal/thermal_of.c
30 +++ b/drivers/thermal/thermal_of.c
31 @@ -225,14 +225,18 @@ static int thermal_of_monitor_init(struct device_node *np, int *delay, int *pdel
32 int ret;
33
34 ret = of_property_read_u32(np, "polling-delay-passive", pdelay);
35 - if (ret < 0) {
36 - pr_err("%pOFn: missing polling-delay-passive property\n", np);
37 + if (ret == -EINVAL) {
38 + *pdelay = 0;
39 + } else if (ret < 0) {
40 + pr_err("%pOFn: Couldn't get polling-delay-passive: %d\n", np, ret);
41 return ret;
42 }
43
44 ret = of_property_read_u32(np, "polling-delay", delay);
45 - if (ret < 0) {
46 - pr_err("%pOFn: missing polling-delay property\n", np);
47 + if (ret == -EINVAL) {
48 + *delay = 0;
49 + } else if (ret < 0) {
50 + pr_err("%pOFn: Couldn't get polling-delay: %d\n", np, ret);
51 return ret;
52 }
53
54 --
55 2.43.0
56