Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2028667rwb; Thu, 17 Nov 2022 05:44:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf7ZhHAoZU2YFJgiBKtAz05/afOQY72vsJMIALqF8r2FdcgGh/OG6HHyVcETy6w8OVFOLRyR X-Received: by 2002:a17:906:9419:b0:783:71d1:14a0 with SMTP id q25-20020a170906941900b0078371d114a0mr2197133ejx.430.1668692658840; Thu, 17 Nov 2022 05:44:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668692658; cv=none; d=google.com; s=arc-20160816; b=AD0rOraiEyUr8kJmWZfmVkKThEOi58dl2QObBcuaS3eLbVk681CFpIE93tDq6d/iyn /USDRZy1mGtvTvEQxEjpTQoqrNIRVn9EBuObWDEiKJfK8ziSHKFvNNU2UVCMdaSevKdl JXk29ZYSfHKBIa/4YIfGH9lAR172aNLcQo6qmFAgPXbZhEhJVvRH99W9CGKUNGLK+zqn O8103JRjg3KFR4oVsPO2g61e5huslL10rCaeyr6VmxBTXE6eycjEsSR2criNjOxT4ES5 juSC8DgglrHLRVI6iUXjzpjtkjHN6SVhpLS5U6aQeGMY0pnJ7rkUzQZ2f1GqAk9N5GeF EQ8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=YmSrTbF7mi7seg0LVz4S6nOfLp2US9mpydX0av+jdp8=; b=dpCqwg38+YAkA015+Kpn9IwkvJl+0A/3tO3DafBR5GaK/sqG+0zbcMJ+NVcHLLeU4k EA0VFLOKmz6HdaI2fyAB4P4/YZaGuvXxktxpHBoMsp54V6e6hf22HG/QCv1ge/LyLmiT LctRxLpgbgVFznBK5Vq3Elov/X9HoW5y1fAd+m6KS26znNvvbTXI1uQTB97o9TSJcTJZ tZgzgDobGE6Axe7dLKaTZQfiEv2CiCfC4Ar23B4yqlhHpO5sk2P3HFHR4f5AjN+jFAl2 KA8E6DlcHeRxrxGshrHGIZe7c2ec00ZnX3MVxgBvT2Ecr6ABenqkja8vi0rDMAcs8sB/ AcdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n11-20020a170906118b00b007ae4717bf1esi524502eja.99.2022.11.17.05.43.56; Thu, 17 Nov 2022 05:44:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234862AbiKQNXb (ORCPT + 92 others); Thu, 17 Nov 2022 08:23:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234870AbiKQNX2 (ORCPT ); Thu, 17 Nov 2022 08:23:28 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D310D133; Thu, 17 Nov 2022 05:23:23 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BE1A81424; Thu, 17 Nov 2022 05:23:29 -0800 (PST) Received: from bogus (unknown [10.57.6.137]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B262E3F663; Thu, 17 Nov 2022 05:23:21 -0800 (PST) Date: Thu, 17 Nov 2022 13:23:19 +0000 From: Sudeep Holla To: Manivannan Sadhasivam Cc: andersson@kernel.org, viresh.kumar@linaro.org, Sudeep Holla , krzysztof.kozlowski+dt@linaro.org, rafael@kernel.org, robh+dt@kernel.org, johan@kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH v7 0/4] qcom-cpufreq-hw: Add CPU clock provider support Message-ID: <20221117132319.cx7cwt3dwywlt6wx@bogus> References: <20221117053145.10409-1-manivannan.sadhasivam@linaro.org> <20221117101903.sw3hxaruj5sfhybw@bogus> <20221117111207.GA93179@thinkpad> <20221117115203.356vexlpca746o6m@bogus> <20221117115807.GF93179@thinkpad> <20221117120846.yhmilsndw2bmmvnv@bogus> <20221117123841.GI93179@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221117123841.GI93179@thinkpad> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 17, 2022 at 06:08:41PM +0530, Manivannan Sadhasivam wrote: [...] > > AFAIK, OPP framework needs to know the current frequency of the device it is > dealing with for setting the device's OPP. So it uses clk_get_rate() of the > first clock of the device. If the clock is not available, then it uses the > frequency in the first entry of the OPP table (since it is going to be the > minimum freq of the device). > It has been a while since I followed OPP. Thanks for all the info, helped me get updated without looking at the code in detail. > As you can see, the clk_get_rate() is eminent for switching the OPPs and since > OPP framework doesn't know what device it is dealing with, it cannot use > cpufreq_get(). > Agreed. I had assumed the qcom-cpufreq-hw as setting cpufreq directly pocking the hardware but now I see it is using opp library to set some additional policy. > Is SCMI node itself has the OPP tables? Or the consumer nodes of the SCMI? > No, OPPs are read from the f/w and we just use OPP APIs to register them. But we don't use OPP library to set the performance. > TLDR; If you tell OPP framework to set a new OPP for a device, it needs to the > know the current frequency of the device. And it is not manadatory now, but in > the future maybe. > Hmm, good to know. I prefer it is not coupled with clocks and have some alternative mechanism that is suitable for performance domains and don't enforce the use of clock bindings and clk framework unnecessarily. -- Regards, Sudeep`