linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal: core: Restore behavior regarding invalid trip points
@ 2023-03-14 15:50 Ido Schimmel
  2023-03-14 18:03 ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Ido Schimmel @ 2023-03-14 15:50 UTC (permalink / raw)
  To: linux-pm
  Cc: rafael, daniel.lezcano, amitk, rui.zhang, mlxsw, vadimp,
	Ido Schimmel

Cited commit stopped marking trip points with a zero temperature as
disabled, behavior that was originally introduced in commit 81ad4276b505
("Thermal: Ignore invalid trip points").

When using the mlxsw driver we see that when such trip points are not
disabled, the thermal subsystem repeatedly tries to set the state of the
associated cooling devices to the maximum state.

Fix this by restoring the original behavior and mark trip points with a
zero temperature as disabled.

Fixes: 7c3d5c20dc16 ("thermal/core: Add a generic thermal_zone_get_trip() function")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 drivers/thermal/thermal_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 5ae72f314683..63583df4498d 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -1309,7 +1309,7 @@ thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *t
 		struct thermal_trip trip;
 
 		result = thermal_zone_get_trip(tz, count, &trip);
-		if (result)
+		if (result || !trip.temperature)
 			set_bit(count, &tz->trips_disabled);
 	}
 
-- 
2.37.3


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

end of thread, other threads:[~2023-03-23 21:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-14 15:50 [PATCH] thermal: core: Restore behavior regarding invalid trip points Ido Schimmel
2023-03-14 18:03 ` Rafael J. Wysocki
2023-03-14 18:35   ` Ido Schimmel
2023-03-22 19:04     ` Rafael J. Wysocki
2023-03-23 21:25       ` Ido Schimmel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).