Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp463342lqc; Fri, 8 Mar 2024 02:45:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWrjrsbaNkq3PFA5suikYIiUu5Ed0pEbs9MoUqMvrCSHFnNT0k9oF2yn0YHyPv0uHMm6ZZj4okhx4as/QHklBGVaGgtilDOJL9sviwzsw== X-Google-Smtp-Source: AGHT+IEt6cCJ0aQqFn+C1/p/8T6RAZeE7aW59kERA1KodfOTId+rABLkurgd09EYSHrOLanuftNx X-Received: by 2002:a17:906:3c4f:b0:a3e:b523:90b with SMTP id i15-20020a1709063c4f00b00a3eb523090bmr14720871ejg.14.1709894731156; Fri, 08 Mar 2024 02:45:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709894731; cv=pass; d=google.com; s=arc-20160816; b=szA6pW6viDqLFAiucpx4QuUqNoivptLx+RxG9LjSs422T6DiiPgzJJRXR3Je6VKjoG DEC8jLEO3tzVYz3e2qKFPDFmqHizdkQXcYfUtS5m4OjTiuXDlK/8Yj7mNVTQEe2d3UtC jKarEH0U7mX00g/5gEyT7MaLU1eucCPCRxqlXOvSz/HvjYG9mcpaUnjjAmMNkEOT/SXi G1WyZ/SCHdgFkORjQV0umJgg4UsJl5IhvjChDVxTIjoHpz/LoaKBCyXlMDaOIyiCHsaQ BJ+cRKOTv5t7Z6Ws9WoFQLt6LqFTK/4anaZ7Xmsv6rcCyZWxoyHaeC7PwnjmyLIilP+/ Qzbg== 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=d344LokFw21DJ9Lbpn/kI0fNPTZBlloPOPgr9EjnZR0=; fh=JXeAHL/pEiwIRpJuFmm5HWdAyyckOo6ArR8j/crYxoY=; b=KTOr+d4YBw3qBpfyizYrZhsUWoSPkUOGa/E4WcWu8MzlHSFNzvVGnZ8r6QAH2chGdk dQXmBl88Xa68RpJkzpWfTvfiWxf/r1muTSrzL7JPyjJPzfeNJHQCDxi9TgbFRoJGi1/E TazOosOZf3FBefLd/tKd83FooghuYEamR2f+EhY5kkCfzwL2/18I+mFE8GvQd+tyZp4Y C7WBiHucRlnzL4jahFEDLtEvYS8lrHe6fqtsAOMNUQt9NRfeItgGHpG2asVU9CqWln+9 r+JzVpYDIG6zkWoycWCt4XeLSQxTl+TNmZ7BnzADW4ve57v5OEZwknAExZDhw75I1XXK SDaw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=YxCGjH+i; 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-96865-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96865-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ht20-20020a170907609400b00a45ef5a6eadsi427726ejc.914.2024.03.08.02.45.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 02:45:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96865-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=YxCGjH+i; 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-96865-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96865-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 am.mirrors.kernel.org (Postfix) with ESMTPS id DD5DB1F23614 for ; Fri, 8 Mar 2024 10:45:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C0D654FB0; Fri, 8 Mar 2024 10:44:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="YxCGjH+i" 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 1C83B55E7F; Fri, 8 Mar 2024 10:44:42 +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=1709894684; cv=none; b=MhPe37Z5yzTFrPS+kZhiMyDU9USXdAyIRSsSGyFOBj2HncqTWa0FXkavUr9dPemtuNzCHMIK81By08xHGEuzLOPPNvFYKt9MaXE2kDX1rm6rtrt4ARhplosSuVD+LQ4lxeDJd70MHVAtlMj0GLQDAjwLYCzqxrvmJO9uKHxif5k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709894684; c=relaxed/simple; bh=gAe0pcZUVaevDBhA3QRadyH5XevFjPm3rg7pQUFFEFg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TEC3WGBqUF4fYhq2NG5JjNFcwlDCDYGESkhYjflvoABuzmeNEUizEjOLmm8PYL8jXbKLT49PWav6WizNNXANOGoN0QELjKraS2Y9HF8itKjd2ljg/wkoMcHo+F+rzDdAWB8+EqoxYNxv1hjZaZaNtq1FrJtNtLM6rpJ2VYnfAW4= 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=YxCGjH+i; 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 (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4289GHoH005419; Fri, 8 Mar 2024 10:44:34 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=d344LokFw21DJ9Lbpn/kI0fNPTZBlloPOPgr9EjnZR0=; b=Yx CGjH+iGEWyxtSHNsqC5tO978sChNgfTYifJRitUHIQkEUPIOmQDNhKm8zZp/UIqO 9/r+Xn/hgDDklqIixriV8+1U9OJ/RGWV4T+8otbeX6wSehUi5+LGLGS+Lrq1PeqY 1f15xwQeTNslsfgRX3mt10sxvsu5IndaIUyOtujZsvJOpm94tdmeCWok8vYW+TH5 Kof5WTZVnndxNBmBZyxzLfhnsQUirCtUJqrF8sf5tDR76FR04zARmenwXMwzxShe 8C8yoIP/vmEEmRtp0MrRKXLWfXj5l1UwSIPhtrV/fZQr1TojMYZtvYHqUGjQYTEO HYn4wXzxnv+EC4wZbcBA== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wqn8m1gqy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Mar 2024 10:44:34 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 428AiXCi016061 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 8 Mar 2024 10:44:33 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; Fri, 8 Mar 2024 02:44:29 -0800 From: Sibi Sankar To: , , , , , , , CC: , , , , , , Sibi Sankar Subject: [PATCH V3 1/2] firmware: arm_scmi: Add support for marking certain frequencies as boost Date: Fri, 8 Mar 2024 16:14:09 +0530 Message-ID: <20240308104410.385631-2-quic_sibis@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240308104410.385631-1-quic_sibis@quicinc.com> References: <20240308104410.385631-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-GUID: NGfTKoolwkDAB1FLJfho2DJcLiAlbU7x X-Proofpoint-ORIG-GUID: NGfTKoolwkDAB1FLJfho2DJcLiAlbU7x 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-03-08_08,2024-03-06_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 phishscore=0 spamscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=999 impostorscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403080085 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 | 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 8e832d1ad825..64d9a90bf443 100644 --- a/drivers/firmware/arm_scmi/perf.c +++ b/drivers/firmware/arm_scmi/perf.c @@ -857,7 +857,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; @@ -865,12 +865,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