From patchwork Thu Dec 21 09:38:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?WWFuZyBKaWFsb25nIOadqOS9s+m+mQ==?= X-Patchwork-Id: 13501532 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 CA870C35274 for ; Thu, 21 Dec 2023 09:39:15 +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=7X9YP0jKiHhnomb0RPVRK33GwmC6YMqprj0KgkMcfxg=; b=CfDsSQXvwWX8+l 5gjOvcc7ssiYigJyGQEcnqt5Dw7e6f1HNe/Zi4aagr2RaYQT+VuCieioUZ29vd4vL52p63wKoM28k sz6mHf8faQJZnfQZUsqmKoqI9FFcl7Q6cEFycWcdl5Tf4IiJ/sWmof7GdjiPkIBnM/XB/QbF3Qjmt UQveXVyDtqtm7RCJRa/KPXmZY879myD5p+9J2rhnMg7CCYQ8QrCqMEXq5tHhQzJbzRncXvgkxmblB 1NVbrcNWQ+grXaQ3cZd4VJ9gZCYkcWdeq3+NyQEw1FjaHL2PD+SnJgkumZhBYz5oqfq6qapYqSsKu MXdNguL8ucCKk3IFMrjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rGFVu-002JYC-18; Thu, 21 Dec 2023 09:38:46 +0000 Received: from smtpbgsg2.qq.com ([54.254.200.128]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rGFVq-002JTq-1w for linux-arm-kernel@lists.infradead.org; Thu, 21 Dec 2023 09:38:44 +0000 X-QQ-mid: bizesmtp90t1703151503t28eopg7 Received: from HX01040022.powercore.com.cn ( [223.112.234.130]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 21 Dec 2023 17:38:21 +0800 (CST) X-QQ-SSF: 01400000000000B0B000000A0000000 X-QQ-FEAT: +ynUkgUhZJnjMoY4gOOx27e0bd5FjgOXH7xQMXerutlnj6SyN+ZyFlxFHokp/ b+Z/WaNSkU7Nawdh3Dx3auVcz3fXEJDb3Ye37GaLRPm3qU4yQYJA/9n4hPdYZR90NJXuS7n Tjww8M7lMdbqKmxiCpOZ8/Ld+MbJSWhJ5X7M3xa5QsllHEw0pa/pNp4NUtrsxf7z8h/RHov Mn6Jeg8p4gwdDZ3STEnXmp0PIBjB7OHPrXJkQMf7V8kg9wskjJAt6D67tKgUQVSerSvLGXK yl7/Qsr/9FvWOZ2VoUDEOjyLXJX6EX8nv3ug+TjSrMtFgHvBpzzKJR/lfC4jY8gVrnDwuvq +KfivO6I/Y3Nn/O4oR/Ji42Ah/jGu+ZRBU9RUz8d0+hsGgSG2qrtankkq3W0ZutS0RNTgEb yiJTxRoJ/Gw= X-QQ-GoodBg: 2 X-BIZMAIL-ID: 12415120465097514307 From: "JiaLong.Yang" To: Will Deacon , Mark Rutland Cc: shenghui.qu@shingroup.cn, ke.zhao@shingroup.cn, zhijie.ren@shingroup.cn, "JiaLong.Yang" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] perf/arm_smmuv3: Omit the two judgements which done in framework Date: Thu, 21 Dec 2023 17:38:01 +0800 Message-Id: <20231221093802.20612-1-jialong.yang@shingroup.cn> MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:shingroup.cn:qybglogicsvrgz:qybglogicsvrgz6a-1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231221_013843_039957_4362541B X-CRM114-Status: UNSURE ( 8.20 ) 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 'event->attr.type != event->pmu->type' has been done in core.c::perf_init_event() ,core.c::perf_event_modify_attr(), etc. This PMU is an uncore one. The core framework has disallowed uncore-task events. So the judgement to event->cpu < 0 is no mean. The two judgements have been done in kernel/events/core.c Signed-off-by: JiaLong.Yang --- drivers/perf/arm_smmuv3_pmu.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c index 6303b82566f9..8ea4a3227165 100644 --- a/drivers/perf/arm_smmuv3_pmu.c +++ b/drivers/perf/arm_smmuv3_pmu.c @@ -401,19 +401,11 @@ static int smmu_pmu_event_init(struct perf_event *event) int group_num_events = 1; u16 event_id; - if (event->attr.type != event->pmu->type) - return -ENOENT; - if (hwc->sample_period) { dev_dbg(dev, "Sampling not supported\n"); return -EOPNOTSUPP; } - if (event->cpu < 0) { - dev_dbg(dev, "Per-task mode not supported\n"); - return -EOPNOTSUPP; - } - /* Verify specified event is supported on this PMU */ event_id = get_event(event); if (event_id < SMMU_PMCG_ARCH_MAX_EVENTS &&