]> www.infradead.org Git - users/jedix/linux-maple.git/commit
coresight: change coresight_device lock type to raw_spinlock_t
authorYeoreum Yun <yeoreum.yun@arm.com>
Thu, 6 Mar 2025 12:11:02 +0000 (12:11 +0000)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Mon, 10 Mar 2025 10:40:25 +0000 (10:40 +0000)
commit26f060c106f630e34876c096c1c8997a9e68c371
treea6c482daa836a5a064327db3faa8308b3a739be9
parentab37128ad5ed872e10048fd83f1dd59a9067fc68
coresight: change coresight_device lock type to raw_spinlock_t

coresight_device->cscfg_csdev_lock can be held during __schedule()
by perf_event_task_sched_out()/in().

Since coresight->cscfg_csdev_lock 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 of coresight_device->cscfg_csdev_lock
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-2-yeoreum.yun@arm.com
drivers/hwtracing/coresight/coresight-syscfg.c
include/linux/coresight.h