]> www.infradead.org Git - users/jedix/linux-maple.git/commit
thermal: core: Consolidate thermal zone locking in the exit path
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 4 Oct 2024 19:30:26 +0000 (21:30 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 22 Oct 2024 10:07:40 +0000 (12:07 +0200)
commitfa4f9c967969cb04f9a37d567ecd9e1db9e9098f
tree2aefb33006c18bc591d9c0e2ab61ba63c9f77d09
parent1dae3e70b473adc32f81ca1be926440f9b1de9dc
thermal: core: Consolidate thermal zone locking in the exit path

In analogy with a previous change in the thermal zone initialization
path, to avoid acquiring the thermal zone lock and releasing it multiple
times back and forth unnecessarily, move all of the code running under
thermal_list_lock in thermal_zone_device_unregister() into a new
function called thermal_zone_exit() and make the latter acquire the
thermal zone lock only once and release it along with thermal_list_lock.

For this purpose, provide an "unlocked" variant of
thermal_zone_cdev_unbind() to be called by thermal_zone_exit() under the
thermal zone lock.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/1963152.taCxCBeP46@rjwysocki.net
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
drivers/thermal/thermal_core.c