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: change the sink_ops to accept coresight_path

Update the sink_enable functions to accept coresight_path instead of
a generic void *data, as coresight_path encapsulates all the necessary
data required by devices along the path.

Tested-by: Carl Worth <carl@os.amperecomputing.com>
Reviewed-by: Carl Worth <carl@os.amperecomputing.com>
Reviewed-by: Leo Yan <leo.yan@arm.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-3-edd8a07c1646@oss.qualcomm.com

authored by

Jie Gan and committed by
Suzuki K Poulose
b139702a 94baedb5

+34 -30
+5 -5
drivers/hwtracing/coresight/coresight-core.c
··· 300 300 EXPORT_SYMBOL_GPL(coresight_add_helper); 301 301 302 302 static int coresight_enable_sink(struct coresight_device *csdev, 303 - enum cs_mode mode, void *data) 303 + enum cs_mode mode, 304 + struct coresight_path *path) 304 305 { 305 - return sink_ops(csdev)->enable(csdev, mode, data); 306 + return sink_ops(csdev)->enable(csdev, mode, path); 306 307 } 307 308 308 309 static void coresight_disable_sink(struct coresight_device *csdev) ··· 502 501 return 0; 503 502 } 504 503 505 - int coresight_enable_path(struct coresight_path *path, enum cs_mode mode, 506 - void *sink_data) 504 + int coresight_enable_path(struct coresight_path *path, enum cs_mode mode) 507 505 { 508 506 int ret = 0; 509 507 u32 type; ··· 532 532 533 533 switch (type) { 534 534 case CORESIGHT_DEV_TYPE_SINK: 535 - ret = coresight_enable_sink(csdev, mode, sink_data); 535 + ret = coresight_enable_sink(csdev, mode, path); 536 536 /* 537 537 * Sink is the first component turned on. If we 538 538 * failed to enable the sink, there are no components
+1 -1
drivers/hwtracing/coresight/coresight-dummy.c
··· 52 52 } 53 53 54 54 static int dummy_sink_enable(struct coresight_device *csdev, enum cs_mode mode, 55 - void *data) 55 + struct coresight_path *path) 56 56 { 57 57 dev_dbg(csdev->dev.parent, "Dummy sink enabled\n"); 58 58
+4 -4
drivers/hwtracing/coresight/coresight-etb10.c
··· 167 167 return ret; 168 168 } 169 169 170 - static int etb_enable_perf(struct coresight_device *csdev, void *data) 170 + static int etb_enable_perf(struct coresight_device *csdev, struct coresight_path *path) 171 171 { 172 172 int ret = 0; 173 173 pid_t pid; 174 174 unsigned long flags; 175 175 struct etb_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); 176 - struct perf_output_handle *handle = data; 176 + struct perf_output_handle *handle = path->handle; 177 177 struct cs_buffers *buf = etm_perf_sink_config(handle); 178 178 179 179 raw_spin_lock_irqsave(&drvdata->spinlock, flags); ··· 224 224 } 225 225 226 226 static int etb_enable(struct coresight_device *csdev, enum cs_mode mode, 227 - void *data) 227 + struct coresight_path *path) 228 228 { 229 229 int ret; 230 230 ··· 233 233 ret = etb_enable_sysfs(csdev); 234 234 break; 235 235 case CS_MODE_PERF: 236 - ret = etb_enable_perf(csdev, data); 236 + ret = etb_enable_perf(csdev, path); 237 237 break; 238 238 default: 239 239 ret = -EINVAL;
+1 -1
drivers/hwtracing/coresight/coresight-etm-perf.c
··· 527 527 goto fail_end_stop; 528 528 529 529 /* Nothing will happen without a path */ 530 - if (coresight_enable_path(path, CS_MODE_PERF, handle)) 530 + if (coresight_enable_path(path, CS_MODE_PERF)) 531 531 goto fail_end_stop; 532 532 533 533 /* Finally enable the tracer */
+1 -2
drivers/hwtracing/coresight/coresight-priv.h
··· 135 135 } 136 136 137 137 void coresight_disable_path(struct coresight_path *path); 138 - int coresight_enable_path(struct coresight_path *path, enum cs_mode mode, 139 - void *sink_data); 138 + int coresight_enable_path(struct coresight_path *path, enum cs_mode mode); 140 139 struct coresight_device *coresight_get_sink(struct coresight_path *path); 141 140 struct coresight_device *coresight_get_sink_by_id(u32 id); 142 141 struct coresight_device *
+1 -1
drivers/hwtracing/coresight/coresight-sysfs.c
··· 215 215 if (!IS_VALID_CS_TRACE_ID(path->trace_id)) 216 216 goto err_path; 217 217 218 - ret = coresight_enable_path(path, CS_MODE_SYSFS, NULL); 218 + ret = coresight_enable_path(path, CS_MODE_SYSFS); 219 219 if (ret) 220 220 goto err_path; 221 221
+6 -4
drivers/hwtracing/coresight/coresight-tmc-etf.c
··· 246 246 return ret; 247 247 } 248 248 249 - static int tmc_enable_etf_sink_perf(struct coresight_device *csdev, void *data) 249 + static int tmc_enable_etf_sink_perf(struct coresight_device *csdev, 250 + struct coresight_path *path) 250 251 { 251 252 int ret = 0; 252 253 pid_t pid; 253 254 unsigned long flags; 254 255 struct tmc_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); 255 - struct perf_output_handle *handle = data; 256 + struct perf_output_handle *handle = path->handle; 256 257 struct cs_buffers *buf = etm_perf_sink_config(handle); 257 258 258 259 raw_spin_lock_irqsave(&drvdata->spinlock, flags); ··· 305 304 } 306 305 307 306 static int tmc_enable_etf_sink(struct coresight_device *csdev, 308 - enum cs_mode mode, void *data) 307 + enum cs_mode mode, 308 + struct coresight_path *path) 309 309 { 310 310 int ret; 311 311 ··· 315 313 ret = tmc_enable_etf_sink_sysfs(csdev); 316 314 break; 317 315 case CS_MODE_PERF: 318 - ret = tmc_enable_etf_sink_perf(csdev, data); 316 + ret = tmc_enable_etf_sink_perf(csdev, path); 319 317 break; 320 318 /* We shouldn't be here */ 321 319 default:
+6 -4
drivers/hwtracing/coresight/coresight-tmc-etr.c
··· 1733 1733 return size; 1734 1734 } 1735 1735 1736 - static int tmc_enable_etr_sink_perf(struct coresight_device *csdev, void *data) 1736 + static int tmc_enable_etr_sink_perf(struct coresight_device *csdev, 1737 + struct coresight_path *path) 1737 1738 { 1738 1739 int rc = 0; 1739 1740 pid_t pid; 1740 1741 unsigned long flags; 1741 1742 struct tmc_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); 1742 - struct perf_output_handle *handle = data; 1743 + struct perf_output_handle *handle = path->handle; 1743 1744 struct etr_perf_buffer *etr_perf = etm_perf_sink_config(handle); 1744 1745 1745 1746 raw_spin_lock_irqsave(&drvdata->spinlock, flags); ··· 1788 1787 } 1789 1788 1790 1789 static int tmc_enable_etr_sink(struct coresight_device *csdev, 1791 - enum cs_mode mode, void *data) 1790 + enum cs_mode mode, 1791 + struct coresight_path *path) 1792 1792 { 1793 1793 switch (mode) { 1794 1794 case CS_MODE_SYSFS: 1795 1795 return tmc_enable_etr_sink_sysfs(csdev); 1796 1796 case CS_MODE_PERF: 1797 - return tmc_enable_etr_sink_perf(csdev, data); 1797 + return tmc_enable_etr_sink_perf(csdev, path); 1798 1798 default: 1799 1799 return -EINVAL; 1800 1800 }
+1 -1
drivers/hwtracing/coresight/coresight-tpiu.c
··· 75 75 } 76 76 77 77 static int tpiu_enable(struct coresight_device *csdev, enum cs_mode mode, 78 - void *__unused) 78 + struct coresight_path *path) 79 79 { 80 80 struct tpiu_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); 81 81
+2 -2
drivers/hwtracing/coresight/coresight-trbe.c
··· 1013 1013 } 1014 1014 1015 1015 static int arm_trbe_enable(struct coresight_device *csdev, enum cs_mode mode, 1016 - void *data) 1016 + struct coresight_path *path) 1017 1017 { 1018 1018 struct trbe_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); 1019 1019 struct trbe_cpudata *cpudata = dev_get_drvdata(&csdev->dev); 1020 - struct perf_output_handle *handle = data; 1020 + struct perf_output_handle *handle = path->handle; 1021 1021 struct trbe_buf *buf = etm_perf_sink_config(handle); 1022 1022 1023 1023 WARN_ON(cpudata->cpu != smp_processor_id());
+5 -4
drivers/hwtracing/coresight/ultrasoc-smb.c
··· 213 213 coresight_set_mode(csdev, CS_MODE_SYSFS); 214 214 } 215 215 216 - static int smb_enable_perf(struct coresight_device *csdev, void *data) 216 + static int smb_enable_perf(struct coresight_device *csdev, 217 + struct coresight_path *path) 217 218 { 218 219 struct smb_drv_data *drvdata = dev_get_drvdata(csdev->dev.parent); 219 - struct perf_output_handle *handle = data; 220 + struct perf_output_handle *handle = path->handle; 220 221 struct cs_buffers *buf = etm_perf_sink_config(handle); 221 222 pid_t pid; 222 223 ··· 241 240 } 242 241 243 242 static int smb_enable(struct coresight_device *csdev, enum cs_mode mode, 244 - void *data) 243 + struct coresight_path *path) 245 244 { 246 245 struct smb_drv_data *drvdata = dev_get_drvdata(csdev->dev.parent); 247 246 int ret = 0; ··· 262 261 smb_enable_sysfs(csdev); 263 262 break; 264 263 case CS_MODE_PERF: 265 - ret = smb_enable_perf(csdev, data); 264 + ret = smb_enable_perf(csdev, path); 266 265 break; 267 266 default: 268 267 ret = -EINVAL;
+1 -1
include/linux/coresight.h
··· 367 367 */ 368 368 struct coresight_ops_sink { 369 369 int (*enable)(struct coresight_device *csdev, enum cs_mode mode, 370 - void *data); 370 + struct coresight_path *path); 371 371 int (*disable)(struct coresight_device *csdev); 372 372 void *(*alloc_buffer)(struct coresight_device *csdev, 373 373 struct perf_event *event, void **pages,