Message ID | 20220415055916.28350-1-rex-bc.chen@mediatek.com (mailing list archive) |
---|---|
Headers | show |
Series | cpufreq: mediatek: Cleanup and support MT8183 and MT8186 | expand |
Il 15/04/22 07:59, Rex-BC Chen ha scritto: > From: "Andrew-sh.Cheng" <andrew-sh.cheng@mediatek.com> > > From this opp notifier, cpufreq should listen to opp notification and do > proper actions when receiving events of disable and voltage adjustment. > > One of the user for this opp notifier is MediaTek SVS. > The MediaTek Smart Voltage Scaling (SVS) is a hardware which calculates > suitable SVS bank voltages to OPP voltage table. > > Signed-off-by: Andrew-sh.Cheng <andrew-sh.cheng@mediatek.com> > Signed-off-by: Jia-Wei Chang <jia-wei.chang@mediatek.com> > Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com> > --- > drivers/cpufreq/mediatek-cpufreq.c | 93 +++++++++++++++++++++++++++--- > 1 file changed, 85 insertions(+), 8 deletions(-) > > diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c > index fa8b193bf27b..221f249f8d21 100644 > --- a/drivers/cpufreq/mediatek-cpufreq.c > +++ b/drivers/cpufreq/mediatek-cpufreq.c > @@ -41,6 +41,11 @@ struct mtk_cpu_dvfs_info { > int intermediate_voltage; > bool need_voltage_tracking; > int pre_vproc; > + /* Avoid race condition for regulators between notify and policy */ > + struct mutex reg_lock; > + struct notifier_block opp_nb; > + int opp_cpu; This should be unsigned int because: 1. A negative CPU number is impossible; 2. The only usage is as a parameter of cpufreq_cpu_get(unsigned int cpu). Please change this to unsigned int, after which: Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>