summaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-08-19 17:58:27 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-08-22 17:43:14 +0200
commitd48005511a5496defa8ff6828ce9fdd1fb4dcd86 (patch)
treee7556bfd4a779ec999091bd4d3236dfdb865430e /drivers/acpi
parentthermal: sysfs: Use the dev argument in instance-related show/store (diff)
downloadlinux-d48005511a5496defa8ff6828ce9fdd1fb4dcd86.tar.xz
linux-d48005511a5496defa8ff6828ce9fdd1fb4dcd86.zip
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
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/thermal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index a0cfc857fb55..852d62a8014a 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -609,7 +609,7 @@ static int acpi_thermal_bind_unbind_cdev(struct thermal_zone_device *thermal,
.thermal = thermal, .cdev = cdev, .bind = bind
};
- return for_each_thermal_trip(thermal, bind_unbind_cdev_cb, &bd);
+ return thermal_zone_for_each_trip(thermal, bind_unbind_cdev_cb, &bd);
}
static int