From mboxrd@z Thu Jan 1 00:00:00 1970 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 9A4ADC47DB3 for ; Wed, 31 Jan 2024 14:30:14 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:References:Cc:To:Subject:From: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5nC/pxNDxMn8W9mbTDbPlcXKdTL2/VYG0PCY777nzq8=; b=4w/1fbjshQ9Upp 43zrCoMXxdOgICbLTYmpIosi9rc41sVSsWLGVT8CGEnlqcox8PKDwZZfQ6g7IYRDmykhv8t3+rdRH P7qPTCMLby6mHoXhU80o96BeHMbj97oOPIldAsBHnuaYZWBG2L8772OAH04u+xmNTGs7lA/j84Zka OMYi4UZZ1xmqdzOZ3g1+fKpnfvOoxcDrw8XWT1kqwfeBUyK9zAt5zQBJ3xMEoy+ozqH9OLluU4we1 khWpIr3Hl+RtbPHZOYnMaK/Tb7O4fec7qg3eW1hMe0R6P1gb8UrQaqNHV8UnwoAB8otOHBel5c5zA D0gh+7Wr+z9VOq3aYnFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVBbH-00000003ttS-2JTa; Wed, 31 Jan 2024 14:30:03 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVBb1-00000003tkK-1DKn for linux-arm-kernel@lists.infradead.org; Wed, 31 Jan 2024 14:29:48 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 963E5DA7; Wed, 31 Jan 2024 06:30:29 -0800 (PST) Received: from [10.34.100.129] (e126645.nice.arm.com [10.34.100.129]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 362D23F738; Wed, 31 Jan 2024 06:29:44 -0800 (PST) Message-ID: Date: Wed, 31 Jan 2024 15:29:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Pierre Gondois Subject: Re: [PATCH 2/3] firmware: arm_scmi: Add support for marking certain frequencies as boost To: Sibi Sankar , cristian.marussi@arm.com Cc: linux-arm-kernel@lists.infradead.org, sudeep.holla@arm.com, sboyd@kernel.org, lukasz.luba@arm.com, dietmar.eggemann@arm.com, morten.rasmussen@arm.com, viresh.kumar@linaro.org, rafael@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, quic_mdtipton@quicinc.com, linux-arm-msm@vger.kernel.org, nm@ti.com References: <20240117110443.2060704-1-quic_sibis@quicinc.com> <20240117110443.2060704-3-quic_sibis@quicinc.com> Content-Language: en-US In-Reply-To: <20240117110443.2060704-3-quic_sibis@quicinc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240131_062947_438208_E612C922 X-CRM114-Status: GOOD ( 14.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Sibi, On 1/17/24 12:04, Sibi Sankar wrote: > All opps above the sustained level/frequency are treated as boost, so mark > them accordingly. > > Suggested-by: Sudeep Holla > Signed-off-by: Sibi Sankar > --- > drivers/firmware/arm_scmi/perf.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c > index e286f04ee6e3..d3fb8c804b3d 100644 > --- a/drivers/firmware/arm_scmi/perf.c > +++ b/drivers/firmware/arm_scmi/perf.c > @@ -811,7 +811,7 @@ static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph, > struct device *dev, u32 domain) > { > int idx, ret; > - unsigned long freq; > + unsigned long freq, sustained_freq; > struct dev_pm_opp_data data = {}; > struct perf_dom_info *dom; > > @@ -819,12 +819,21 @@ static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph, > if (IS_ERR(dom)) > return PTR_ERR(dom); > > + if (!dom->level_indexing_mode) > + sustained_freq = dom->sustained_perf_level * dom->mult_factor; > + else > + sustained_freq = dom->sustained_freq_khz * dom->mult_factor; > + > for (idx = 0; idx < dom->opp_count; idx++) { > if (!dom->level_indexing_mode) > freq = dom->opp[idx].perf * dom->mult_factor; > else > freq = dom->opp[idx].indicative_freq * dom->mult_factor; > > + /* All opps above the sustained level/frequency are treated as boost */ > + if (sustained_freq && freq > sustained_freq) It seems the sustained_freq is not optional since SCMI v1.0, is it necessary to check that (sustained_freq != 0) ? > + data.turbo = true; > + > data.level = dom->opp[idx].perf; > data.freq = freq; > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel