]> www.infradead.org Git - users/willy/xarray.git/commit
coresight-tmc: change tmc_drvdata spinlock's type to raw_spinlock_t
authorYeoreum Yun <yeoreum.yun@arm.com>
Thu, 6 Mar 2025 12:11:09 +0000 (12:11 +0000)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Mon, 10 Mar 2025 10:40:26 +0000 (10:40 +0000)
commitdb11f75bc29c843a70d4af1921f05d50fc72f49b
tree28a638d83abcc78fd1370998f9e9c710c59f6898
parent982d0a0e08db46865cfbb901444b192c528fc741
coresight-tmc: change tmc_drvdata spinlock's type to raw_spinlock_t

In coresight-tmc drivers, tmc_drvdata->spinlock can be held
during __schedule() by perf_event_task_sched_out()/in().

Since tmc_drvdata->spinlock type is spinlock_t and
perf_event_task_sched_out()/in() is called after acquiring rq_lock,
which is raw_spinlock_t (an unsleepable lock),
this poses an issue in PREEMPT_RT kernel where spinlock_t is sleepable.

To address this, change type tmc_drvdata->spinlock in coresight-tmc drivers,
which can be called by perf_event_task_sched_out()/in(),
from spinlock_t to raw_spinlock_t.

Reviewed-by: James Clark <james.clark@linaro.org>
Reviewed-by: Mike Leach <mike.leach@linaro.org>
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20250306121110.1647948-9-yeoreum.yun@arm.com
drivers/hwtracing/coresight/coresight-tmc-core.c
drivers/hwtracing/coresight/coresight-tmc-etf.c
drivers/hwtracing/coresight/coresight-tmc-etr.c
drivers/hwtracing/coresight/coresight-tmc.h