]> Git Repo - J-linux.git/commitdiff
thermal: core: Restore behavior regarding invalid trip points
authorIdo Schimmel <[email protected]>
Tue, 14 Mar 2023 15:50:10 +0000 (17:50 +0200)
committerRafael J. Wysocki <[email protected]>
Wed, 22 Mar 2023 18:59:08 +0000 (19:59 +0100)
Commit 7c3d5c20dc16 ("thermal/core: Add a generic thermal_zone_get_trip()
function") 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.

Address 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 <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
drivers/thermal/thermal_core.c

index 55679fd86505d762ea05ec68028e1a500aec0b5d..b50931f84aaa0e7a4fa41e0115cac296170f4b60 100644 (file)
@@ -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);
        }
 
This page took 0.038386 seconds and 4 git commands to generate.