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 79998C5475B for ; Mon, 11 Mar 2024 05:36:30 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yK9iabrHsDOeQRjwfk3ClHOTKZBI4hd/HZY0wxDe5GM=; b=w19a1y++FY1ODZ /C5ftlJWgIBC+qbYqHEakWK4BAH/+Fg9lDGFfSXS11OZzWjQGv1ZNuhJir2Of5HivAdI+8mmncIVV OhnW3vBj2SLwTDWNCsGmXjya4MSmtV/pLiuJpRRrsTZRoBYuH0wpUO4aP/fTtM0hpHFB3QVFEfFq2 ATw8lVEW7PeH5X37zMBo5m8m/eePnYiDURjWJXEBG+07zchiLVGk+N2kE7U7eLuvDiPjDckrS2Nun IYn/7iNEq4t3ihkUdU2+UIINjm4lggA88AyqQhRldsoffdY3grTe+TsvEy+MtjmPOxL4cKvHJ9A8y zukgus+P8DYSl9X+ESdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rjYKc-00000000GZ2-1Y1T; Mon, 11 Mar 2024 05:36:14 +0000 Received: from fllv0016.ext.ti.com ([198.47.19.142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rjYKY-00000000GYY-3YGP for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2024 05:36:12 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 42B5ZtFf123009; Mon, 11 Mar 2024 00:35:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1710135355; bh=qGe6oJXNsXPQ21VUg3fd7qbxMx8WX1t9u9eCGiXOklc=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=jnaEBVz0LJhLvdiC5pJFJUxUL4uxRuAuhD+0tFww04vPDowNMazSxq9rLx9ANZx2T 7ziQgt9TQoyu0HBkEDpzWRCL/aADbiHD+1A4Kxy/X+dJarFq6DjlY4liGH5IWQXC+G SnrxZOaI0zR9I5YJjy43Ef6bAkuAh0pUMpdP1VHs= Received: from DLEE106.ent.ti.com (dlee106.ent.ti.com [157.170.170.36]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 42B5Ztmw023170 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 11 Mar 2024 00:35:55 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 11 Mar 2024 00:35:55 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 11 Mar 2024 00:35:55 -0500 Received: from localhost (dhruva.dhcp.ti.com [172.24.227.68]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 42B5Zsl4127577; Mon, 11 Mar 2024 00:35:54 -0500 Date: Mon, 11 Mar 2024 11:05:54 +0530 From: Dhruva Gole To: Sibi Sankar CC: , , , , , , , , , , , , , Subject: Re: [PATCH V3 1/2] firmware: arm_scmi: Add support for marking certain frequencies as boost Message-ID: <20240311053554.36j2rq3wgtswwoom@dhruva> References: <20240308104410.385631-1-quic_sibis@quicinc.com> <20240308104410.385631-2-quic_sibis@quicinc.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240308104410.385631-2-quic_sibis@quicinc.com> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240310_223611_011102_1E0F0FDD X-CRM114-Status: GOOD ( 17.50 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mar 08, 2024 at 16:14:09 +0530, Sibi Sankar wrote: > All opps above the sustained level/frequency are treated as boost, so mark I know that we use the terms boost and turbo interchangeably however I would suggest to avoid confusion that we say "treated as turbo" just because the variable is called turbo. > 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 */ Same here, would be better to say "turbo" than boost. > + if (freq > sustained_freq) > + data.turbo = true; It's simple enough that we can write it as data.turbo = (freq > sustained_freq_khz*1000) ? true : false; We can avoid an additional variable and all the other code changes. -- Best regards, Dhruva Gole _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel