From: Yicong Yang Date: Tue, 10 Oct 2023 08:47:30 +0000 (+0800) Subject: hwtracing: hisi_ptt: Don't try to attach a task X-Git-Tag: v6.6.14~706 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bade0c1e7569f8efc9cfa1b29112f41e89e13835;p=platform%2Fkernel%2Flinux-starfive.git hwtracing: hisi_ptt: Don't try to attach a task [ Upstream commit aff787f64ad7cbb54614b51b82c682fe06411ef3 ] 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 Acked-by: Jonathan Cameron Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20231010084731.30450-5-yangyicong@huawei.com Signed-off-by: Sasha Levin --- diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c index dbed4fd..a991ecb 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;