From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 465ECC4332F for ; Fri, 3 Nov 2023 11:37:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233433AbjKCLhc (ORCPT ); Fri, 3 Nov 2023 07:37:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233073AbjKCLhb (ORCPT ); Fri, 3 Nov 2023 07:37:31 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A330C134 for ; Fri, 3 Nov 2023 04:37:28 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1EADDC15; Fri, 3 Nov 2023 04:38:11 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.37.92]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 14DC53F703; Fri, 3 Nov 2023 04:37:26 -0700 (PDT) Date: Fri, 3 Nov 2023 11:37:21 +0000 From: Mark Rutland To: Ilkka Koskinen , Will Deacon Cc: Besar Wicaksono , Suzuki K Poulose , Robin Murphy , Raag Jadav , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf: arm_cspmu: Reject events meant for other PMUs Message-ID: References: <20231103001654.35565-1-ilkka@os.amperecomputing.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231103001654.35565-1-ilkka@os.amperecomputing.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 02, 2023 at 05:16:54PM -0700, Ilkka Koskinen wrote: > Coresight PMU driver didn't reject events meant for other PMUs. > This caused some of the Core PMU events disappearing from > the output of "perf list". In addition, trying to run e.g. > > $ perf stat -e r2 sleep 1 > > made Coresight PMU driver to handle the event instead of letting > Core PMU driver to deal with it. > > Cc: stable@vger.kernel.org > Fixes: e37dfd65731d ("perf: arm_cspmu: Add support for ARM CoreSight PMU driver") > Signed-off-by: Ilkka Koskinen Acked-by: Mark Rutland Will, are you happy to pick this up? Mark. > --- > drivers/perf/arm_cspmu/arm_cspmu.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/arm_cspmu.c > index 42b72042f6b3..2cc35dded007 100644 > --- a/drivers/perf/arm_cspmu/arm_cspmu.c > +++ b/drivers/perf/arm_cspmu/arm_cspmu.c > @@ -676,6 +676,9 @@ static int arm_cspmu_event_init(struct perf_event *event) > > cspmu = to_arm_cspmu(event->pmu); > > + if (event->attr.type != event->pmu->type) > + return -ENOENT; > + > /* > * Following other "uncore" PMUs, we do not support sampling mode or > * attach to a task (per-process mode). > -- > 2.40.1 >