All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Johan Hovold <johan@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Dmitry Osipenko <digetx@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	MyungJoo Ham <myungjoo.ham@samsung.com>,
	Nishanth Menon <nm@ti.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Stephen Boyd <sboyd@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Viresh Kumar <vireshk@kernel.org>,
	linux-pm@vger.kernel.org,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	devicetree@vger.kernel.org,
	Dmitry Osipenko <dmitry.osipenko@collabora.com>,
	linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,
	Rob Herring <robh@kernel.org>
Subject: Re: [PATCH V2 00/13] OPP: Add support for multiple clocks*
Date: Tue, 12 Jul 2022 17:55:41 +0530	[thread overview]
Message-ID: <20220712122541.GA21746@workstation> (raw)
In-Reply-To: <20220712075240.lsjd42yhcskqlzrh@vireshk-i7>

On Tue, Jul 12, 2022 at 01:22:40PM +0530, Viresh Kumar wrote:
> On 11-07-22, 18:40, Johan Hovold wrote:
> > This break OPP parsing on SC8280XP and hence cpufreq and other things:
> > 
> > [  +0.010890] cpu cpu0: _opp_add_static_v2: opp key field not found
> > [  +0.000019] cpu cpu0: _of_add_opp_table_v2: Failed to add OPP, -19
> > [  +0.000060] cpu cpu0: _opp_is_duplicate: duplicate OPPs detected. Existing: freq: 300000000, volt: 576000, enabled: 1. New: freq: 403200000, volt: 576000, enabled: 1
> > [  +0.000030] cpu cpu0: _opp_is_duplicate: duplicate OPPs detected. Existing: freq: 300000000, volt: 576000, enabled: 1. New: freq: 499200000, volt: 576000, enabled: 1
> > ...
> > 
> > I just did a rebase on next-20220708 and hit this.
> > 
> > I've narrowed it down to _read_rate() now returning -ENODEV since
> > opp_table->clk_count is zero.
> > 
> > Similar to what was reported for tegra for v1:
> > 
> > 	https://lore.kernel.org/all/58cc8e3c-74d4-e432-8502-299312a1f15e@collabora.com/
> > 
> > I don't have time to look at this any more today, but it would we nice
> > if you could unbreak linux-next.
> > 
> > Perhaps Bjorn or Mani can help with further details, but this doesn't
> > look like something that is specific to SC8280XP.
> 
> It is actually. This is yet another corner case, Tegra had one as
> well.
> 
> I have tried to understand the Qcom code / setup to best of my
> abilities, and the problem as per me is that qcom-cpufreq-hw doesn't
> provide a clk to the OPP core, which breaks it after the new updates
> to the OPP core. I believe following will solve it. Can someone please
> try this ? I will then merge it with the right commit.
> 

I gave it a shot on Lenovo X13s based on SC8280 SoC and it fixes the OPP
issue. So you can add,

Tested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Thanks,
Mani

> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
> index 666e1ebf91d1..4f4a285886fa 100644
> --- a/drivers/opp/core.c
> +++ b/drivers/opp/core.c
> @@ -1384,6 +1384,20 @@ static struct opp_table *_update_opp_table_clk(struct device *dev,
>         }
> 
>         if (ret == -ENOENT) {
> +               /*
> +                * There are few platforms which don't want the OPP core to
> +                * manage device's clock settings. In such cases neither the
> +                * platform provides the clks explicitly to us, nor the DT
> +                * contains a valid clk entry. The OPP nodes in DT may still
> +                * contain "opp-hz" property though, which we need to parse and
> +                * allow the platform to find an OPP based on freq later on.
> +                *
> +                * This is a simple solution to take care of such corner cases,
> +                * i.e. make the clk_count 1, which lets us allocate space for
> +                * frequency in opp->rates and also parse the entries in DT.
> +                */
> +               opp_table->clk_count = 1;
> +
>                 dev_dbg(dev, "%s: Couldn't find clock: %d\n", __func__, ret);
>                 return opp_table;
>         }
> 
> -- 
> viresh

  reply	other threads:[~2022-07-12 12:26 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-05  7:00 [PATCH V2 00/13] OPP: Add support for multiple clocks* Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 01/13] OPP: Use consistent names for OPP table instances Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 02/13] OPP: Remove rate_not_available parameter to _opp_add() Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 03/13] OPP: Reuse _opp_compare_key() in _opp_add_static_v2() Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 04/13] OPP: Make dev_pm_opp_set_opp() independent of frequency Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 05/13] dt-bindings: opp: accept array of frequencies Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 06/13] OPP: Allow multiple clocks for a device Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 07/13] OPP: Compare bandwidths for all paths in _opp_compare_key() Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 08/13] OPP: Add key specific assert() method to key finding helpers Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 09/13] OPP: Assert clk_count == 1 for single clk helpers Viresh Kumar
2022-07-05 17:21   ` Krzysztof Kozlowski
2022-07-06  6:39     ` Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 10/13] OPP: Provide a simple implementation to configure multiple clocks Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 11/13] OPP: Allow config_clks helper for single clk case Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 12/13] PM / devfreq: tegra30: Register config_clks helper Viresh Kumar
2022-07-05  7:00 ` [PATCH V2 13/13] OPP: Remove dev{m}_pm_opp_of_add_table_noclk() Viresh Kumar
2022-07-07 19:43 ` [PATCH V2 00/13] OPP: Add support for multiple clocks* Dmitry Osipenko
2022-07-08  7:19   ` Viresh Kumar
2022-07-08  7:26     ` Dmitry Osipenko
2022-07-08  7:30       ` Dmitry Osipenko
2022-07-08  8:13         ` Viresh Kumar
2022-07-08  8:12       ` Viresh Kumar
2022-07-08 16:15         ` Dmitry Osipenko
2022-07-11 16:40 ` Johan Hovold
2022-07-12  7:52   ` Viresh Kumar
2022-07-12 12:25     ` Manivannan Sadhasivam [this message]
2022-07-12 14:29     ` Johan Hovold
2022-07-12 15:10       ` Viresh Kumar
2022-07-12 15:55         ` Johan Hovold
2022-07-13  6:55           ` Viresh Kumar

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=20220712122541.GA21746@workstation \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=cw00.choi@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=digetx@gmail.com \
    --cc=dmitry.osipenko@collabora.com \
    --cc=johan@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=nm@ti.com \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    --cc=vireshk@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.