Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp283105rdb; Thu, 19 Oct 2023 04:38:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHs1s4NVbYtlPnm0AyvfDj3gsK+ZHH4CLBdDpNgE4RQfC6P/Lp/APkAH2erdUT/2vzA/uDt X-Received: by 2002:a92:de02:0:b0:34f:d822:baab with SMTP id x2-20020a92de02000000b0034fd822baabmr2037431ilm.12.1697715516935; Thu, 19 Oct 2023 04:38:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697715516; cv=none; d=google.com; s=arc-20160816; b=egbdzl7PiipaDP26FckLtLPoWiU9JtmRcv5i/By4sS0Z85r8L9Q/0za0NmPOWXwQM2 ls/9NiHRdYVXsrWQyDTd9YNHZxljkcfFxNWa0DRzY0D3hnK4Yd9uZth8y5JWeS/NKrx/ 8ZIKXlnTJjZVSB7kA/8jFcyykODjHI7QdAFXC/C/a5Fq00JKXYMC5P+o/mb7G7dx90Gh Tz8HX/BsXozQ5AnoiqnVGELKZXZoVrJe+rFoN4iK19mhaKYIQKtWoL9ukQozWb393Gmq HloMxyLyaaIWOvcu7Z0O4PwVwDCkhocuAllIiKaN7j3Meaen+jiRzYkbDAjZBJ3mdH1W 88MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:thread-index :content-language:content-transfer-encoding:mime-version:message-id :date:subject:in-reply-to:cc:to:from:dkim-signature:dkim-filter; bh=nA9NwooCLV1zRj115RojQInqhJTyoYBvk5U5nWxx+Sc=; fh=BewXI0FRnKfC6Wd82TCVXAxSLgLI2yRBzCBbY9+GTd0=; b=YyGIFiMnWuqIxVPBYVp6n2i7DnOOJW6MuEZnCTRHbti2B1D92R+mF1vlUWGqjo4g0p rg77gB7xQS3Dm4oUKYgDw78/1IjQBQQTNkIFE1BsG7ioircLEPB3zNjpURpUxQtPV/uK A4twv3ov6KiBb4DzBEerSutNmNz7M7gH6v/GK5PqkOkP0YI4YKA/v7SjINoG2ErC6Sah Y0VEy/E1TmGWpH2pb70pRtVcrajeWxyCkwf1H7CH0CuW+90wji6gxJle1gmOMJ3/2Rll HsDVj2KupaKmu3fMyl4tK8fEEV5K948C3QCEhf9/6le5Bg44uZUlPUsx/x01E6w7u+we sUOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ZiW2IPIF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id f20-20020a635554000000b0055c1760dd8esi4439818pgm.380.2023.10.19.04.38.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 04:38:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ZiW2IPIF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id DE3F182DEE4E; Thu, 19 Oct 2023 04:38:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345475AbjJSLiT (ORCPT + 99 others); Thu, 19 Oct 2023 07:38:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235349AbjJSLiI (ORCPT ); Thu, 19 Oct 2023 07:38:08 -0400 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A849CD7A for ; Thu, 19 Oct 2023 04:37:48 -0700 (PDT) Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20231019113746epoutp042fb1beb62a05bdc3303604d888ea4ff7~PfzjElk1H2174921749epoutp04f for ; Thu, 19 Oct 2023 11:37:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20231019113746epoutp042fb1beb62a05bdc3303604d888ea4ff7~PfzjElk1H2174921749epoutp04f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1697715466; bh=nA9NwooCLV1zRj115RojQInqhJTyoYBvk5U5nWxx+Sc=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=ZiW2IPIFeaZAn/OSqk7hHFZaE6UiW7meRQx6mAiWqBm1LYBF5y8CPES/7aMMFCD3R 1Qybw4XOXFx0O54yxM7yERAE8gQHRsBCtYkajV04CILo1atEoVvR5Lth0qi4IFm6kI P8ur/i62ueCni1FhBI0m/7M/Ny9mEu8aRdPDZidE= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20231019113745epcas1p3e9baa3975a2bc96bdab7704e03ed25aa~PfziUipUX0720707207epcas1p3C; Thu, 19 Oct 2023 11:37:45 +0000 (GMT) Received: from epsmgec1p1.samsung.com (unknown [182.195.36.135]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4SB5LJ4KyCz4x9Py; Thu, 19 Oct 2023 11:37:44 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmgec1p1.samsung.com (Symantec Messaging Gateway) with SMTP id DC.9C.08572.80511356; Thu, 19 Oct 2023 20:37:44 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPA id 20231019113744epcas1p136981f23fda1dd74a2de41039abf2969~Pfzg8tD3K2437624376epcas1p1i; Thu, 19 Oct 2023 11:37:44 +0000 (GMT) Received: from epsmgmc1p1new.samsung.com (unknown [182.195.42.40]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231019113744epsmtrp193f39fcb03dc5d2018b82b7311a3f339~Pfzg7oIVb1064910649epsmtrp10; Thu, 19 Oct 2023 11:37:44 +0000 (GMT) X-AuditID: b6c32a33-cefff7000000217c-83-653115089472 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmc1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 69.48.07368.70511356; Thu, 19 Oct 2023 20:37:43 +0900 (KST) Received: from cw00choi03 (unknown [10.113.111.106]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231019113743epsmtip2346a2fa7640bfb4c7701712e8f457493~PfzgkeIAT2788827888epsmtip2D; Thu, 19 Oct 2023 11:37:43 +0000 (GMT) From: "Chanwoo Choi" To: "'Chanwoo Choi'" , "'Sascha Hauer'" , Cc: , , , "'Heiko Stuebner'" , "'Kyungmin Park'" , "'MyungJoo Ham'" , "'Will Deacon'" , "'Mark Rutland'" , , "'Michael Riesch'" , "'Robin Murphy'" , "'Vincent Legoll'" , "'Rob Herring'" , "'Krzysztof Kozlowski'" , "'Conor Dooley'" , , "'Sebastian Reichel'" In-Reply-To: <99477a81-08d1-4e5d-8b20-22da58921041@kernel.org> Subject: RE: [PATCH v8 07/26] PM / devfreq: rockchip-dfi: introduce channel mask Date: Thu, 19 Oct 2023 20:37:43 +0900 Message-ID: <000e01da0280$acc3e640$064bb2c0$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0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5mJRFeVQ+DVCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8hjNmpwgJpCeWpGanphakFsFk mTg4pRqYjI7Ubmta2X+wb+Kx/U/+qF74YRMnpbRz0az5WzbwH1dibZ6YsKzkwIma7rfKh0vT bq56dCvudjD38Zcb1ByL96/QOKeYvcM/0vv4rlZla87kP/vVD5Tt+fwkjf/n+gtPfA52qPWd 2hP9tWdf9LS1jYs3NOg8Mf6/iG2ZVI9JorH2fLHDjVtbf5U/eRsvF5Yg80e0tSkjoCOvan3C L43Or4euBN9eIMsn+clZ9+T6Sxob9ue1zT3GtzkzzmbHp9ha/bTAdb1bDghnSv6aULbn7lGB l//f+ApFJhx3O3lw+4HzrXNX1MfNeDnx+pPg1x23bXpO8p2sKpqjruneL3T9eIxppKFAcF6z 4qdTu4VCRJRYijMSDbWYi4oTAb6Ih4ZwAwAA X-CMS-MailID: 20231019113744epcas1p136981f23fda1dd74a2de41039abf2969 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20231018150545epcas1p1894352c75255fabd2377593bd09fc9af References: <20231018061714.3553817-1-s.hauer@pengutronix.de> <20231018061714.3553817-8-s.hauer@pengutronix.de> <99477a81-08d1-4e5d-8b20-22da58921041@kernel.org> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 19 Oct 2023 04:38:32 -0700 (PDT) > -----Original Message----- > From: Chanwoo Choi > Sent: Thursday, October 19, 2023 12:06 AM > To: Sascha Hauer ; 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; Sebastian Reichel > > Subject: Re: [PATCH v8 07/26] PM / devfreq: rockchip-dfi: introduce > channel mask > > On 23. 10. 18. 15:16, Sascha Hauer wrote: > > Different Rockchip SoC variants have a different number of channels. > > Introduce a channel mask to make the number of channels configurable > > from SoC initialization code. > > > > Reviewed-by: Sebastian Reichel > > Signed-off-by: Sascha Hauer > > --- > > > > Notes: > > Changes since v7: > > - Loop only over channels present on a SoC > > > > drivers/devfreq/event/rockchip-dfi.c | 25 +++++++++++++++++++------ > > 1 file changed, 19 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/devfreq/event/rockchip-dfi.c > > b/drivers/devfreq/event/rockchip-dfi.c > > index 126bb744645b6..28c18bbf6baa5 100644 > > --- a/drivers/devfreq/event/rockchip-dfi.c > > +++ b/drivers/devfreq/event/rockchip-dfi.c > > @@ -18,10 +18,11 @@ > > #include > > #include > > #include > > +#include > > > > #include > > > > -#define RK3399_DMC_NUM_CH 2 > > +#define DMC_MAX_CHANNELS 2 > > > > /* DDRMON_CTRL */ > > #define DDRMON_CTRL 0x04 > > @@ -44,7 +45,7 @@ struct dmc_count_channel { }; > > > > struct dmc_count { > > - struct dmc_count_channel c[RK3399_DMC_NUM_CH]; > > + struct dmc_count_channel c[DMC_MAX_CHANNELS]; > > }; > > > > /* > > @@ -61,6 +62,8 @@ struct rockchip_dfi { > > struct regmap *regmap_pmu; > > struct clk *clk; > > u32 ddr_type; > > + unsigned int channel_mask; > > + unsigned int max_channels; > > }; > > > > static void rockchip_dfi_start_hardware_counter(struct > > devfreq_event_dev *edev) @@ -95,7 +98,9 @@ static void > rockchip_dfi_read_counters(struct devfreq_event_dev *edev, struct dm > > u32 i; > > void __iomem *dfi_regs = dfi->regs; > > > > - for (i = 0; i < RK3399_DMC_NUM_CH; i++) { > > + for (i = 0; i < dfi->max_channels; i++) { > > + if (!(dfi->channel_mask & BIT(i))) > > + continue; > > count->c[i].access = readl_relaxed(dfi_regs + > > DDRMON_CH0_DFI_ACCESS_NUM + i * 20); > > count->c[i].total = readl_relaxed(dfi_regs + @@ -145,9 > +150,14 @@ > > static int rockchip_dfi_get_event(struct devfreq_event_dev *edev, > > rockchip_dfi_read_counters(edev, &count); > > > > /* We can only report one channel, so find the busiest one */ > > - for (i = 0; i < RK3399_DMC_NUM_CH; i++) { > > - u32 a = count.c[i].access - last->c[i].access; > > - u32 t = count.c[i].total - last->c[i].total; > > + for (i = 0; i < dfi->max_channels; i++) { > > + u32 a, t; > > + > > + if (!(dfi->channel_mask & BIT(i))) > > + continue; > > + > > + a = count.c[i].access - last->c[i].access; > > + t = count.c[i].total - last->c[i].total; > > > > if (a > access) { > > access = a; > > @@ -185,6 +195,9 @@ static int rk3399_dfi_init(struct rockchip_dfi *dfi) > > dfi->ddr_type = (val >> RK3399_PMUGRF_DDRTYPE_SHIFT) & > > RK3399_PMUGRF_DDRTYPE_MASK; > > > > + dfi->channel_mask = GENMASK(1, 0); > > + dfi->max_channels = 2; > > + > > return 0; > > }; > > > > Acked-by: Chanwoo Choi > Applied it. Thanks. Best Regards, Chanwoo Choi