]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
thermal: core: Move thermal zone locking out of bind/unbind functions
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 19 Aug 2024 15:58:27 +0000 (17:58 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 22 Aug 2024 15:43:14 +0000 (17:43 +0200)
commitd48005511a5496defa8ff6828ce9fdd1fb4dcd86
treee7556bfd4a779ec999091bd4d3236dfdb865430e
parent0a0a40d71cf5f51123292982efde38f4b111aee9
thermal: core: Move thermal zone locking out of bind/unbind functions

Since thermal_bind_cdev_to_trip() and thermal_unbind_cdev_from_trip()
acquire the thermal zone lock, the locking rules for their callers get
complicated.  In particular, the thermal zone lock cannot be acquired
in any code path leading to one of these functions even though it might
be useful to do so.

To address this, remove the thermal zone locking from both these
functions, add lockdep assertions for the thermal zone lock to both
of them and make their callers acquire the thermal zone lock instead.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://patch.msgid.link/3837835.kQq0lBPeGt@rjwysocki.net
drivers/acpi/thermal.c
drivers/thermal/thermal_core.c