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: tmc: add the handle of the event to the path

The handle is essential for retrieving the AUX_EVENT of each CPU and is
required in perf mode. It has been added to the coresight_path so that
dependent devices can access it from the path when needed.

The existing bug can be reproduced with:
perf record -e cs_etm//k -C 0-9 dd if=/dev/zero of=/dev/null

Showing an oops as follows:
Unable to handle kernel paging request at virtual address 000f6e84934ed19e

Call trace:
tmc_etr_get_buffer+0x30/0x80 [coresight_tmc] (P)
catu_enable_hw+0xbc/0x3d0 [coresight_catu]
catu_enable+0x70/0xe0 [coresight_catu]
coresight_enable_path+0xb0/0x258 [coresight]

Fixes: 080ee83cc361 ("Coresight: Change functions to accept the coresight_path")
Signed-off-by: Carl Worth <carl@os.amperecomputing.com>
Reviewed-by: Leo Yan <leo.yan@arm.com>
Co-developed-by: Jie Gan <jie.gan@oss.qualcomm.com>
Signed-off-by: Jie Gan <jie.gan@oss.qualcomm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20250925-fix_helper_data-v2-1-edd8a07c1646@oss.qualcomm.com

authored by

Carl Worth and committed by
Suzuki K Poulose
aaa5abcc aa5edd1b

+9 -5
+1
drivers/hwtracing/coresight/coresight-etm-perf.c
··· 520 520 goto out; 521 521 522 522 path = etm_event_cpu_path(event_data, cpu); 523 + path->handle = handle; 523 524 /* We need a sink, no need to continue without one */ 524 525 sink = coresight_get_sink(path); 525 526 if (WARN_ON_ONCE(!sink))
+2 -1
drivers/hwtracing/coresight/coresight-tmc-etr.c
··· 1334 1334 struct etr_buf *tmc_etr_get_buffer(struct coresight_device *csdev, 1335 1335 enum cs_mode mode, void *data) 1336 1336 { 1337 - struct perf_output_handle *handle = data; 1337 + struct coresight_path *path = data; 1338 + struct perf_output_handle *handle = path->handle; 1338 1339 struct etr_perf_buffer *etr_perf; 1339 1340 1340 1341 switch (mode) {
+6 -4
include/linux/coresight.h
··· 332 332 333 333 /** 334 334 * struct coresight_path - data needed by enable/disable path 335 - * @path_list: path from source to sink. 336 - * @trace_id: trace_id of the whole path. 335 + * @path_list: path from source to sink. 336 + * @trace_id: trace_id of the whole path. 337 + * @handle: handle of the aux_event. 337 338 */ 338 339 struct coresight_path { 339 - struct list_head path_list; 340 - u8 trace_id; 340 + struct list_head path_list; 341 + u8 trace_id; 342 + struct perf_output_handle *handle; 341 343 }; 342 344 343 345 enum cs_mode {