[PATCH V2 07/15] cpufreq: mediatek: Add opp notification for SVS support

Rex-BC Chen rex-bc.chen at mediatek.com
Mon Apr 11 04:29:33 PDT 2022


On Fri, 2022-04-08 at 13:29 -0700, Kevin Hilman wrote:
> Rex-BC Chen <rex-bc.chen at mediatek.com> writes:
> 
> > From: "Andrew-sh.Cheng" <andrew-sh.cheng at mediatek.com>
> > 
> > The Smart Voltage Scaling (SVS) is a hardware which calculates
> > suitable
> > SVS bank voltages to OPP voltage table.
> > 
> > When the SVS is enabled, cpufreq should listen to opp notification
> > and do
> > proper actions when receiving events of disable and voltage
> > adjustment.
> 
> So listenting for OPP notifications should be done only when SVS is
> enabled...
> 

Hello Kevin,

Thanks for your review.
Yes, the OPP notification is only called from MediaTek SVS.

> [...]
> 
> >  static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info,
> > int cpu)
> >  {
> >  	struct device *cpu_dev;
> > @@ -392,6 +455,17 @@ static int mtk_cpu_dvfs_info_init(struct
> > mtk_cpu_dvfs_info *info, int cpu)
> >  	info->intermediate_voltage = dev_pm_opp_get_voltage(opp);
> >  	dev_pm_opp_put(opp);
> >  
> > +	info->opp_cpu = cpu;
> > +	info->opp_nb.notifier_call = mtk_cpufreq_opp_notifier;
> > +	ret = dev_pm_opp_register_notifier(cpu_dev, &info->opp_nb);
> 
> ...but here youlisten to OPP notifications unconditionally.  Seems
> there
> should be a check whether SVS is enabled before deciding to register.
> 
> Kevin

Do you think it's ok that we wrap it with the SVS Kconfig define?
like
#ifdef CONFIG_MTK_SVS
mtk_cpufreq_opp_notifier()
...
dev_pm_opp_register_notifier()
#endif

SVS series:
message-id:20220221063939.14969-4-roger.lu at mediatek.com

BRs,
Rex




More information about the linux-arm-kernel mailing list