Re: [PATCH v1 2/2] cpufreq: mediatek: Fixed cpufreq has 2 policy will cause concurrency
From: Viresh Kumar
Date: Tue Oct 01 2024 - 02:44:30 EST
On 13-09-24, 18:39, Mark Tseng wrote:
> mtk_cpufreq_set_target() is re-enter function but the mutex lock decalre
> in mtk_cpu_dvfs_info structure for each policy. It should change to
> global variable for critical session avoid policy get wrong OPP.
I am not sure I understood the problem well. Can you explain clearly
why the current locking doesn't work with details call chain ?
It is normally okay to have per-policy locks otherwise. Are there any
common resources being used between policies that need locking ?
> SoC with CCI architecture should set transition_delay to 10 ms
> because cpufreq need to call devfreq notifier in async mode. if delay
> less than 10ms may get wrong OPP-level in CCI driver.
>
> Add CPUFREQ_ASYNC_NOTIFICATION flages for cpufreq policy because some of
> process will get CPU frequency by cpufreq sysfs node. It may get wrong
> frequency then call cpufreq_out_of_sync() to fixed frequency.
Don't do so much in a single commit. Separate commits for each logical
change so they can be reviewed well. Also don't send cpufreq along
with devfreq changes, unless they are dependent on each other.
--
viresh