[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJMQK-h2R5s6rWWjr1YHO1jqZdtBkT3LYjcVg4QNMUuXJSiMTg@mail.gmail.com>
Date: Wed, 16 Jun 2021 14:25:51 +0800
From: Hsin-Yi Wang <hsinyi@...omium.org>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: "Viresh Kumar )" <vireshk@...nel.org>,
Chanwoo Choi <cw00.choi@...sung.com>,
Nishanth Menon <nm@...com>, Stephen Boyd <sboyd@...nel.org>,
Linux PM <linux-pm@...r.kernel.org>,
lkml <linux-kernel@...r.kernel.org>,
"andrew-sh . cheng" <andrew-sh.cheng@...iatek.com>
Subject: Re: [PATCH] opp: of: Allow lazy-linking of required-opps to non genpd
On Wed, Jun 16, 2021 at 1:58 PM Viresh Kumar <viresh.kumar@...aro.org> wrote:
>
> On 16-06-21, 13:33, Hsin-Yi Wang wrote:
> > Don't limit required_opp_table to genpd only. One possible use case is
> > cpufreq based devfreq governor, which can use required-opps property to
> > derive devfreq from cpufreq.
> >
> > Suggested-by: Chanwoo Choi <cw00.choi@...sung.com>
> > Signed-off-by: Hsin-Yi Wang <hsinyi@...omium.org>
> > ---
> > This is tested with the non genpd case mt8183-cci with passive
> > governor[1].
> > [1] https://patchwork.kernel.org/project/linux-mediatek/patch/1616499241-4906-2-git-send-email-andrew-sh.cheng@mediatek.com/
> > ---
> > drivers/opp/of.c | 20 +-------------------
> > 1 file changed, 1 insertion(+), 19 deletions(-)
> >
> > diff --git a/drivers/opp/of.c b/drivers/opp/of.c
> > index aa75a1caf08a3..9573facce53a5 100644
> > --- a/drivers/opp/of.c
> > +++ b/drivers/opp/of.c
> > @@ -201,17 +201,6 @@ static void _opp_table_alloc_required_tables(struct opp_table *opp_table,
> > lazy = true;
> > continue;
> > }
> > -
> > - /*
> > - * We only support genpd's OPPs in the "required-opps" for now,
> > - * as we don't know how much about other cases. Error out if the
> > - * required OPP doesn't belong to a genpd.
> > - */
> > - if (!required_opp_tables[i]->is_genpd) {
> > - dev_err(dev, "required-opp doesn't belong to genpd: %pOF\n",
> > - required_np);
> > - goto free_required_tables;
> > - }
> > }
> >
> > /* Let's do the linking later on */
> > @@ -379,13 +368,6 @@ static void lazy_link_required_opp_table(struct opp_table *new_table)
> > struct dev_pm_opp *opp;
> > int i, ret;
> >
> > - /*
> > - * We only support genpd's OPPs in the "required-opps" for now,
> > - * as we don't know much about other cases.
> > - */
> > - if (!new_table->is_genpd)
> > - return;
> > -
> > mutex_lock(&opp_table_lock);
> >
> > list_for_each_entry_safe(opp_table, temp, &lazy_opp_tables, lazy) {
> > @@ -873,7 +855,7 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table,
> > return ERR_PTR(-ENOMEM);
> >
> > ret = _read_opp_key(new_opp, opp_table, np, &rate_not_available);
> > - if (ret < 0 && !opp_table->is_genpd) {
> > + if (ret < 0) {
> > dev_err(dev, "%s: opp key field not found\n", __func__);
> > goto free_opp;
> > }
>
> How are you setting the required OPPs ? I mean when someone tries to
> change frequency of a device which has some required-opps, who is
> configuring those required OPPs ?
>
When cpufreq changes, the (cpufreq based) passive governor will
calculate a target devfreq based on that, and the device governor
(mt8183-cci-devfreq) will change the actual opp of the device.
The required-opp is set in the cpufreq table:
cpufreq_opp_table: opp_table0 {
compatible = "operating-points-v2";
opp-shared;
...
opp0_01 {
opp-hz = /bits/ 64 <910000000>;
opp-microvolt = <687500>;
required-opps = <&opp2_01>;
};
...
};
devfreq_opp_table: opp_table2 {
compatible = "operating-points-v2";
opp-shared;
...
opp2_01: opp-338000000 {
opp-hz = /bits/ 64 <338000000>;
opp-microvolt = <687500>;
};
...
};
> --
> viresh
Powered by blists - more mailing lists