From nobody Mon Feb 9 20:55:00 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23DF5CDB484 for ; Wed, 18 Oct 2023 06:17:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229706AbjJRGRl (ORCPT ); Wed, 18 Oct 2023 02:17:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbjJRGRj (ORCPT ); Wed, 18 Oct 2023 02:17:39 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3D1893 for ; Tue, 17 Oct 2023 23:17:36 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qszrs-0001Zw-JW; Wed, 18 Oct 2023 08:17:20 +0200 Received: from [2a0a:edc0:0:1101:1d::28] (helo=dude02.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qszrr-002UYQ-1l; Wed, 18 Oct 2023 08:17:19 +0200 Received: from sha by dude02.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1qszrq-00Eviy-30; Wed, 18 Oct 2023 08:17:18 +0200 From: Sascha Hauer To: linux-rockchip@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Heiko Stuebner , Chanwoo Choi , 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, Sebastian Reichel , Sascha Hauer , Chanwoo Choi Subject: [PATCH v8 15/26] PM / devfreq: rockchip-dfi: give variable a better name Date: Wed, 18 Oct 2023 08:17:03 +0200 Message-Id: <20231018061714.3553817-16-s.hauer@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231018061714.3553817-1-s.hauer@pengutronix.de> References: <20231018061714.3553817-1-s.hauer@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" struct dmc_count_channel::total counts the clock cycles of the DDR controller. Rename it accordingly to give the reader a better idea what this is about. While at it, at some documentation to struct dmc_count_channel. Reviewed-by: Sebastian Reichel Acked-by: Chanwoo Choi Signed-off-by: Sascha Hauer --- drivers/devfreq/event/rockchip-dfi.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/devfreq/event/rockchip-dfi.c b/drivers/devfreq/event/r= ockchip-dfi.c index 7a4f1901314d4..3d5c6d737ccd9 100644 --- a/drivers/devfreq/event/rockchip-dfi.c +++ b/drivers/devfreq/event/rockchip-dfi.c @@ -46,9 +46,14 @@ #define DDRMON_CH1_COUNT_NUM 0x3c #define DDRMON_CH1_DFI_ACCESS_NUM 0x40 =20 +/** + * struct dmc_count_channel - structure to hold counter values from the DD= R controller + * @access: Number of read and write accesses + * @clock_cycles: DDR clock cycles + */ struct dmc_count_channel { u32 access; - u32 total; + u32 clock_cycles; }; =20 struct dmc_count { @@ -151,7 +156,7 @@ static void rockchip_dfi_read_counters(struct rockchip_= dfi *dfi, struct dmc_coun continue; count->c[i].access =3D readl_relaxed(dfi_regs + DDRMON_CH0_DFI_ACCESS_NUM + i * 20); - count->c[i].total =3D readl_relaxed(dfi_regs + + count->c[i].clock_cycles =3D readl_relaxed(dfi_regs + DDRMON_CH0_COUNT_NUM + i * 20); } } @@ -183,29 +188,29 @@ static int rockchip_dfi_get_event(struct devfreq_even= t_dev *edev, struct rockchip_dfi *dfi =3D devfreq_event_get_drvdata(edev); struct dmc_count count; struct dmc_count *last =3D &dfi->last_event_count; - u32 access =3D 0, total =3D 0; + u32 access =3D 0, clock_cycles =3D 0; int i; =20 rockchip_dfi_read_counters(dfi, &count); =20 /* We can only report one channel, so find the busiest one */ for (i =3D 0; i < dfi->max_channels; i++) { - u32 a, t; + u32 a, c; =20 if (!(dfi->channel_mask & BIT(i))) continue; =20 a =3D count.c[i].access - last->c[i].access; - t =3D count.c[i].total - last->c[i].total; + c =3D count.c[i].clock_cycles - last->c[i].clock_cycles; =20 if (a > access) { access =3D a; - total =3D t; + clock_cycles =3D c; } } =20 edata->load_count =3D access * 4; - edata->total_count =3D total; + edata->total_count =3D clock_cycles; =20 dfi->last_event_count =3D count; =20 --=20 2.39.2