Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5447199rwd; Wed, 24 May 2023 01:45:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ70P/ozju0qg9iyr1wWPMNlbx/x0FRCPrCVQKIkdQapPfgBcuU4VbOddYVUH+JRQyh3r21J X-Received: by 2002:a17:90a:8b91:b0:253:38ff:be4b with SMTP id z17-20020a17090a8b9100b0025338ffbe4bmr15511771pjn.47.1684917899890; Wed, 24 May 2023 01:44:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684917899; cv=none; d=google.com; s=arc-20160816; b=gKw9kNoLTybEx2Vsxk5mNwA+DQSvTVllPBCc0mf0qRLjNqPqXHfW+eD03E8Ct3MsJR WUdyUpuOTCIaa9WPH69IVU/iBHAR29AdsAErfI/8eqQjAFFW3TuiQ8u8p/Nid0aJLXAq MM2ZiedZi1m6uiQWb7ikDHbeUQDKNGP8Cd+8l3qovJ+1ZhT6ridgoLzhco9GiK9NG914 vj1g1nM4gS4pUvtQTPbREIQPRYPfMqwUBAvPXvNneb/9l7PWrjTFMFLDZSbQ7SEmaj+g 7ch02HmoHjX2klksEsz4kCa6Ji0le6BGm1ZSVpYIr8NL7WWdoOrQijlx0NYlaycC9XlO 9PoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=wO3HfodtM80xRUJn+qAEgbHHAfBIvenHQOhO2Eqeoi4=; b=QJp7P721XluC9LyelCB9of22acj68gt/S6Q/0Nkevor9OLVgA1+FyIo9mnTY2l6HbO PmnLjYwjfhSfbxzLLtzOrMIf70IVCenAKArQSft/Pi6IoRq+2Z/huXTyV23MKPplp8Xs kM33KhoVV/2LRuynK0SoHKlcrKkPzzOOx82zppxM5okynLK/sCKPA6f8duKphJkaoDTR mNhRxXoFO73ZWm7G3/I0YTZ8HDVlO8HQNBh8rdq9b761EVlyYQsYhJia4i4TXt9cb+Wk aNuoY0/lC17XxnF7eHVi49TjCaDIKqGLRLKHRNkkHRIpxT2tIDFpbTUhf+2K7BVrGLvm v59A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k23-20020a17090a591700b0025049be6267si926246pji.133.2023.05.24.01.44.46; Wed, 24 May 2023 01:44:59 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233167AbjEXIdD (ORCPT + 99 others); Wed, 24 May 2023 04:33:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240200AbjEXIce (ORCPT ); Wed, 24 May 2023 04:32:34 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67988E42 for ; Wed, 24 May 2023 01:32:32 -0700 (PDT) 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 1q1jua-0002nZ-Mv; Wed, 24 May 2023 10:32:00 +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 1q1juZ-002RaI-SH; Wed, 24 May 2023 10:31:59 +0200 Received: from sha by dude02.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1q1juW-009j5x-6l; Wed, 24 May 2023 10:31:56 +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 , 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, Sascha Hauer , Jonathan Cameron Subject: [PATCH v5 05/25] PM / devfreq: rockchip-dfi: dfi store raw values in counter struct Date: Wed, 24 May 2023 10:31:33 +0200 Message-Id: <20230524083153.2046084-6-s.hauer@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230524083153.2046084-1-s.hauer@pengutronix.de> References: <20230524083153.2046084-1-s.hauer@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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 6b1ef29df7048..680f629da64fc 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; -- 2.39.2