Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp203909lql; Sun, 10 Mar 2024 22:36:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVCNV6OmIciI4CJoL9OfCRwTDp+/gc2QQ6QOC8flkFahb7/M0uNA/tVvy+onzyiJKq1aGaoC+imFT9dSElhE5rCx2yla7ipKdPrStlhYg== X-Google-Smtp-Source: AGHT+IHrmKIdZJeTcU65Z1DWommrXWe5jFYwZza+qO0GSuS1vbw4qpK7WI4o14KhjhhHfqYWVLZp X-Received: by 2002:a17:907:8744:b0:a46:2623:7525 with SMTP id qo4-20020a170907874400b00a4626237525mr1367218ejc.20.1710135391815; Sun, 10 Mar 2024 22:36:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710135391; cv=pass; d=google.com; s=arc-20160816; b=gH2ULR2idEVeF+yU+9OPuzKFdUyLJg+bCdEPNWhUB0MI8skAFOafnGlQPRkBDn2yBe NwLgjohrGggXpsjGgtdFzIfAlnp6BARAprcpqCE4c7ozEeljsAflh17RJ3EdQB+UC2fv l+E+PIEZhfM2WmjfnIc4pogYzYI8XkYGz7xHzWSNOPf9JMIP+87VWo4MiJYw8keTGFgu bKm/9O+Q+j/+nLR/MJK8g8wuRQtM3hqLNzuwfLF53rc9WdAg8hDiF5uIa6rJX8Acm3L+ FHzbo0LNT6xj/o+/MN2zf73JCdq9/gSp9xrILBGWBaPKIEScachZqzMz0RwdToB5V/kp stTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qGe6oJXNsXPQ21VUg3fd7qbxMx8WX1t9u9eCGiXOklc=; fh=goZruEZGdgAFdO9K0fpc4eOCAOxBssJQ5meFbnZOl0I=; b=UEQpqhktNKCS9RwMZHSAM8SjkhjNTK8z9a9XVpChc2eIRKs4ccTkilS7qrIQ8u44JF F/Ac3ZK+80YsgMMn4ftZX+PS6NYHe3QbofbF/op2SW1uVqt6n+JVoTXVjejMplmkYs9O G4JP3222tnJx65Q0htHgnAyxhc4Fed7ng2JGIwryTcnOa+Tn5tRM/hdz/P3HFZAM+CVL mv7H+iENgUwf82wKsXW27Re9mcVVE2VLISeLkzMqhX8+gGqHJmF0N0EJMCOE/+Hb6BZS V7LNe8qtCqOy2c0RdJM2Omrx8kQ6qvlPeJiOMqooxWoSBmAf5n+6MevP8fvKuppvHg9/ BMgA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=jnaEBVz0; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-98481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98481-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.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 lx11-20020a170906af0b00b00a442dbaf1a9si2165096ejb.52.2024.03.10.22.36.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 22:36:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98481-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=@ti.com header.s=ti-com-17Q1 header.b=jnaEBVz0; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-98481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98481-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.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 8A99E1F218DE for ; Mon, 11 Mar 2024 05:36:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A340B65E; Mon, 11 Mar 2024 05:36:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="jnaEBVz0" Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (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 DC71DF9CC; Mon, 11 Mar 2024 05:36:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710135381; cv=none; b=UpYKIHOp6bKtmh3IrFe6F8i1aAnz75gwL4oGB/sW+yNBdFycOfBP7AVRsqWH5FQQRJnbXfQiM1f0zTEmCtGmn3awyIcgGfZ57rZHWkAzWDXl+8RRH57mP98N9JGgKxAGj1zgAB2mWP2C5HIzHKJCw5QUZDjLO+QleI6QucAbEKA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710135381; c=relaxed/simple; bh=3s7VpcFiH+fbWcBakEtyV9bW10w7EJ7btYuoFKhJ59g=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AY29lDjfg+n94uvu6a3+DLBvQ5rCjuP77v1N7DSBVW7D2M2tcC3tzcyoR9RcTz+VMFf9WjWiWRGW28Iy3Xd/cvB2T0l1ZnWv+AnWw44iA0Ke9dGv2VbNKSQe50VdGaTMuRnCCb2m41lM1LLoR/2cJ1KcSnm2OE6ffIpT0SuXjMY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=jnaEBVz0; arc=none smtp.client-ip=198.47.19.142 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240308104410.385631-2-quic_sibis@quicinc.com> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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