diff options
author | Daniel Lezcano <[email protected]> | 2024-10-24 12:23:03 +0200 |
---|---|---|
committer | Rafael J. Wysocki <[email protected]> | 2024-10-24 15:00:18 +0200 |
commit | 54219ee4eaeb356e0c8e0a6609dc6b5c21e2170a (patch) | |
tree | 7299c06813f5808904f004b1925b3551d77f1582 /tools/perf/scripts/python/parallel-perf.py | |
parent | 41b89dba7c5dd0a071c52aa2f8c87c507e30dfbe (diff) |
thermal: thresholds: Fix thermal lock annotation issue
When the thermal zone is unregistered (thermal sensor module being
unloaded), no lock is held when flushing the thresholds. That results
in a WARN when the lockdep validation is set in the kernel config.
This has been reported by syzbot.
As the thermal zone is in the process of being destroyed, there is no
need to send a notification about purging the thresholds to the
userspace as this one will receive a thermal zone deletion
notification which imply the deletion of all the associated resources
like the trip points or the user thresholds.
Split the function thermal_thresholds_flush() into a lockless one
without notification and its call with the lock annotation followed
with the thresholds flushing notification.
Please note this scenario is unlikely to happen, as the sensor drivers
are usually compiled-in in order to have the thermal framework to be
able to kick in at boot time if needed.
Fixes: 445936f9e258 ("thermal: core: Add user thresholds support")
Link: https://lore.kernel.org/all/[email protected]
Reported-by: [email protected]
Signed-off-by: Daniel Lezcano <[email protected]>
Link: https://patch.msgid.link/[email protected]
[ rjw: Subject edit, added Fixes tag ]
Signed-off-by: Rafael J. Wysocki <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/parallel-perf.py')
0 files changed, 0 insertions, 0 deletions