linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <mani@kernel.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>,
	Andy Gross <agross@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Johan Hovold <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: [RFC PATCH 0/4] cpufreq: qcom-hw: Move clocks to CPU node
Date: Fri, 15 Jul 2022 21:39:33 +0530	[thread overview]
Message-ID: <20220715160933.GD12197@workstation> (raw)
In-Reply-To: <cover.1657695140.git.viresh.kumar@linaro.org>

On Wed, Jul 13, 2022 at 12:22:55PM +0530, Viresh Kumar wrote:
> Hi,
> 
> A recent patch series, targeting enhancements in the OPP core, ended up breaking
> cpufreq on some of the Qualcomm platforms [1]. Necessary adjustments are made in
> the OPP core, a bit hacky though, to get it working for now but it would be
> better to solve the problem at hand in a cleaner way. And this patchset is an
> attempt towards the same.
> 
> cpufreq-hw is a hardware engine, which takes care of frequency
> management for CPUs. The engine manages the clocks for CPU devices, but
> it isn't the end consumer of the clocks, which are the CPUs in this
> case.
> 
> For this reason, it looks incorrect to keep the clock related properties
> in the cpufreq-hw node. They should really be present at the end user,
> i.e. the CPUs.
> 
> The case was simple currently as all the devices, i.e. the CPUs, that
> the engine manages share the same clock names. What if the clock names
> are different for different CPUs or clusters ? How will keeping the
> clock properties in the cpufreq-hw node work in that case ?
> 
> This design creates further problems for frameworks like OPP, which
> expects all such details (clocks) to be present in the end device node
> itself, instead of another related node.
> 
> This patchset moves the clock properties to the node that uses them instead,
> i.e. the CPU nodes and makes necessary adjustments at other places.
> 
> After this is applied, I can drop the unnecessary change from the OPP core, but
> I wanted to discuss if this is a step in the right direction or not first and so
> the RFC.
> 

The clocks defined in the devicetree currently (CXO, GPLL) are the source
clocks of the EPSS block (cpufreq-hw). And EPSS will supply clock and
voltage through other blocks to the CPU domains. Even though the end
consumer of the source clocks are the CPUs, those clocks are not
directly reachign the CPUs but instead through some other blocks in EPSS.

Initially I was temped to add cpufreq-hw as the clock provider and have
it source clocks to the individual CPUs. This somehow models the clock
topology also, but after having a discussion with Bjorn we concluded that
it is best to leave it as it is.

The main issue that Bjorn pointed out was the fact that the clocks coming
out of EPSS are not exactly of the same frequency that was requested.
EPSS will do its own logic to generate the clocks to the CPUs based on
the input frequency vote and limits.

Thanks,
Mani

> --
> Viresh
> 
> [1] https://lore.kernel.org/lkml/YsxSkswzsqgMOc0l@hovoldconsulting.com/
> 
> Viresh Kumar (4):
>   dt-bindings: cpufreq-qcom-hw: Move clocks to CPU nodes
>   arm64: dts: qcom: Move clocks to CPU nodes
>   cpufreq: qcom-cpufreq-hw: Clocks are moved to CPU nodes
>   cpufreq: qcom-cpufreq-hw: Register config_clks helper
> 
>  .../bindings/cpufreq/cpufreq-qcom-hw.yaml     | 31 ++++----
>  arch/arm64/boot/dts/qcom/sc7180.dtsi          | 19 ++++-
>  arch/arm64/boot/dts/qcom/sc7280.dtsi          | 18 ++++-
>  arch/arm64/boot/dts/qcom/sdm845.dtsi          | 19 ++++-
>  arch/arm64/boot/dts/qcom/sm6350.dtsi          | 18 ++++-
>  arch/arm64/boot/dts/qcom/sm8150.dtsi          | 19 ++++-
>  arch/arm64/boot/dts/qcom/sm8250.dtsi          | 18 ++++-
>  arch/arm64/boot/dts/qcom/sm8350.dtsi          | 19 ++++-
>  arch/arm64/boot/dts/qcom/sm8450.dtsi          | 18 ++++-
>  drivers/cpufreq/qcom-cpufreq-hw.c             | 75 ++++++++++++++-----
>  10 files changed, 199 insertions(+), 55 deletions(-)
> 
> -- 
> 2.31.1.272.g89b43f80a514
> 

  parent reply	other threads:[~2022-07-15 16:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13  6:52 [RFC PATCH 0/4] cpufreq: qcom-hw: Move clocks to CPU node Viresh Kumar
2022-07-13  6:52 ` [RFC PATCH 1/4] dt-bindings: cpufreq-qcom-hw: Move clocks to CPU nodes Viresh Kumar
2022-07-18 20:46   ` Rob Herring
2022-07-19  4:19     ` Viresh Kumar
2022-07-13  6:52 ` [RFC PATCH 2/4] arm64: dts: qcom: " Viresh Kumar
2022-07-13  6:52 ` [RFC PATCH 3/4] cpufreq: qcom-cpufreq-hw: Clocks are moved " Viresh Kumar
2022-07-13  6:52 ` [RFC PATCH 4/4] cpufreq: qcom-cpufreq-hw: Register config_clks helper Viresh Kumar
2022-07-15 16:09 ` Manivannan Sadhasivam [this message]
2022-07-18  1:57   ` [RFC PATCH 0/4] cpufreq: qcom-hw: Move clocks to CPU node Viresh Kumar
2022-08-01  2:37     ` Viresh Kumar
2022-08-01  5:42       ` Manivannan Sadhasivam
2022-08-30  3:24       ` Bjorn Andersson
2022-08-30  5:40         ` Viresh Kumar
2022-08-30  6:20           ` Manivannan Sadhasivam
2022-09-20 10:28             ` Viresh Kumar
2022-09-26 11:34               ` Manivannan Sadhasivam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220715160933.GD12197@workstation \
    --to=mani@kernel.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=johan@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).