thermal/drivers/tegra: Fix set_trip_temp() deadlock
authorJohan Hovold <johan+linaro@kernel.org>
Wed, 14 Dec 2022 13:16:16 +0000 (14:16 +0100)
committerDaniel Lezcano <daniel.lezcano@kernel.org>
Fri, 6 Jan 2023 13:14:48 +0000 (14:14 +0100)
The set_trip_temp() callback is used when changing the trip temperature
through sysfs. As it is called with the thermal-zone-device lock held
it must not use thermal_zone_get_trip() directly or it will deadlock.

Fixes: 56d7b397cc29 ("thermal/drivers/tegra: Use generic thermal_zone_get_trip() function")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20221214131617.2447-4-johan+linaro@kernel.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
drivers/thermal/tegra/soctherm.c

index 4203e74e2f797f374c7dbd8e060d8d0116e8cb71..220873298d776b733b0788d3a47ace860c544abc 100644 (file)
@@ -594,7 +594,7 @@ static int tegra_thermctl_set_trip_temp(struct thermal_zone_device *tz, int trip
        if (!tz)
                return -EINVAL;
 
-       ret = thermal_zone_get_trip(tz, trip_id, &trip);
+       ret = __thermal_zone_get_trip(tz, trip_id, &trip);
        if (ret)
                return ret;