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 2DD5AC47077 for ; Wed, 17 Jan 2024 03:00:50 +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:From:References:CC:To:Subject: 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=mHTzBeNzz53yt8YfvMs7po8LNwdmyW/6EcMi5MEfZpY=; b=ZkZJlxXLaOSAaW ywwSYFouT6f6BoLRMFbye92ETR8yVecbVbZ9zzkJ+ZwefVxDW4sVdDXO1Q5SCVG2NsnjpxX7OQwnk oajEI4dLj3fy7CFau5NE9VfBWrygzKuP/UrKn2cmQQ+zwQtI56Is5jRv/HYMgWxJXwq/6J6dndSau NDoIuQHDqZwUtgsP4XobioLOa3mujNkDpNr7qrvAp96VofF3XmIBcmwIHWILT2Gek+xPjCQXa+tah OclvYzARIkBlZ4vd7yp5q/oLxhYS690QrUbfV717zq2tJpU+DRHg99BYQyfocd+qKwZfa9r8kYyKf ETXNlx+6mP9SE7Gl/7IQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rPwAC-00EGxt-0i; Wed, 17 Jan 2024 03:00:24 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rPwA9-00EGwb-0a for linux-arm-kernel@lists.infradead.org; Wed, 17 Jan 2024 03:00:22 +0000 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40H16Lwf020111; Wed, 17 Jan 2024 03:00:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=HLw4+Z1ecP3dMooOn4xJFlhUXZmcw9BpiM+2fDOjgXw=; b=CD 9EvpYkQZszXiaHT/txq10HKd9oypVyBH/Fn5j4H6tv41qzZkQ8Pab5y2beJTbvAo /xjwg0+AGEMfifOHzrUM+TZdCpK/y8twJLkdKBODkDtF4EhusAUFt9DTr/nwd6H9 yk4HftfaYFjOKogwJWgkn/Iy9Qd78bryHECbYrLp6YD3KPG93Dgs0jslLMOThONX brJj81pFKlve2GY/RrLL3C1d6X9hK4ogtTFhyDnBEUw/pzMmST7y3fKQ9JBwLVrY ppGQm5ZyDBUX9ShXD20ngw1oqMabTqlB+H24LFJxGzTf6a2H3mhraRkz3L/AiXep jaitvUxdBLJdEIiLs5Jw== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vnmq0jman-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jan 2024 03:00:02 +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 40H301QL011018 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jan 2024 03:00:01 GMT Received: from [10.131.33.37] (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, 16 Jan 2024 18:59:58 -0800 Message-ID: <0800860a-e090-153f-bbbd-1f7666b14fed@quicinc.com> Date: Wed, 17 Jan 2024 08:29:55 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 2/3] firmware: arm_scmi: Add perf_opp_xlate interface Content-Language: en-US To: Viresh Kumar CC: , , , , , , , References: <20240108140118.1596-1-quic_sibis@quicinc.com> <20240108140118.1596-3-quic_sibis@quicinc.com> <20240110072906.7vnqykkcw3rkhoxa@vireshk-i7> From: Sibi Sankar In-Reply-To: <20240110072906.7vnqykkcw3rkhoxa@vireshk-i7> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: cbyLFxNUivVLSbp6ELhXfzojiYWrbd1B X-Proofpoint-ORIG-GUID: cbyLFxNUivVLSbp6ELhXfzojiYWrbd1B X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-16_14,2024-01-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 priorityscore=1501 bulkscore=0 adultscore=0 suspectscore=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 mlxlogscore=999 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401170019 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240116_190021_340831_29BB132B X-CRM114-Status: GOOD ( 21.37 ) 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 On 1/10/24 12:59, Viresh Kumar wrote: > On 08-01-24, 19:31, Sibi Sankar wrote: >> Add a new perf_opp_xlate interface to the existing perf_ops to translate >> a given perf index to frequency. >> Hey Viresh, Thanks for taking time to review the series! >> This can be used by the cpufreq driver and framework to determine the >> throttled frequency from a given perf index and apply HW pressure >> accordingly. >> >> Signed-off-by: Sibi Sankar >> --- >> drivers/firmware/arm_scmi/perf.c | 21 +++++++++++++++++++++ >> include/linux/scmi_protocol.h | 3 +++ >> 2 files changed, 24 insertions(+) >> >> diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c >> index c167bb5e3607..f26390924e1c 100644 >> --- a/drivers/firmware/arm_scmi/perf.c >> +++ b/drivers/firmware/arm_scmi/perf.c >> @@ -964,6 +964,26 @@ static int scmi_notify_support(const struct scmi_protocol_handle *ph, u32 domain >> return 0; >> } >> >> +static int scmi_perf_opp_xlate(const struct scmi_protocol_handle *ph, u32 domain, >> + int idx, unsigned long *freq) >> +{ >> + struct perf_dom_info *dom; >> + >> + dom = scmi_perf_domain_lookup(ph, domain); >> + if (IS_ERR(dom)) >> + return PTR_ERR(dom); >> + >> + if (idx >= dom->opp_count) >> + return -ERANGE; >> + >> + if (!dom->level_indexing_mode) >> + *freq = dom->opp[idx].perf * dom->mult_factor; >> + else >> + *freq = dom->opp[idx].indicative_freq * dom->mult_factor; >> + >> + return 0; >> +} >> + >> static const struct scmi_perf_proto_ops perf_proto_ops = { >> .num_domains_get = scmi_perf_num_domains_get, >> .info_get = scmi_perf_info_get, >> @@ -979,6 +999,7 @@ static const struct scmi_perf_proto_ops perf_proto_ops = { >> .fast_switch_possible = scmi_fast_switch_possible, >> .power_scale_get = scmi_power_scale_get, >> .perf_notify_support = scmi_notify_support, >> + .perf_opp_xlate = scmi_perf_opp_xlate, > > The use of "opp" here is a bit confusing as this doesn't have anything to do > with the OPP framework and you are only getting the frequency out of it after > all. Sure will re-name it. -Sibi > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel