From patchwork Thu Feb 24 18:41:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Murphy X-Patchwork-Id: 12759120 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E1FC5C433EF for ; Thu, 24 Feb 2022 18:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=nGwlwcwJ/gYzV50K8/rZkwNd24KFZFPM1TDG1VHS4Dk=; b=QQdzRgs5izgzN4 rw+k8iFcCm21BHP6e6mqmVKrkSCM6IeLdb8RSvxBRHISr61f2qGu9JRyDStdEuCf44OCWlEczPH2R wBJsUetl/KB3zDzpPnPQxEhjdSq/oBSnfsplnClJwbkBpkEwwaTvzgyJUYBUGZOo9u2vNPvQv2SAH SkJHuNGbRZ1cHEVpsTJHdLYoqVhg9qrfir1aYy47yaHK6owZBmICaDjl28pgK74InEXkHSK956w64 6Ra754tkTPNDl7kzkVlNPTSfjH0ELzQ4b39FuQ9OYMQ8z1q1YYSVaaBZqURS/BDENF+SHQpcIVT2J yt7TB/dk3fMr401OFAeg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNJ3S-0020zn-JU; Thu, 24 Feb 2022 18:41:30 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNJ3P-0020zG-Mf for linux-arm-kernel@lists.infradead.org; Thu, 24 Feb 2022 18:41:29 +0000 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 6FB4A106F; Thu, 24 Feb 2022 10:41:26 -0800 (PST) Received: from e121345-lin.cambridge.arm.com (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D1BC53F70D; Thu, 24 Feb 2022 10:41:25 -0800 (PST) From: Robin Murphy To: will@kernel.org, mark.rutland@arm.com Cc: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] perf/arm-cmn: Hide XP PUB events for CMN-600 Date: Thu, 24 Feb 2022 18:41:21 +0000 Message-Id: <4c108d39a0513def63acccf09ab52b328f242aeb.1645727871.git.robin.murphy@arm.com> X-Mailer: git-send-email 2.28.0.dirty MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220224_104127_824362_FD50B8A6 X-CRM114-Status: UNSURE ( 8.71 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org CMN-600 doesn't have XP events for the PUB channel, but we missed the appropriate check to avoid exposing them. Fixes: 60d1504070c2 ("perf/arm-cmn: Support new IP features") Signed-off-by: Robin Murphy --- drivers/perf/arm-cmn.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c index 93fd2bcfaf05..ba039a2532ad 100644 --- a/drivers/perf/arm-cmn.c +++ b/drivers/perf/arm-cmn.c @@ -595,6 +595,9 @@ static umode_t arm_cmn_event_attr_is_visible(struct kobject *kobj, if ((intf & 4) && !(cmn->ports_used & BIT(intf & 3))) return 0; + if (chan == 4 && cmn->model == CMN600) + return 0; + if ((chan == 5 && cmn->rsp_vc_num < 2) || (chan == 6 && cmn->dat_vc_num < 2)) return 0;