Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1692692rdb; Wed, 31 Jan 2024 06:29:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IGlT+rQ7lOQwG2cNHApdN7SUk3OkYeW5MNxBbVRoRI090GCzaTbXdpSVgFN17u+FG7KvHXZ X-Received: by 2002:a05:6402:cba:b0:559:d0ef:616b with SMTP id cn26-20020a0564020cba00b00559d0ef616bmr1169354edb.42.1706711398342; Wed, 31 Jan 2024 06:29:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706711398; cv=pass; d=google.com; s=arc-20160816; b=tLNHtLnjqvlB8lEdW4DPfBOBhIISAVNkb/huxww7cLyE/nuKR8MRiMvYMgQGSh3I16 onmxp7KyZRX0UOrBqmDrkQSFtVC2kS/lrkVq7sVFfNN8XxNb4D7BGsMo8YUiQHzvvL64 lKzRiM2QJ2b1o7+WN6u02aF9FYRbM8Lq8SPYz/VtVHIx0/shvE8wL5hB8C2YmnedyhEn uRKyUHZHiSTRPyLJ8oqq+679eC7ghEFxSIrUBXMDqTDBWt+U51sdLTRt8LPkLnSEwALM ZIg0xTRVd9l228kG5dr5+FuMQk7jwu91J1E4urLqiWNMp8sAYY6MZ1iQjQfExArQ9v8t lWCQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=RxVaUqy805vFZxwPXegPV458xblrihOk0oogxYorawM=; fh=8D5h6+1EpcaTnR5Qc0gRPcwMpDm4R6G4O+OlJ7x+Rm0=; b=tJ8hOwMSxptYmIyWFTJb01tzVyijyygGnHCC/bTpwfUm3QyiwctCZxyuYGyhgNgDzc NXLSb3kdAMgmn3vC0Fw8yjwrXVn9PyLN7RRJdeXkwdnAlxkRCB7aSwRG9yqz/9otiwsz PQljl4JpEQa+p8EoPQQ3KNafC2bFlkwyD5LQUJ8VDhPdGpgvZ051NX3CAeuBwBuu+Ysx mhhVYzpgoWw/PtJIpFebrkVTpoXuJ7ciyPyKAk/FtHWxINQvNnV3sOjMYVKLH1fj0Hhq grXhW+SNtSG17/kmLs2QpN7QvTksJNnJiTYTUBDZiiK6xh6xn6FIr/POOLOqF/ZxDWiT z3TQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-46606-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46606-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=1; AJvYcCWNfW09M6aWYvDervWQW3m3MoUdGbYPhhgF8BE2ZVuVW7izLiPRUHJC8FrCdNDd+nwR0PXLNXs6+TZ8mCMbqoskWdOBujbgD/yh04akUA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id dy9-20020a05640231e900b0055cc4414112si5830183edb.590.2024.01.31.06.29.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 06:29:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46606-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-46606-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46606-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 197B91F22CC4 for ; Wed, 31 Jan 2024 14:29:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 87EA08288F; Wed, 31 Jan 2024 14:29:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3136980C0F; Wed, 31 Jan 2024 14:29:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706711389; cv=none; b=nl0cayCRJM2Z1WPhvBZrk+FehynzWQHBJZBk9hqyXHj1/TICeANpwOJlzyUqaF9VPRMcXFW5/svM4s4df8wa4VdKPbLKLU1roANUPxfUzlt0QHMGmM9QfizmRRfIKc1z2OGUf9uzlKzLakND8JyYZ9B94eguH3jyaoCRFzHgXnY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706711389; c=relaxed/simple; bh=S/jMeh1Aal/VzYnvxcTgPIKps4x8r9jVVeBusLeRDyk=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=tJY6bDMs7ziNxeLQZYtbDocVa/rluHkxf7oqmySD2HJ3MYmBVrBhbRl9PWfjPdUqEmC9Kgm9+CuiAEv2FVUFoDjJc3g/hlVUss8/IjlqQEch2bTtfOc6pzLGbIInkaNx9xmFxbRY7fMBxzhq8pe6xtIJFo0WvuYJzCJ0ggtVssc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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; >