On Wed, Jul 02, 2025 at 11:18:21AM +0100, Yeoreum Yun wrote:
Hi Leo,
[...]
@@ -464,17 +477,29 @@ static int etm_enable_perf(struct coresight_device *csdev, struct perf_event *event, struct coresight_path *path) {
- int ret = 0; struct etm_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
- if (WARN_ON_ONCE(drvdata->cpu != smp_processor_id()))
return -EINVAL;
- if (!coresight_take_mode(csdev, CS_MODE_PERF))
return -EBUSY;
- if (WARN_ON_ONCE(drvdata->cpu != smp_processor_id())) {
ret = -EINVAL;
goto out;
- }
Small question: why drvdata->cpu != smp_processor_id() check after changing mode? Would it better to check before change of it?
You are right. I will update in next version.
Thanks for pointing out this!
Leo