Skip to content

Commit 1a93369

Browse files
lukaszluba-armdlezcano
authored andcommitted
thermal/core/fair share: Use the lockless __thermal_cdev_update() function
Use the new helper function and avoid unnecessery second lock/unlock, which was present in old approach with thermal_cdev_update(). Signed-off-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20210422153624.6074-3-lukasz.luba@arm.com
1 parent fef0577 commit 1a93369

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

drivers/thermal/gov_fair_share.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,9 @@ static int fair_share_throttle(struct thermal_zone_device *tz, int trip)
107107
instance->target = get_target_state(tz, cdev, percentage,
108108
cur_trip_level);
109109

110-
mutex_lock(&instance->cdev->lock);
111-
instance->cdev->updated = false;
112-
mutex_unlock(&instance->cdev->lock);
113-
thermal_cdev_update(cdev);
110+
mutex_lock(&cdev->lock);
111+
__thermal_cdev_update(cdev);
112+
mutex_unlock(&cdev->lock);
114113
}
115114

116115
mutex_unlock(&tz->lock);

0 commit comments

Comments
 (0)