Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5FF64776B for ; Mon, 11 Dec 2023 13:55:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ezvVzsfu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3689C433C8; Mon, 11 Dec 2023 13:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702302901; bh=Ja4ysBk+qOJJjbCUYxecDH7RVIe4PJVDRV25A70QhEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ezvVzsfuETHF+5WmhkWpJfpwNLxx2Pdzi5BPtt5z8P/21vIHJGUv+DX2a62awrtdO Bmen1xi/CSRBLUr8IyNOqLoiPypeIBCfU9v1ymM3H9FlWWtbtG8CIsX5CHN57Rp4QT xnQpVa52uhbreVB1BRmJ6soBuHxxkvK/16gfzpw+IpOQ5Sx8r6K460q5dwEf95OsWT gkCfJHG75IY4+5JhxAye+luBcArCnU5H0pSUWuHid6i1HBVBTO/Wr+9QT4xYEUgw5f lRQQ2KCfAk9v3X8XhhEtN2BV0zuHx+ia+RyYFz7DwrEfHj+7U1d2zr+sjMDE5nRS7t qgPxc1e8d0lzw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Yicong Yang , Jonathan Cameron , Suzuki K Poulose , Sasha Levin , jonathan.cameron@huawei.com, alexander.shishkin@linux.intel.com Subject: [PATCH AUTOSEL 6.1 02/29] hwtracing: hisi_ptt: Don't try to attach a task Date: Mon, 11 Dec 2023 08:53:46 -0500 Message-ID: <20231211135457.381397-2-sashal@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231211135457.381397-1-sashal@kernel.org> References: <20231211135457.381397-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.66 Content-Transfer-Encoding: 8bit From: Yicong Yang [ 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 --- 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 75a8f24fdafee..0a7190f2ba01d 100644 --- a/drivers/hwtracing/ptt/hisi_ptt.c +++ b/drivers/hwtracing/ptt/hisi_ptt.c @@ -659,6 +659,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.42.0