Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2084855rbb; Tue, 27 Feb 2024 10:05:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUms1UNmzLO1H66yEucMMggBTaoKCfRno0/IR+uSTNewPsJ+NN/7cy5lejEDlWf66Sv17RSQswcW/9IK5p6DEH62fF9aWFYwan0p+wevg== X-Google-Smtp-Source: AGHT+IFFDwUnr+1qZ8YhhvuH4+FpAp61SES27L6tRoRaHdOKNGXxvmOLGcnkz40VQFvfLSpOzm90 X-Received: by 2002:a17:902:d507:b0:1dc:b968:780e with SMTP id b7-20020a170902d50700b001dcb968780emr97747plg.33.1709057156752; Tue, 27 Feb 2024 10:05:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709057156; cv=pass; d=google.com; s=arc-20160816; b=yM3f9LFUkSsT9Ll/QNXJNVC9ZFu5ad8vFaL6fsMmuZ+n5Wfh+VNyZXaqvqLRgiCq9i nRtmNdp/tdII2vFZJT6MjJ2QcC8Sqrj74YVjvjY0hHvahlKJ9XFndywSCkit2zknvYAW F2gePCOTL3BeV2GFyLPBIjb46Dsjhkqy0FcKxqL7m41z16txhSOPriyxuW0vxPD9NN10 y9FaTW6pVg1GD+e2fUG+n2Up0Mm5LBAzDAdAxCDURdGc89sfZkt0sK+IRW0Du8EDhBNb jzeZ3ENChjYhukKQvxurB6HQgEOm4Pf1sQHrbOPBAWOWO1fj4vSwjOBFb3mF5SuuJ53n Ts2g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=3DVviJxlVwNwJ3tgr3xc9D3SdLGkFfeDO3OWztz/lP0=; fh=JXeAHL/pEiwIRpJuFmm5HWdAyyckOo6ArR8j/crYxoY=; b=klJ1zWEEqE4nrhZPj1zLhAVojg6vWV/I3JifSSrGV+rN5PTM+VW6USJT3US058b9OI CHcCkSkbb8yZVepDnSnEvS/M6uspkfsKS4KV/afzHI4YOuPKXTrwOH0iJ3hKzo0v2USE eI8C9xuK0EbnOhy/SLTisJq5bOtbwEFCv9CooXcllgqfvLLZTcGwEbnjTgkhEkUYJDkS KMbS9n3+wsqMUzap4rWnN2/Ph6CKF51cduRR5AHu7+4PU4sSABNkNtqblvJYCHSzrNwu CsQ5MDOhlQk1gzGvJIhngZpY48CNe7tDDv97OGBFJ5rl06UlFRWKE7cy4qVbM8DQ4G2O DZ5Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="MhnvY/Iw"; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-83739-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83739-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id k9-20020a170902ba8900b001dbe59ae03bsi1675324pls.402.2024.02.27.10.05.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 10:05:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83739-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="MhnvY/Iw"; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-83739-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83739-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id AD00BB33C23 for ; Tue, 27 Feb 2024 17:37:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D5C4514AD24; Tue, 27 Feb 2024 17:35:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="MhnvY/Iw" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6DD5149DF2; Tue, 27 Feb 2024 17:35:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709055324; cv=none; b=ArYT5oi+LHbTMyFVyH2WSUsPU76Wx4woLWhd9cjUmF7/zdrWSt6HutgTDdrvIuyf6ImgPjGkktrjGY5Qdu45Ajfzq1clt4IbYLqhnLh6u5nJemWBJUfO198OZUZkScUr9Mcc1TgLUImaSq2h4drDI7dW2fktqA9Yxawo62IP1S8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709055324; c=relaxed/simple; bh=Z5k2hix+Fr7+hFF9XlR19tkcXSwIfZLoKyOcbeHHkBE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=f+k6u/Bcz7u9AFtndU1FDJq7P0HYFTF0Laf85X39v93cQSXGVkobsMw3UVagFAygBCR0hLdYBYK2+MNPTgMlqwCwN634t3QlC8ChVyYMjLmTSUatTD7bnFnAtSQZpWFsKTRO9eSem0x2dF6yyfDC8fUTCG3GTKj7ixKESmLtMto= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=MhnvY/Iw; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41R9YUO1007412; Tue, 27 Feb 2024 17:35:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=3DVviJxlVwNwJ3tgr3xc9D3SdLGkFfeDO3OWztz/lP0=; b=Mh nvY/Iw1tO+NOxDIQYGcO+52fRBjG8UGGCk+Dv8XTgqvDGwt0VUcXcMKvLWVu8v17 oFawAwPNgZhpLlsP7srAagog3NF+/KLqS1IzWp5kWR9GMOvQiXd5Ykv8fIh6xyD9 Nn13axSbm5R+Uw8oY3xU0LDmR9xCWbgsCyYf8yU18S55QPzyW4mBND92XsgUf4jq 7uidfan8d24LDYFVtTkTcLmg58+XzkBmIUuDNl8rTCV4JVcqql3uCSviLULswgrw nPlm44rL7btjL3/z/FwpCRn4Ng7Ih7+h20P5ehBlrbF9S9DeDBuNyyCcjt9LZ3zj or7FyS5fhK97rhHEyr2A== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wh8auhtj7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Feb 2024 17:35:12 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41RHZC95029837 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Feb 2024 17:35:12 GMT Received: from hu-sibis-blr.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 27 Feb 2024 09:35:07 -0800 From: Sibi Sankar To: , , , , , , , CC: , , , , , , Sibi Sankar Subject: [PATCH V2 2/3] firmware: arm_scmi: Add support for marking certain frequencies as boost Date: Tue, 27 Feb 2024 23:04:33 +0530 Message-ID: <20240227173434.650334-3-quic_sibis@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240227173434.650334-1-quic_sibis@quicinc.com> References: <20240227173434.650334-1-quic_sibis@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 9dE-JkPRBvVKzooJpGHXh_vlnrL04KbW X-Proofpoint-GUID: 9dE-JkPRBvVKzooJpGHXh_vlnrL04KbW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-27_03,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 bulkscore=0 suspectscore=0 phishscore=0 malwarescore=0 mlxscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=999 clxscore=1015 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402270135 All opps above the sustained level/frequency are treated as boost, so mark them accordingly. Suggested-by: Sudeep Holla Signed-off-by: Sibi Sankar --- v2: * Remove sustained_freq check. [Pierre] * simplify sustained_freq_khz calculation. [Sudeep] drivers/firmware/arm_scmi/perf.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c index 981e327e63e3..caf6191df300 100644 --- a/drivers/firmware/arm_scmi/perf.c +++ b/drivers/firmware/arm_scmi/perf.c @@ -850,7 +850,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; @@ -858,12 +858,18 @@ static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph, if (IS_ERR(dom)) return PTR_ERR(dom); + sustained_freq = dom->sustained_freq_khz * 1000UL; + 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 (freq > sustained_freq) + data.turbo = true; + data.level = dom->opp[idx].perf; data.freq = freq; -- 2.34.1