summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/task-analyzer.py
diff options
context:
space:
mode:
authorWeigang He <geoffreyhe2@gmail.com>2026-09-26 22:49:31 +1000
committerDaniel Lezcano <daniel.lezcano@kernel.org>2026-10-13 16:26:37 +0200
commitaaa6c8dec49339710f9fd2a2af5646cf4111dbd4 (patch)
tree705931ecc7c6a2189dd4d01bc7bff81902d6e0b4 /tools/perf/scripts/python/task-analyzer.py
parent51c262cf2aa9dfd97591e570d4e82af493ad1689 (diff)
thermal/drivers/ti-soc-thermal: Cancel pending alert work on remove
On a threshold crossing, the talert IRQ handler calls ti_thermal_report_sensor_temperature(), which queues the work embedded in the sensor's ti_thermal_data on the system workqueue. Nothing ever cancels or flushes that work. ti_bandgap_remove() frees the talert IRQ last. free_irq() waits for a running handler, but not for the work the handler has queued. When remove returns, devres unregisters and frees the thermal zones and then frees the devm-allocated ti_thermal_data, so a work item that is still pending runs ti_thermal_work() on freed memory: ti_thermal_work() data = container_of(work, struct ti_thermal_data, thermal_wq); thermal_zone_device_update(data->ti_thermal, ...); Free the talert IRQ before removing the sensors, so that no new work can be queued, and cancel the work in ti_thermal_remove_sensor(). This needs an OMAP4460/4470 or OMAP5 SoC (DRA7 has TALERT but no ->report_temperature, so it never queues the work), a threshold crossing just before the driver is unbound or unloaded, and the work still pending when devres frees the data. Found by static analysis tool CodeQL. Fixes: 445eaf871bf9 ("staging: omap-thermal: common code to expose driver to thermal framework") Assisted-by: LLM codeql Signed-off-by: Weigang He <geoffreyhe2@gmail.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Acked-by: Keerthy <j-keerthy@ti.com> Link: https://patch.msgid.link/20260926124931.3599746-1-geoffreyhe2@gmail.com
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions