From: "Chun-Jen Tseng (曾俊仁)" <Chun-Jen.Tseng@mediatek.com>
To: "viresh.kumar@linaro.org" <viresh.kumar@linaro.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"sumitg@nvidia.com" <sumitg@nvidia.com>,
"sanjayc@nvidia.com" <sanjayc@nvidia.com>,
"rafael.j.wysocki@intel.com" <rafael.j.wysocki@intel.com>,
Project_Global_Chrome_Upstream_Group
<Project_Global_Chrome_Upstream_Group@mediatek.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"rafael@kernel.org" <rafael@kernel.org>,
"angelogioacchino.delregno@collabora.com"
<angelogioacchino.delregno@collabora.com>
Subject: Re: [PATCH] cpufreq: mediatek: change transition delay for MT8186
Date: Tue, 29 Aug 2023 08:25:11 +0000 [thread overview]
Message-ID: <d0745e1cee9fae33252bb8d3db741c2a463983d6.camel@mediatek.com> (raw)
In-Reply-To: <20230829071022.n7wubb2dhbt3ukyk@vireshk-i7>
On Tue, 2023-08-29 at 12:40 +0530, Viresh Kumar wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>
> On 29-08-23, 06:57, Chun-Jen Tseng (曾俊仁) wrote:
> > For MT8186 set freq must Big CPU -> Little CPU -> CCI like this
> order
> > and it
> > takes 10 ms.
> >
> > But in cpufreq & devfreq flow , when Big CPU or Little CPU change
> freq
> > , it will call
> > CCI setting by different policy. It will become Big CPU -> CCI
> setting
> > or Little CPU ->
> > CCI setting. Howevery, It will cause CCI setting to wrong value
> when
> > per 1ms call governor
> > and change freq.
>
> > this patch (44295af5019f) , fixed cpufreq_out_of_sync() condition
> from
> > 1000 Mhz to 1 Mhz.
> > So, when cpufreq_verify_current_freq() call clk_get_rate() over 1
> Mhz,
> > it must to do freq sync
> > by cpufreq_out_of_sync(). In MT8186, it offen over 1 Mhz when call
> > clk_get_rate(), so I modify
> > transition delay from 1 ms to 10 ms for make sure freq setting
> done.
>
> > In MT8186, if CCI freq is lower than Big CPU freq 70%, it will
> causes
> > kernel panic
> > on Big CPU.
>
> Okay, I get it now. First of all, the kernel shouldn't crash because
> of a simple delay anywhere, like the latency delay here. If that is
> happening it means something else is wrong somewhere else.
>
> From what I understand now, your CCI have a constraint compared to
> the
> frequency of the BIG CPU (and little CPU too). You need something
> else
> that guarantees that the CCI is always configured in the right range.
> Perhaps a devfreq governor or something else that takes care of this.
> It shall evaluate the next state based on both big and little CPU
> frequencies and not only the caller via which we reached CCI. Please
> see how others have solved this.
>
> I am very sure this is working by chance here and will break with
> some
> other delay somewhere else. Fix the real cause of it.
>
Actually, the root cause is the CPU freq setting finish time. If MT8186
needs 10 ms for two clusters findish setting CPU clock done, I should
set transition delay 10 ms which avoid call clk_get_rate() get previous
clock value. If I get previous CPU clock and it over 1 Mhz, the
cpufreq_out_of_sync() will set CPU freq again but it wrong CPU freq.
Howervery, transition delay seting is by individual SoC , it should not
force 1 ms for all SoC. So, I wish I can do this patch here.
> --
> viresh
next prev parent reply other threads:[~2023-08-29 8:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-18 2:06 [PATCH] cpufreq: mediatek: change transition delay for MT8186 Mark Tseng
2023-08-28 6:39 ` Viresh Kumar
2023-08-29 6:57 ` Chun-Jen Tseng (曾俊仁)
2023-08-29 7:10 ` Viresh Kumar
2023-08-29 8:25 ` Chun-Jen Tseng (曾俊仁) [this message]
2023-08-29 8:31 ` Viresh Kumar
2023-08-29 8:35 ` 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=d0745e1cee9fae33252bb8d3db741c2a463983d6.camel@mediatek.com \
--to=chun-jen.tseng@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=sanjayc@nvidia.com \
--cc=sumitg@nvidia.com \
--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).