mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] thermal: of: Fix logic in thermal_of_should_bind
@ 2025-02-19  7:06 Yu-Che Cheng
  2025-02-19 21:40 ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Yu-Che Cheng @ 2025-02-19  7:06 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba
  Cc: Rafael J. Wysocki, linux-pm, linux-kernel, Chen-Yu Tsai, Yu-Che Cheng

The current thermal_of_should_bind will stop iterating cooling-maps on
the first matched trip point, leading to subsequent cooling devices
binding to the same trip point failing to find the cooling spec.

The iteration should continue enumerating subsequent cooling-maps if the
target cooling device is not found.

Fix the logic to break only when a matched cooling device is found.

Fixes: 94c6110b0b13 ("thermal/of: Use the .should_bind() thermal zone callback")
Signed-off-by: Yu-Che Cheng <giver@chromium.org>
---
 drivers/thermal/thermal_of.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
index 5ab4ce4daaeb..69c530e38574 100644
--- a/drivers/thermal/thermal_of.c
+++ b/drivers/thermal/thermal_of.c
@@ -312,7 +312,8 @@ static bool thermal_of_should_bind(struct thermal_zone_device *tz,
 				break;
 		}
 
-		break;
+		if (result)
+			break;
 	}
 
 	of_node_put(cm_np);

---
base-commit: 2408a807bfc3f738850ef5ad5e3fd59d66168996
change-id: 20250218-fix-thermal-of-247b71be0faa

Best regards,
-- 
Yu-Che Cheng <giver@chromium.org>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-02-24 10:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-19  7:06 [PATCH] thermal: of: Fix logic in thermal_of_should_bind Yu-Che Cheng
2025-02-19 21:40 ` Rafael J. Wysocki
2025-02-20 20:22   ` Rafael J. Wysocki
2025-02-21 23:24     ` Yu-Che Cheng
2025-02-24 10:59     ` Lukasz Luba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®