From patchwork Tue Oct 22 14:52:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yicong Yang X-Patchwork-Id: 13845793 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 D75F1D2C567 for ; Tue, 22 Oct 2024 14:56:58 +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=mPkE67pg5A1BHt6Phm3a+Tqe5/CTXDflTaTNliSLhw0=; b=hbWujYFhNSlJMI37VhkhpUIJ14 WmnEaigWZhVS1HYPnCh9kJUwxqTLmksxGRjwvgzeJydTJv+B7j+T4yIoJwgmB6l4ym21fkYOaNC58 3OYJmuZVohqZUmJ7eYqBibCW3wiA77kqVSSEV1ikg8viZrctJjRTkEgeyrVqGfrjfgPpwWokKs77i w5HyfeN2/Ghutrtw5Es0JjSlkQ7D4TrdunpIXKCW8hTT7DRpf6wBdQoMkt2CcLMZceqLZxTuwRUvq HuN3nmoebgYyAON8XO4+wTmz5oZtVKP1O5rUJjWrW3m65ro0DnVEGvxKojM5gEkg8nuKCZ1Nd7Fgc VC8PPVxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3GJS-0000000BBCt-27P9; Tue, 22 Oct 2024 14:56:46 +0000 Received: from szxga03-in.huawei.com ([45.249.212.189]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3GGT-0000000BAt5-0Rfx for linux-arm-kernel@lists.infradead.org; Tue, 22 Oct 2024 14:53:43 +0000 Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4XXwBr2dPQzQs31; Tue, 22 Oct 2024 22:52:36 +0800 (CST) Received: from kwepemd200014.china.huawei.com (unknown [7.221.188.8]) by mail.maildlp.com (Postfix) with ESMTPS id 6CB63180064; Tue, 22 Oct 2024 22:53:27 +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; Tue, 22 Oct 2024 22:53:26 +0800 From: Yicong Yang To: , , , CC: , , , , Subject: [PATCH v2 0/8] Refactor the common parts to the HiSilicon Uncore PMU core and cleanups Date: Tue, 22 Oct 2024 22:52:57 +0800 Message-ID: <20241022145305.47056-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: dggems705-chm.china.huawei.com (10.3.19.182) 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-20241022_075341_428255_E545A65E X-CRM114-Status: GOOD ( 10.31 ) 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 - provides a generic implementation of cpumask/identifier attributes 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 Changes since v1: Address Jonathan's comments and add tags for some patches - Provide a generic cpumask/identifier attribute group - refine the comments/commit as suggested Link: https://lore.kernel.org/linux-arm-kernel/20241018095745.57057-1-yangyicong@huawei.com/ 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: Provide a generic implementation of cpumask/identifier 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 | 42 +--- drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c | 61 ++---- drivers/perf/hisilicon/hisi_uncore_hha_pmu.c | 49 ++--- drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c | 44 ++--- drivers/perf/hisilicon/hisi_uncore_pa_pmu.c | 53 ++--- drivers/perf/hisilicon/hisi_uncore_pmu.c | 182 ++++++++++++++---- drivers/perf/hisilicon/hisi_uncore_pmu.h | 48 ++++- drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c | 43 +---- drivers/perf/hisilicon/hisi_uncore_uc_pmu.c | 45 ++--- 10 files changed, 270 insertions(+), 302 deletions(-)