From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
grahamr@codeaurora.org, linux-clk <linux-clk@vger.kernel.org>,
Linux PM <linux-pm@vger.kernel.org>,
Stephen Boyd <sboyd@kernel.org>,
Mike Turquette <mturquette@baylibre.com>,
Doug Anderson <dianders@chromium.org>,
Taniya Das <tdas@codeaurora.org>,
Rajendra Nayak <rnayak@codeaurora.org>,
Amit Nischal <anischal@codeaurora.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Amit Kucheria <amit.kucheria@linaro.org>
Subject: Re: [RFD] Voltage dependencies for clocks (DVFS)
Date: Wed, 4 Jul 2018 14:54:18 +0200 [thread overview]
Message-ID: <CAJZ5v0gFJiHcUke4EntF76Rudo7DrOb5_61Qf-U8-z50zDEqeQ@mail.gmail.com> (raw)
In-Reply-To: <CAPDyKFo-Z=H2mJXm7mN0Mt=iRzOaEuJSXc2gdE4i5NEfZ_OM6A@mail.gmail.com>
On Wed, Jul 4, 2018 at 2:50 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> [...]
>
>>> The third problem is that semantically using OPP for requesting
>>> specific functional frequencies (i.e. for a serial bus) is an abuse of that
>>> framework. It requires the clients to find the "performance level" that
>>> matches the specific frequency they require, then request that performance
>>> level - when what they really want is to "set rate" on the clock to a
>>> specific, known, frequency.
>>
>> This is the prototype of that routine:
>>
>> int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq);
>>
>> All we need is the target frequency and not an OPP.
>>
>> Maybe we can solve the problems you raised with the OPP core like
>> this:
>>
>> - On a call to dev_pm_opp_set_rate(), we check the currently cached
>> frequency value. If it is unknown or 0, we call clk_enable() as
>> well..
>>
>> - When the drivers want things to shut down, they call
>> dev_pm_opp_set_rate(dev, 0) and on this we drop regulator vote, etc,
>> and call clk_disable().
>>
>> Will that be acceptable to everyone ?
>
> For a cross SoC driver, the device may not be hooked up to an OPP
> table. Then it needs to manage the clock anyways. I guess we can do
> that for those cases that needs it.
>
> Another option is to use the ->runtime_suspend|resume() callbacks at
> the genpd level. In principle when the device enters runtime suspend,
> genpd can decide to drop the votes for the device (if some exist). At
> runtime resume, genpd then should re-store the votes for the device it
> had before it became runtime suspended (or if the vote became updated
> in-between).
>
> In that way, the driver only needs to call dev_pm_opp_set_rate() when
> it calls clk_set_rate().
You'd need that for system-wide PM too I guess.
Thanks,
Rafael
next prev parent reply other threads:[~2018-07-04 12:54 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-18 20:44 [RFD] Voltage dependencies for clocks (DVFS) grahamr
2018-07-02 5:13 ` Michael Turquette
2018-07-04 6:55 ` Viresh Kumar
2018-07-04 12:50 ` Ulf Hansson
2018-07-04 12:54 ` Rafael J. Wysocki [this message]
2018-07-04 12:58 ` Ulf Hansson
2018-07-20 17:12 ` Stephen Boyd
2018-07-20 17:56 ` Michael Turquette
2018-07-24 23:13 ` Stephen Boyd
2018-07-25 5:51 ` Michael Turquette
2018-07-23 8:26 ` Peter De Schrijver
2018-07-24 23:04 ` Stephen Boyd
2018-07-25 5:44 ` Michael Turquette
2018-07-25 11:27 ` Peter De Schrijver
2018-07-25 18:40 ` Michael Turquette
2018-07-31 11:56 ` Ulf Hansson
2018-07-31 20:02 ` grahamr
2018-08-23 13:20 ` Ulf Hansson
2018-09-18 23:00 ` Michael Turquette
2018-09-19 7:05 ` Geert Uytterhoeven
2018-09-19 18:07 ` Michael Turquette
2018-09-25 13:11 ` Geert Uytterhoeven
2018-09-25 13:11 ` Geert Uytterhoeven
2018-09-25 21:26 ` grahamr
2018-09-25 21:26 ` grahamr
2018-10-01 19:00 ` Michael Turquette
2018-10-04 0:37 ` Graham Roff
2018-10-04 21:23 ` Michael Turquette
2018-09-18 17:25 ` Kevin Hilman
2018-08-03 23:05 ` Michael Turquette
2018-08-23 12:13 ` Ulf Hansson
2018-09-18 22:48 ` Michael Turquette
2018-07-31 10:35 ` Ulf Hansson
2018-08-03 21:11 ` Michael Turquette
2018-08-23 11:10 ` Ulf Hansson
2018-07-05 8:19 ` Peter De Schrijver
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=CAJZ5v0gFJiHcUke4EntF76Rudo7DrOb5_61Qf-U8-z50zDEqeQ@mail.gmail.com \
--to=rafael@kernel.org \
--cc=amit.kucheria@linaro.org \
--cc=anischal@codeaurora.org \
--cc=dianders@chromium.org \
--cc=grahamr@codeaurora.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=rnayak@codeaurora.org \
--cc=sboyd@kernel.org \
--cc=tdas@codeaurora.org \
--cc=ulf.hansson@linaro.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).