[PATCH v3 1/3] cpufreq: mediatek: using global lock avoid race condition
Chun-Jen Tseng (曾俊仁)
Chun-Jen.Tseng at mediatek.com
Thu Mar 20 22:32:06 PDT 2025
Hi viresh,
I add a global lock related to the CCI driver.
This is because the CCI needs to obtain the frequencies of policy-0 and
policy-6 to determine its own frequency.
If policy-0 and policy-6 are set simultaneously, it may cause the CCI
to select the wrong frequency.
Therefore, I hope to change the setting flow to the following:
policy-0 or policy-6 -> set frequency -> CCI receives notification -
> set CCI frequency
BRs,
Mark Tseng
On Fri, 2025-03-21 at 10:26 +0530, Viresh Kumar wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>
>
> On 20-03-25, 08:22, Chun-Jen Tseng (曾俊仁) wrote:
> > The struct mtk_cpu_dvfs_info instance is per-policy and the
> > reg_lock is
> > also in this structure. when I have two "policy-0" and "policy-6"
> > use
> > the same mtk_cpufreq_set_target() function but the info->reg_lock
> > is from 2 instance(policy-0 and policy-6). when the policy-0 and
> > policy-6 call set_target target, the mutex_lock is locked by per-
> > policy. So, I change to global lock avoid per-policy lock.
>
> Yes, that's what you are doing. I am asking why a global lock is
> required here ?
> I think the per-policy lock is all you need.
>
> --
> viresh
More information about the linux-arm-kernel
mailing list