summaryrefslogtreecommitdiff
path: root/drivers/thermal/gov_fair_share.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2022-08-05 18:38:33 +0300
committerDaniel Lezcano <daniel.lezcano@linaro.org>2022-08-17 15:09:39 +0300
commit670a5e356cb6dfc61b87b599eba483af6a3a99ad (patch)
tree5165d8ff45c1107d36c6cdcb5606cdf72aa82e8e /drivers/thermal/gov_fair_share.c
parent63561fe36b094729d3d4d274bafaa030b39e89f6 (diff)
downloadlinux-670a5e356cb6dfc61b87b599eba483af6a3a99ad.tar.xz
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 <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20220805153834.2510142-4-daniel.lezcano@linaro.org
Diffstat (limited to 'drivers/thermal/gov_fair_share.c')
-rw-r--r--drivers/thermal/gov_fair_share.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/thermal/gov_fair_share.c b/drivers/thermal/gov_fair_share.c
index 5d5ddd648cd2..a4ee4661e9cc 100644
--- a/drivers/thermal/gov_fair_share.c
+++ b/drivers/thermal/gov_fair_share.c
@@ -82,7 +82,7 @@ static int fair_share_throttle(struct thermal_zone_device *tz, int trip)
int total_instance = 0;
int cur_trip_level = get_trip_level(tz);
- mutex_lock(&tz->lock);
+ lockdep_assert_held(&tz->lock);
list_for_each_entry(instance, &tz->thermal_instances, tz_node) {
if (instance->trip != trip)
@@ -112,8 +112,6 @@ static int fair_share_throttle(struct thermal_zone_device *tz, int trip)
mutex_unlock(&cdev->lock);
}
- mutex_unlock(&tz->lock);
-
return 0;
}