From patchwork Fri May 5 11:38:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sascha Hauer X-Patchwork-Id: 13232568 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 C59D9C7EE22 for ; Fri, 5 May 2023 11:39:29 +0000 (UTC) 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:References:In-Reply-To: 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: List-Owner; bh=wScC0zk5SQkrvGUql6MYcE5XXZdRkHZGFjOxL9N7q4g=; b=tPv9C4r8reESav GxZoU5nj4gSc7Kkoe8wnBXsUzZCj1KzZ10wA1+36DG7xV/90w0d899HX4ZPVuWCAcrFP20pPccnEb AOYYc8+YejCprDE43DuPm0ZfcdT6F6WKTSTsKKirMpS9d33A6AdtGmer+/g0+ZmOKeTd62lmRJtUc C05hDToX95R2ksOXfpGNdheYm2T3yFspxIvpE0Komfu8IS1pfpcpqKIio8sT9bjGNwx4OmxZl769a kx2u0RtF86VHWYoHRS5rzob2ml4awevjdepBoz8LGh9XTcZdxYKMlT0xTxAMiIfdm3yJtHC0E5bVH fXONs4mLPJ7go8FewNKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1putmT-00Aj6m-0g; Fri, 05 May 2023 11:39:21 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1putmL-00Aj0r-0P for linux-rockchip@lists.infradead.org; Fri, 05 May 2023 11:39:19 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1putmB-0001VZ-Lf; Fri, 05 May 2023 13:39:03 +0200 Received: from [2a0a:edc0:0:1101:1d::28] (helo=dude02.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1putm9-001HbK-Hy; Fri, 05 May 2023 13:39:01 +0200 Received: from sha by dude02.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1putm8-003RnT-34; Fri, 05 May 2023 13:39:00 +0200 From: Sascha Hauer To: linux-rockchip@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org, Heiko Stuebner , Kyungmin Park , MyungJoo Ham , Will Deacon , Mark Rutland , kernel@pengutronix.de, Michael Riesch , Sascha Hauer Subject: [PATCH v4 05/21] PM / devfreq: rockchip-dfi: dfi store raw values in counter struct Date: Fri, 5 May 2023 13:38:40 +0200 Message-Id: <20230505113856.463650-6-s.hauer@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230505113856.463650-1-s.hauer@pengutronix.de> References: <20230505113856.463650-1-s.hauer@pengutronix.de> MIME-Version: 1.0 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-rockchip@lists.infradead.org X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org When adding perf support to the DFI driver the perf part will need the raw counter values, so move the fixed * 4 factor to rockchip_dfi_get_event(). Signed-off-by: Sascha Hauer Reviewed-by: Jonathan Cameron --- drivers/devfreq/event/rockchip-dfi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/devfreq/event/rockchip-dfi.c b/drivers/devfreq/event/rockchip-dfi.c index f317d3d063e9c..383fe8a17a512 100644 --- a/drivers/devfreq/event/rockchip-dfi.c +++ b/drivers/devfreq/event/rockchip-dfi.c @@ -97,7 +97,7 @@ static int rockchip_dfi_get_busier_ch(struct devfreq_event_dev *edev) /* Find out which channel is busier */ for (i = 0; i < RK3399_DMC_NUM_CH; i++) { dfi->ch_usage[i].access = readl_relaxed(dfi_regs + - DDRMON_CH0_DFI_ACCESS_NUM + i * 20) * 4; + DDRMON_CH0_DFI_ACCESS_NUM + i * 20); dfi->ch_usage[i].total = readl_relaxed(dfi_regs + DDRMON_CH0_COUNT_NUM + i * 20); tmp = dfi->ch_usage[i].access; @@ -149,7 +149,7 @@ static int rockchip_dfi_get_event(struct devfreq_event_dev *edev, busier_ch = rockchip_dfi_get_busier_ch(edev); - edata->load_count = dfi->ch_usage[busier_ch].access; + edata->load_count = dfi->ch_usage[busier_ch].access * 4; edata->total_count = dfi->ch_usage[busier_ch].total; return 0;