From patchwork Tue Apr 4 13:41:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 1764969 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=iF8oUxQZ; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PrTTw5WnZz1yZQ for ; Tue, 4 Apr 2023 23:42:44 +1000 (AEST) 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=ZIiOqW+a0SgBrmXYtwn5tc4LJqw/55TygudiCI+Nx2I=; b=iF8oUxQZSNXTiu wsfJQ6hhCnx/vllb9BukNEyur5zR/mQgM1nYt94/Kga9PyyeTiOu7ytE2q3wAtIpMx9NUT9yyZ252 MDdr7y0GVoco+uwSULYQStqs7PmgXnl+7dIHrv0e8sv9YktFq7eS9kXS+dSAMsDiMVBx+ChvJSlT5 2eDfgXfhIDBO4xA3xRUCADERtFTjcmPqw7t1M+gt2uwQPHlhjOYV3P1dMjM9yGK80JCVo3qZDs1yw PSMPxTd+YX6rFl/o2kHuc4RVv+5T5TM4OnmmOs2Rb/JE8RkVfYsD2RsXNmP8Hv4KucsMLotJ/VnXg 0p6qHQKBkmmX0scI2J3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pjgve-001Vb7-0l; Tue, 04 Apr 2023 13:42:30 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pjgva-001VY5-1n for linux-arm-kernel@lists.infradead.org; Tue, 04 Apr 2023 13:42:29 +0000 Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4PrTNn3bhJz67mZc; Tue, 4 Apr 2023 21:38:17 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.247.231) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 4 Apr 2023 14:42:15 +0100 From: Jonathan Cameron To: Mark Rutland , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Will Deacon , , , CC: , Dan Williams , Shaokun Zhang , Yicong Yang , Jiucheng Xu , Khuong Dinh , Robert Richter , Atish Patra , Anup Patel , Andy Gross , Bjorn Andersson , Frank Li , Shuai Xue , Vineet Gupta , Shawn Guo , Fenghua Yu , Dave Jiang , Wu Hao , Tom Rix , , Suzuki K Poulose , Liang Kan Subject: [PATCH 00/32] Add parents to struct pmu -> dev Date: Tue, 4 Apr 2023 14:41:53 +0100 Message-ID: <20230404134225.13408-1-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-Originating-IP: [10.122.247.231] X-ClientProxiedBy: lhrpeml500004.china.huawei.com (7.191.163.9) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230404_064226_904307_A2BD3AE2 X-CRM114-Status: GOOD ( 16.35 ) X-Spam-Score: -2.3 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: These are the low hanging fruit following GregKH's feedback that all the devices registered via perf_pmu_register() should have parents. Note that this causes potential ABI breakage. It may fall in the category of it isn't breakage if no one notices but I can't be certain of that. Whilst it is arguable that no one should be been accessing PMUs except via the event_source bus, ther [...] Content analysis details: (-2.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [185.176.79.56 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [185.176.79.56 listed in wl.mailspike.net] 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+incoming-imx=patchwork.ozlabs.org@lists.infradead.org These are the low hanging fruit following GregKH's feedback that all the devices registered via perf_pmu_register() should have parents. Note that this causes potential ABI breakage. It may fall in the category of it isn't breakage if no one notices but I can't be certain of that. Whilst it is arguable that no one should be been accessing PMUs except via the event_source bus, there was documentation suggesting /sys/devices/ for particular PMUs (because it was a shorter path?) The first patch is pulled out of the series: https://lore.kernel.org/linux-cxl/20230327170247.6968-1-Jonathan.Cameron@huawei.com/ [PATCH v3 0/5] CXL 3.0 Performance Monitoring Unit support In that particular case it is very useful to be able to figure out which CXL device the PMU device is associated with and looking at it's parents in the device model as shown with ls -lh /sys/bus/event_sources/devices/ is a very easy way to do this (once it is correctly parented). Addressing all the other instances of struct pmu not covered by this series is likely to be a more complex discussion but unlikely to have an affect on what is proposed here. Documentation updates deliberately 'fixed' in separate patches before changing the path to highlight that using /sys/bus/event_source/devices path is unchanged by this series and that is presumed to be the most common way these files are accessed. Jonathan Cameron (32): perf: Allow a PMU to have a parent perf/hisi-pcie: Assign parent for event_source device Documentation: hisi-pmu: Drop reference to /sys/devices path perf/hisi-uncore: Assign parents for event_source devices Documentation: hns-pmu: Use /sys/bus/event_source/devices paths perf/hisi-hns3: Assign parents for event_source device perf/amlogic: Assign parents for event_source devices perf/arm_cspmu: Assign parents for event_source devices Documentation: xgene-pmu: Use /sys/bus/event_source/devices paths perf/xgene: Assign parents for event_source devices Documentation: thunderx2-pmu: Use /sys/bus/event_source/devices paths perf/thunderx2: Assign parents for event_source devices perf/riscv: Assign parents for event_source devices Documentation: qcom-pmu: Use /sys/bus/event_source/devices paths perf/qcom: Assign parents for event_source devices perf/imx_ddr: Assign parents for event_source devices perf/arm_pmu: Assign parents for event_source devices perf/alibaba_uncore: Assign parents for event_source device perf/arm-cci: Assign parents for event_source device perf/arm-ccn: Assign parents for event_source device perf/arm-cmn: Assign parents for event_source device perf/arm-dmc620: Assign parents for event_source device perf/arm-dsu: Assign parents for event_source device perf/arm-smmuv3: Assign parents for event_source device perf/arm-spe: Assign parents for event_source device arc: Assign parents for event_source devices ARM: imx: Assign parents for mmdc event_source devices dmaengine: idxd: Assign parent for event_source device fpga: dfl: Assign parent for event_source device drivers/nvdimm: Assign parent for event_source device Documentation: ABI + trace: hisi_ptt: update paths to bus/event_source hwtracing: hisi_ptt: Assign parent for event_source device ...i_ptt => sysfs-bus-event_source-devices-hisi_ptt} | 12 ++++++------ Documentation/admin-guide/perf/hisi-pmu.rst | 1 - Documentation/admin-guide/perf/hns3-pmu.rst | 8 ++++---- Documentation/admin-guide/perf/qcom_l2_pmu.rst | 2 +- Documentation/admin-guide/perf/qcom_l3_pmu.rst | 2 +- Documentation/admin-guide/perf/thunderx2-pmu.rst | 2 +- Documentation/admin-guide/perf/xgene-pmu.rst | 2 +- Documentation/trace/hisi-ptt.rst | 4 ++-- MAINTAINERS | 2 +- arch/arc/kernel/perf_event.c | 1 + arch/arm/mach-imx/mmdc.c | 1 + drivers/dma/idxd/perfmon.c | 1 + drivers/fpga/dfl-fme-perf.c | 1 + drivers/hwtracing/ptt/hisi_ptt.c | 1 + drivers/nvdimm/nd_perf.c | 1 + drivers/perf/alibaba_uncore_drw_pmu.c | 1 + drivers/perf/amlogic/meson_ddr_pmu_core.c | 1 + drivers/perf/arm-cci.c | 1 + drivers/perf/arm-ccn.c | 1 + drivers/perf/arm-cmn.c | 1 + drivers/perf/arm_cspmu/arm_cspmu.c | 1 + drivers/perf/arm_dmc620_pmu.c | 1 + drivers/perf/arm_dsu_pmu.c | 1 + drivers/perf/arm_pmu_platform.c | 1 + drivers/perf/arm_smmuv3_pmu.c | 1 + drivers/perf/arm_spe_pmu.c | 1 + drivers/perf/fsl_imx8_ddr_perf.c | 1 + drivers/perf/hisilicon/hisi_pcie_pmu.c | 1 + drivers/perf/hisilicon/hisi_uncore_pmu.c | 1 + drivers/perf/hisilicon/hns3_pmu.c | 1 + drivers/perf/qcom_l2_pmu.c | 1 + drivers/perf/qcom_l3_pmu.c | 1 + drivers/perf/riscv_pmu_legacy.c | 1 + drivers/perf/riscv_pmu_sbi.c | 1 + drivers/perf/thunderx2_pmu.c | 1 + drivers/perf/xgene_pmu.c | 1 + include/linux/perf_event.h | 1 + kernel/events/core.c | 1 + 38 files changed, 46 insertions(+), 18 deletions(-) rename Documentation/ABI/testing/{sysfs-devices-hisi_ptt => sysfs-bus-event_source-devices-hisi_ptt} (83%) Reviewed-by: Greg Kroah-Hartman Reviewed-by: Greg Kroah-Hartman Reviewed-by: Greg Kroah-Hartman Reviewed-by: Greg Kroah-Hartman Reviewed-by: Greg Kroah-Hartman Reviewed-by: Greg Kroah-Hartman Reviewed-by: Suzuki K Poulose Reviewed-by: Suzuki K Poulose Reviewed-by: Suzuki K Poulose Reviewed-by: Shuai Xue Reviewed-by: Dan Williams Reviewed-by: Yicong Yang Reviewed-by: Yicong Yang Reviewed-by: Yicong Yang Reviewed-by: Yicong Yang Reviewed-by: Yicong Yang Reviewed-by: Xu Yilun Reviewed-by: Jiucheng Xu Acked-by: Suzuki K Poulose Acked-by: Suzuki K Poulose