[PATCH V3 05/15] cpufreq: mediatek: Add opp notification support

Rex-BC Chen rex-bc.chen at mediatek.com
Sun Apr 17 18:38:51 PDT 2022


On Fri, 2022-04-15 at 14:24 +0200, AngeloGioacchino Del Regno wrote:
> Il 15/04/22 07:59, Rex-BC Chen ha scritto:
> > From: "Andrew-sh.Cheng" <andrew-sh.cheng at 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 at mediatek.com>
> > Signed-off-by: Jia-Wei Chang <jia-wei.chang at mediatek.com>
> > Signed-off-by: Rex-BC Chen <rex-bc.chen at 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 at collabora.com>
> 

Hello Angelo, 

OK, I will do this in next version.
Thanks!

BRs,
Rex




More information about the Linux-mediatek mailing list