Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

coresight: Only register perf symlink for sinks with alloc_buffer

Ensure that etm_perf_add_symlink_sink() is only called for devices
that implement the alloc_buffer operation. This prevents invalid
symlink creation for dummy sinks that do not implement alloc_buffer.

Without this check, perf may attempt to use a dummy sink that lacks
alloc_buffer operationsu to initialise perf's ring buffer, leading
to runtime failures.

Fixes: 9d3ba0b6c0569 ("Coresight: Add coresight dummy driver")
Signed-off-by: Yuanfang Zhang <quic_yuanfang@quicinc.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20250630-etm_perf_sink-v1-1-e4a7211f9ad7@quicinc.com

authored by

Yuanfang Zhang and committed by
Suzuki K Poulose
12d9a9dd 08d24e07

+3 -2
+3 -2
drivers/hwtracing/coresight/coresight-core.c
··· 1375 1375 goto out_unlock; 1376 1376 } 1377 1377 1378 - if (csdev->type == CORESIGHT_DEV_TYPE_SINK || 1379 - csdev->type == CORESIGHT_DEV_TYPE_LINKSINK) { 1378 + if ((csdev->type == CORESIGHT_DEV_TYPE_SINK || 1379 + csdev->type == CORESIGHT_DEV_TYPE_LINKSINK) && 1380 + sink_ops(csdev)->alloc_buffer) { 1380 1381 ret = etm_perf_add_symlink_sink(csdev); 1381 1382 1382 1383 if (ret) {