From patchwork Fri Oct 18 09:57:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yicong Yang X-Patchwork-Id: 13841504 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 EF63BD2FFE0 for ; Fri, 18 Oct 2024 10:08:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding: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=ilQUiObN56ykazzpYC4sBSD2NF3ktMYkwdNMsdkztjw=; b=K4XLjiBVgMd6mXRLhjZJ2MutiK P7MJZSuUnZmbFlP3pLwwOgxM+NVpqNc1ysdx4+RMsMqSMhD9ByxtkoFuom0IeaAzke0uyjIEHEIJS 1JUBrumEV2BFbxyWqHNWuI+ecmOcVDiOFcoyS4rRPX4YffOiVATXcojZcy6lUvvfjFFxgz3uVmH66 3/Zhf26QwwGVCrksUw4OqfwAwqv2x2HaU/AzsejE6yxGlzPY82RGTAEtNeU8bRuXvTmD01XtEUAdN eOiY8KNCGs01elmVvJEtFRL9WqPhtS8O6NBEVda2C+eLTWYvcCnG6uFRklNbaSzbOnJoYYouLdNgi bWjIBRjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1jtz-00000000IrI-3MRB; Fri, 18 Oct 2024 10:08:11 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1jkM-00000000Gnc-3hxy for linux-arm-kernel@lists.infradead.org; Fri, 18 Oct 2024 09:58:16 +0000 Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4XVKp030qRzfd6g; Fri, 18 Oct 2024 17:55:36 +0800 (CST) Received: from kwepemd200014.china.huawei.com (unknown [7.221.188.8]) by mail.maildlp.com (Postfix) with ESMTPS id 63B031400DC; Fri, 18 Oct 2024 17:58:04 +0800 (CST) Received: from localhost.localdomain (10.50.165.33) by kwepemd200014.china.huawei.com (7.221.188.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Fri, 18 Oct 2024 17:58:03 +0800 From: Yicong Yang To: , , , CC: , , , , Subject: [PATCH 0/8] Refactor the common parts to the HiSilicon Uncore PMU core and cleanups Date: Fri, 18 Oct 2024 17:57:37 +0800 Message-ID: <20241018095745.57057-1-yangyicong@huawei.com> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 X-Originating-IP: [10.50.165.33] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemd200014.china.huawei.com (7.221.188.8) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241018_025815_221682_15A0B3A0 X-CRM114-Status: UNSURE ( 8.67 ) 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 From: Yicong Yang This series mainly contains the refactor of the HiSilicon Uncore PMU by extracting the common parts from each drivers into the core: - the retrieving of the PMU topology ID - the common sysfs attributes like cpumask and identifier In order to achieve this, we need to do below preparation: - improve the detection of associated CPUs for PMUs locates on a SICL - maintain the topology information in a dedicated data structure Besides also include below changes/cleanups in this patchset - add one new sysfs attributes for better describing the topology information of the associated CPUs of the PMU. - define a symbol namespace for HiSilicon Uncore PMUs to avoid pollute the common ones - two minor nonfunctional cleanups of DDRC PMU Junhao He (2): drivers/perf: hisi: Fix incorrect variable name "hha_pmu" in DDRC PMU driver drivers/perf: hisi: Delete redundant blank line of DDRC PMU Yicong Yang (6): drivers/perf: hisi: Define a symbol namespace for HiSilicon Uncore PMUs drivers/perf: hisi: Improve the detection of associated CPUs drivers/perf: hisi: Extract topology information to a separate structure drivers/perf: hisi: Add a common function to retrieve topology from firmware drivers/perf: hisi: Refactor the attributes creation drivers/perf: hisi: Export associated CPUs of each PMU through sysfs Documentation/admin-guide/perf/hisi-pmu.rst | 5 +- drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c | 55 ++---- drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c | 82 +++----- drivers/perf/hisilicon/hisi_uncore_hha_pmu.c | 71 +++---- drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c | 65 ++----- drivers/perf/hisilicon/hisi_uncore_pa_pmu.c | 54 ++---- drivers/perf/hisilicon/hisi_uncore_pmu.c | 182 ++++++++++++++---- drivers/perf/hisilicon/hisi_uncore_pmu.h | 60 +++++- drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c | 54 ++---- drivers/perf/hisilicon/hisi_uncore_uc_pmu.c | 56 ++---- 10 files changed, 323 insertions(+), 361 deletions(-)