All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yicong Yang <yangyicong@huawei.com>
To: <suzuki.poulose@arm.com>, <mathieu.poirier@linaro.org>,
	<jonathan.cameron@huawei.com>, <linux-kernel@vger.kernel.org>
Cc: <alexander.shishkin@linux.intel.com>, <helgaas@kernel.org>,
	<linux-pci@vger.kernel.org>, <prime.zeng@hisilicon.com>,
	<linuxarm@huawei.com>, <yangyicong@hisilicon.com>,
	<hejunhao3@huawei.com>
Subject: [PATCH v3 4/5] hwtracing: hisi_ptt: Don't try to attach a task
Date: Tue, 10 Oct 2023 16:47:30 +0800	[thread overview]
Message-ID: <20231010084731.30450-5-yangyicong@huawei.com> (raw)
In-Reply-To: <20231010084731.30450-1-yangyicong@huawei.com>

From: Yicong Yang <yangyicong@hisilicon.com>

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>
---
 drivers/hwtracing/ptt/hisi_ptt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c
index 4f355df8da23..62a444f5228e 100644
--- a/drivers/hwtracing/ptt/hisi_ptt.c
+++ b/drivers/hwtracing/ptt/hisi_ptt.c
@@ -1003,6 +1003,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;
 
-- 
2.24.0


  parent reply	other threads:[~2023-10-10  8:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10  8:47 [PATCH v3 0/5] Several updates for PTT driver Yicong Yang
2023-10-10  8:47 ` [PATCH v3 1/5] hwtracing: hisi_ptt: Disable interrupt after trace end Yicong Yang
2023-10-10  8:47 ` [PATCH v3 2/5] hwtracing: hisi_ptt: Handle the interrupt in hardirq context Yicong Yang
2023-10-10  8:47 ` [PATCH v3 3/5] hwtracing: hisi_ptt: Optimize the trace data committing Yicong Yang
2023-10-10  8:47 ` Yicong Yang [this message]
2023-10-10  8:47 ` [PATCH v3 5/5] hwtracing: hisi_ptt: Add dummy callback pmu::read() Yicong Yang
2023-10-17 12:21 ` [PATCH v3 0/5] Several updates for PTT driver Yicong Yang
2023-10-17 17:01 ` Suzuki K Poulose
2023-10-18  9:32   ` Yicong Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231010084731.30450-5-yangyicong@huawei.com \
    --to=yangyicong@huawei.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=hejunhao3@huawei.com \
    --cc=helgaas@kernel.org \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=prime.zeng@hisilicon.com \
    --cc=suzuki.poulose@arm.com \
    --cc=yangyicong@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.