summaryrefslogtreecommitdiff
path: root/drivers/hwtracing/ptt
diff options
context:
space:
mode:
authorYicong Yang <yangyicong@hisilicon.com>2023-10-10 16:47:30 +0800
committerSuzuki K Poulose <suzuki.poulose@arm.com>2023-11-13 09:43:46 +0000
commitaff787f64ad7cbb54614b51b82c682fe06411ef3 (patch)
tree55d286616f299f8f7d7dee84d01869892dedca04 /drivers/hwtracing/ptt
parente0dd27ad8af00f147ac3c9de88e0687986afc3ea (diff)
hwtracing: hisi_ptt: Don't try to attach a task
PTT is an uncore PMU and shouldn't be attached to any task. Block the usage in pmu::event_init(). Signed-off-by: Yicong Yang <yangyicong@hisilicon.com> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Link: https://lore.kernel.org/r/20231010084731.30450-5-yangyicong@huawei.com
Diffstat (limited to 'drivers/hwtracing/ptt')
-rw-r--r--drivers/hwtracing/ptt/hisi_ptt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c
index dbed4fd4e296..a991ecb7515a 100644
--- a/drivers/hwtracing/ptt/hisi_ptt.c
+++ b/drivers/hwtracing/ptt/hisi_ptt.c
@@ -1000,6 +1000,9 @@ static int hisi_ptt_pmu_event_init(struct perf_event *event)
return -EOPNOTSUPP;
}
+ if (event->attach_state & PERF_ATTACH_TASK)
+ return -EOPNOTSUPP;
+
if (event->attr.type != hisi_ptt->hisi_ptt_pmu.type)
return -ENOENT;