From 670a5e356cb6dfc61b87b599eba483af6a3a99ad Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Fri, 5 Aug 2022 17:38:33 +0200 Subject: thermal/core: Move the thermal zone lock out of the governors All the governors throttling ops are taking/releasing the lock at the beginning and the end of the function. We can move the mutex to the throttling call site instead. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220805153834.2510142-4-daniel.lezcano@linaro.org --- drivers/thermal/gov_bang_bang.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/thermal/gov_bang_bang.c') diff --git a/drivers/thermal/gov_bang_bang.c b/drivers/thermal/gov_bang_bang.c index f0bff2e0475b..a08bbe33be96 100644 --- a/drivers/thermal/gov_bang_bang.c +++ b/drivers/thermal/gov_bang_bang.c @@ -96,15 +96,13 @@ static int bang_bang_control(struct thermal_zone_device *tz, int trip) { struct thermal_instance *instance; - mutex_lock(&tz->lock); + lockdep_assert_held(&tz->lock); thermal_zone_trip_update(tz, trip); list_for_each_entry(instance, &tz->thermal_instances, tz_node) thermal_cdev_update(instance->cdev); - mutex_unlock(&tz->lock); - return 0; } -- cgit v1.2.3