From: andrew-sh.cheng <andrew-sh.cheng-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
To: Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"Rafael J. Wysocki" <rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Chanwoo Choi <cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Kyungmin Park
<kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
MyungJoo Ham
<myungjoo.ham-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Matthias Brugger
<matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
fan.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 1/3] cpufreq: mediatek: add mt8183 cpufreq support
Date: Mon, 11 Feb 2019 21:19:29 +0800 [thread overview]
Message-ID: <1549891169.12454.2.camel@mtksdaap41> (raw)
In-Reply-To: <20190129101348.7oxqerszhcopanzr@vireshk-i7>
On Tue, 2019-01-29 at 15:43 +0530, Viresh Kumar wrote:
> On 29-01-19, 14:35, Andrew-sh Cheng wrote:
> > From: "Andrew-sh.Cheng" <andrew-sh.cheng-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> >
> > For new mediatek chip mt8183,
> > cci and little cluster share the same buck,
> > so need to modify the attribute of regulator from exclusive to optional
> >
> > Intermediate clock is not always enabled by ccf in different projects,
> > so cpufreq should always enable it by itself.
> >
> > Signed-off-by: Andrew-sh.Cheng <andrew-sh.cheng-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> > ---
> > drivers/cpufreq/cpufreq-dt-platdev.c | 1 +
> > drivers/cpufreq/mediatek-cpufreq.c | 7 ++++++-
> > 2 files changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
> > index b1c5468..5a1c588 100644
> > --- a/drivers/cpufreq/cpufreq-dt-platdev.c
> > +++ b/drivers/cpufreq/cpufreq-dt-platdev.c
> > @@ -117,6 +117,7 @@
> > { .compatible = "mediatek,mt817x", },
> > { .compatible = "mediatek,mt8173", },
> > { .compatible = "mediatek,mt8176", },
> > + { .compatible = "mediatek,mt8183", },
> >
> > { .compatible = "nvidia,tegra124", },
> >
> > diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c
> > index eb8920d..e956248 100644
> > --- a/drivers/cpufreq/mediatek-cpufreq.c
> > +++ b/drivers/cpufreq/mediatek-cpufreq.c
> > @@ -355,7 +355,7 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu)
> > goto out_free_resources;
> > }
> >
> > - proc_reg = regulator_get_exclusive(cpu_dev, "proc");
> > + proc_reg = regulator_get_optional(cpu_dev, "proc");
> > if (IS_ERR(proc_reg)) {
> > if (PTR_ERR(proc_reg) == -EPROBE_DEFER)
> > pr_warn("proc regulator for cpu%d not ready, retry.\n",
> > @@ -385,6 +385,9 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu)
> > goto out_free_resources;
> > }
> >
> > + ret = clk_prepare_enable(inter_clk);
> > + if (ret)
> > + goto out_free_resources;
>
> Add a blank line here please.
>
> Also out_free_resources isn't enough here and you need to free OPP table as
> well.
I will modify these in next patch.
>
>
> > /* Search a safe voltage for intermediate frequency. */
> > rate = clk_get_rate(inter_clk);
> > opp = dev_pm_opp_find_freq_ceil(cpu_dev, &rate);
> > @@ -412,6 +415,7 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu)
> >
> > out_free_opp_table:
> > dev_pm_opp_of_cpumask_remove_table(&info->cpus);
> > + clk_disable_unprepare(inter_clk);
>
> Clock was enabled after adding the table, and so it must be disabled before
> removing the table. Just the opposite sequence.
I will modify this in next patch.
>
> >
> > out_free_resources:
> > if (!IS_ERR(proc_reg))
> > @@ -551,6 +555,7 @@ static int mtk_cpufreq_probe(struct platform_device *pdev)
> > { .compatible = "mediatek,mt817x", },
> > { .compatible = "mediatek,mt8173", },
> > { .compatible = "mediatek,mt8176", },
> > + { .compatible = "mediatek,mt8183", },
> >
> > { }
> > };
> > --
> > 1.8.1.1.dirty
>
next prev parent reply other threads:[~2019-02-11 13:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-29 6:35 [PATCH 0/3] Add cpufreq and cci devfreq for mt8183 Andrew-sh Cheng
2019-01-29 6:35 ` [PATCH 1/3] cpufreq: mediatek: add mt8183 cpufreq support Andrew-sh Cheng
2019-01-29 10:13 ` Viresh Kumar
2019-02-11 13:19 ` andrew-sh.cheng [this message]
[not found] ` <1548743704-16821-1-git-send-email-andrew-sh.cheng-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2019-01-29 6:35 ` [PATCH 2/3] dt-bindings: devfreq: add compatible for mt8183 cci devfreq Andrew-sh Cheng
2019-02-12 1:00 ` Chanwoo Choi
2019-02-16 0:09 ` andrew-sh.cheng
2019-01-29 6:35 ` [PATCH 3/3] devfreq: add mediatek " Andrew-sh Cheng
2019-02-01 3:43 ` Nicolas Boichat
2019-02-12 9:05 ` andrew-sh.cheng
2019-02-01 20:13 ` Matthias Kaehlcke
2019-02-16 3:07 ` andrew-sh.cheng
2019-02-12 4:06 ` Chanwoo Choi
2019-02-16 6:16 ` andrew-sh.cheng
[not found] ` <CGME20190129063600epcas2p255b062c64f22555692ff895634ea4eb0@epcms1p4>
2019-01-29 8:17 ` MyungJoo Ham
2019-02-11 13:21 ` andrew-sh.cheng
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=1549891169.12454.2.camel@mtksdaap41 \
--to=andrew-sh.cheng-nus5lvnupcjwk0htik3j/w@public.gmane.org \
--cc=cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=fan.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=myungjoo.ham-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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).