Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2821845rwd; Wed, 14 Jun 2023 07:46:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Vtfx61wgQtMgpoI3NzNcHno0gAcXdLACpl+EIJheEp5KJISch+JzX+YEwH2ld02zaNY/z X-Received: by 2002:a19:f207:0:b0:4f6:3677:54e with SMTP id q7-20020a19f207000000b004f63677054emr7365705lfh.36.1686753979543; Wed, 14 Jun 2023 07:46:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686753979; cv=none; d=google.com; s=arc-20160816; b=YMtjqCud6XC2n1sZGxJmSpHCU3uBTpwdxIjoF+4WRygzlcChDwVkRv2HGdIbhTtbxv P+kO4ZWhHT88Kqayg2tBdQW2t0QdnI8TRRTddCqFLxOdckxQ+BMk3I7JhsdOhhDRQtZP QGkzqa4K3quTJpuyvUAwDlvGBUi+atD8SKiuKj61lAqjCyuisNfYPybyBcYg1syDDgzE Hkrdl6GOk7FFfeKAERPZ2f6ilCbfSdCqeIpXbYi8dZBMMukSs/A03gTLpFAVsm2kL7a7 rfl+uLxJWUvrLo4SY3Q3Yrcwbvn5gQ5gJb52Gj35rDkKfo6A0hO/L8uZv0c9CYgn341e njYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8eR7QlPAn+/X11TttbMgj3QuFwpq0zCRLUaL5j7GYC0=; b=KlC35wVl8lM6zIu2arktny3ncbCOrZrpYRRVzjXOPkCQnYldKloLAi3izqSjtFUQsJ mXtArU4zS/AqAvOSQqxpvZPDfTDZTQRgJ+w+hsPkZLe8BHDQLZy+cxDR2FuGHqC44XQk p6Tn//uFeJN7tP0v1xmgODmno69MCrtjrMUea9UTLnvvYEJ7zSFaIl/THIqdFoFGILtu +TY7vshk4E9S1r3TyYZ/8K9XmoOw4rXoloiSKs3me1AqYzCMm4QmHND9Gq0sfvys8zAq AEwCzLObV/QIBDsyPeE/STOUdgjs2/hMvqLNm6PFS72wFsPJ7wCyYFEGi5MDKFuYqh4C SpnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=arFK4HIV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x10-20020aa7daca000000b00514a59fa4b3si8472894eds.467.2023.06.14.07.45.53; Wed, 14 Jun 2023 07:46:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=arFK4HIV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245041AbjFNNkk (ORCPT + 99 others); Wed, 14 Jun 2023 09:40:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235356AbjFNNki (ORCPT ); Wed, 14 Jun 2023 09:40:38 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EEEA10FE; Wed, 14 Jun 2023 06:40:37 -0700 (PDT) Received: from mercury (dyndsl-091-248-213-214.ewe-ip-backbone.de [91.248.213.214]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sre) by madras.collabora.co.uk (Postfix) with ESMTPSA id DBD206606F20; Wed, 14 Jun 2023 14:40:35 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1686750036; bh=PBYQcUFjQMg4J0fJHCjFD2l4P5QvWdlw692+eiww3G4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=arFK4HIV6P8nM46DlbdXlMJuYDrRy5fRJxQF3mPt1ytPQvXsE6J4VmNVAGwoB6KtE Gl3Z7np7uwlhbbWxD6yltL2Q3M1yUNrGBrwmGSQbK/ONj8bPLvQzzkomOZMO0l4BWt x2BbrB8akghj0wD7OdIlYWjv8q8e8zHllbAL6XGnoMdT/LtknA/GXfCtZ2BtxygnnR rAfJWwZVz0hFRp3N20y53Trjavb0daJ19sOST6iuCTZ7TcGO4SW+hxZzZc4unCPZPh v5O4bG+zKyD8UQq/6elZx39/OrQbZMnaWZ5j7JBIDt/CvMPNOukrkT46FMKat/jIl3 XsXhxkzE5XQ9w== Received: by mercury (Postfix, from userid 1000) id 0F7C31060A04; Wed, 14 Jun 2023 15:40:34 +0200 (CEST) Date: Wed, 14 Jun 2023 15:40:34 +0200 From: Sebastian Reichel To: Sascha Hauer Cc: linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Heiko Stuebner , Kyungmin Park , MyungJoo Ham , Will Deacon , Mark Rutland , kernel@pengutronix.de, Michael Riesch , Robin Murphy , Vincent Legoll , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org Subject: Re: [PATCH v5 00/25] Add perf support to the rockchip-dfi driver Message-ID: <20230614134034.3p3p75a3jophi2eu@mercury.elektranox.org> References: <20230524083153.2046084-1-s.hauer@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="o7ugbz6dwi4olws4" Content-Disposition: inline In-Reply-To: <20230524083153.2046084-1-s.hauer@pengutronix.de> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --o7ugbz6dwi4olws4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Wed, May 24, 2023 at 10:31:28AM +0200, Sascha Hauer wrote: > This is v5 of the series adding perf support to the rockchip DFI driver. >=20 > A lot has changed in the perf driver since v4. First of all the review > feedback from Robin and Jonathan has been integrated. The perf driver > now not only supports monitoring the total DDR utilization, but also the > individual channels. I also reworked the way the raw 32bit counter > values are summed up to 64bit perf values, so hopefully the code is > easier to follow now. >=20 > lockdep found out that that locking in the perf driver was broken, so I > reworked that as well. None of the perf hooks allows locking with > mutexes or spinlocks, so in perf it's not possible to enable the DFI > controller when needed. Instead I now unconditionally enable the DFI > controller during probe when perf is enabled. >=20 > Furthermore the hrtimer I use for reading out the hardware counter > values before they overflow race with perf. Now a seqlock is used to > prevent that. >=20 > The RK3588 device tree changes for the DFI were not part of v4. As > Vincent Legoll showed interest in testing this series the necessary > device tree changes are now part of this series. I tested the series on RK3588 EVB1. The read/write byts looks sensible. Sometimes cycles reads unrealistic values, though: Performance counter stats for 'system wide': 18446744070475110400 rockchip_ddr/cycles/ = =20 828.63 MB rockchip_ddr/read-bytes/ = =20 207.19 MB rockchip_ddr/read-bytes0/ = =20 207.15 MB rockchip_ddr/read-bytes1/ = =20 207.14 MB rockchip_ddr/read-bytes2/ = =20 207.15 MB rockchip_ddr/read-bytes3/ = =20 1.48 MB rockchip_ddr/write-bytes/ = =20 0.37 MB rockchip_ddr/write-bytes0/ = =20 0.37 MB rockchip_ddr/write-bytes1/ = =20 0.37 MB rockchip_ddr/write-bytes2/ = =20 0.38 MB rockchip_ddr/write-bytes3/ = =20 830.12 MB rockchip_ddr/bytes/ = =20 1.004239766 seconds time elapsed (This is with memdump running in parallel) Otherwise the series is Tested-by: Sebastian Reichel -- Sebastian > Changes since v4: > - Add device tree changes for RK3588 > - Use seqlock to protect perf counter values from hrtimer > - Unconditionally enable DFI when perf is enabled > - Bring back changes to dts/binding patches that were lost in v4 >=20 > Changes since v3: > - Add RK3588 support >=20 > Changes since v2: > - Fix broken reference to binding > - Add Reviewed-by from Rob >=20 > Changes since v1: > - Fix example to actually match the binding and fix the warnings resulted= thereof > - Make addition of rockchip,rk3568-dfi an extra patch >=20 > Sascha Hauer (25): > PM / devfreq: rockchip-dfi: Make pmu regmap mandatory > PM / devfreq: rockchip-dfi: Embed desc into private data struct > PM / devfreq: rockchip-dfi: use consistent name for private data > struct > PM / devfreq: rockchip-dfi: Add SoC specific init function > PM / devfreq: rockchip-dfi: dfi store raw values in counter struct > PM / devfreq: rockchip-dfi: Use free running counter > PM / devfreq: rockchip-dfi: introduce channel mask > PM / devfreq: rk3399_dmc,dfi: generalize DDRTYPE defines > PM / devfreq: rockchip-dfi: Clean up DDR type register defines > PM / devfreq: rockchip-dfi: Add RK3568 support > PM / devfreq: rockchip-dfi: Handle LPDDR2 correctly > PM / devfreq: rockchip-dfi: Handle LPDDR4X > PM / devfreq: rockchip-dfi: Pass private data struct to internal > functions > PM / devfreq: rockchip-dfi: Prepare for multiple users > PM / devfreq: rockchip-dfi: give variable a better name > PM / devfreq: rockchip-dfi: Add perf support > PM / devfreq: rockchip-dfi: make register stride SoC specific > PM / devfreq: rockchip-dfi: account for multiple DDRMON_CTRL registers > PM / devfreq: rockchip-dfi: add support for RK3588 > dt-bindings: devfreq: event: convert Rockchip DFI binding to yaml > dt-bindings: devfreq: event: rockchip,dfi: Add rk3568 support > dt-bindings: devfreq: event: rockchip,dfi: Add rk3588 support > arm64: dts: rockchip: rk3399: Enable DFI > arm64: dts: rockchip: rk356x: Add DFI > arm64: dts: rockchip: rk3588s: Add DFI >=20 > .../bindings/devfreq/event/rockchip,dfi.yaml | 84 ++ > .../bindings/devfreq/event/rockchip-dfi.txt | 18 - > .../rockchip,rk3399-dmc.yaml | 2 +- > arch/arm64/boot/dts/rockchip/rk3399.dtsi | 1 - > arch/arm64/boot/dts/rockchip/rk356x.dtsi | 7 + > arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 16 + > drivers/devfreq/event/rockchip-dfi.c | 796 +++++++++++++++--- > drivers/devfreq/rk3399_dmc.c | 10 +- > include/soc/rockchip/rk3399_grf.h | 9 +- > include/soc/rockchip/rk3568_grf.h | 13 + > include/soc/rockchip/rk3588_grf.h | 18 + > include/soc/rockchip/rockchip_grf.h | 18 + > 12 files changed, 854 insertions(+), 138 deletions(-) > create mode 100644 Documentation/devicetree/bindings/devfreq/event/rockc= hip,dfi.yaml > delete mode 100644 Documentation/devicetree/bindings/devfreq/event/rockc= hip-dfi.txt > create mode 100644 include/soc/rockchip/rk3568_grf.h > create mode 100644 include/soc/rockchip/rk3588_grf.h > create mode 100644 include/soc/rockchip/rockchip_grf.h >=20 > --=20 > 2.39.2 >=20 --o7ugbz6dwi4olws4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmSJw00ACgkQ2O7X88g7 +pqqmg//ZLfOtGMx2p1VeLXg8eFmo95vhmxSFozhTnnAQYb5Zay290jo4HZyard5 JQjWZuCa+4yxDg1H0r2i/4Ba8UT6BXGfYi0nVOM/Jc61TTYXlypIwTyb8t0O9PnW RwGiUF6ftkO2B+J29AvgTzDDXYCIOnUgcutXJoKChkTN25oFq5D88XPn2jy6crmg jXRlWQO4hi1Znh3IyQ1bY93Kui4JzrU3qXgi+06aCf8ADmDgjYxu33pJMkqXzJSx 7EErhr77XvssrnPcJCc/EEfsGOjOOOVaAIFRUr7qhSI/us3K8/Ghnb6ZIDnvnXXp SEL7f2JvZknXvhAILe4xmPBfqqP7cGoh5W9IPQpTPz48sPWGhLxqZdfWfwjR+RJg 6zycFqoOyFtZOucNR0BUQhLdj/R9ouc6Ya1uq1zupL3BoGNd815jpWqjlHV+qu/S 2Jr8NvyTg4SwWiggYyRydLPESJka06AAwkHFFvBxajQwsRECt6DZMF46Jsfbj69l dzp7g5l9e79GQJ4jF8OTjQkZC05CdKLzIy7rKYsiEQt9HScCww2r6Er9mjj+i3PA 6d3aKUZ1mf3ERcIBSHmtSGJDr2mYT0Q3wr3QBcALKcKPkb7qk5temqjI67fknOzi eS4cpLgRj38ZT4+0dJYsAVZe8XNbtw+i+/7ges94PAZEttg+iHk= =nxkL -----END PGP SIGNATURE----- --o7ugbz6dwi4olws4--