[2/2] cpufreq: mediatek: Register an Energy Model
diff mbox series

Message ID 20190205175225.25923-2-mka@chromium.org
State New
Delegated to: viresh kumar
Headers show
Series
  • [1/2] cpufreq: qcom-hw: Register an Energy Model
Related show

Commit Message

Matthias Kaehlcke Feb. 5, 2019, 5:52 p.m. UTC
Try and register an Energy Model from mediatek-cpufreq to allow
interested subsystems like the task scheduler to use the provided
information.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
 drivers/cpufreq/mediatek-cpufreq.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Quentin Perret Feb. 6, 2019, 10:13 a.m. UTC | #1
Hi Matthias,

On Tuesday 05 Feb 2019 at 09:52:25 (-0800), Matthias Kaehlcke wrote:
> Try and register an Energy Model from mediatek-cpufreq to allow
> interested subsystems like the task scheduler to use the provided
> information.
> 
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> ---
>  drivers/cpufreq/mediatek-cpufreq.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c
> index eb8920d398181..e6168ee582783 100644
> --- a/drivers/cpufreq/mediatek-cpufreq.c
> +++ b/drivers/cpufreq/mediatek-cpufreq.c
> @@ -460,6 +460,8 @@ static int mtk_cpufreq_init(struct cpufreq_policy *policy)
>  		return ret;
>  	}
>  
> +	dev_pm_opp_of_register_em(policy->cpus);

I'm not familiar with the mediatek-cpufreq driver so bear with me, but
the code sets policy->cpus just below here. Is there any particular
reason for not using that in PM_EM ?

>  	cpumask_copy(policy->cpus, &info->cpus);
>  	policy->freq_table = freq_table;
>  	policy->driver_data = info;
> -- 
> 2.20.1.611.gfbb209baf1-goog
> 

Thanks,
Quentin
Matthias Kaehlcke Feb. 6, 2019, 6:16 p.m. UTC | #2
Hi Quentin,

On Wed, Feb 06, 2019 at 10:13:18AM +0000, Quentin Perret wrote:
> Hi Matthias,
> 
> On Tuesday 05 Feb 2019 at 09:52:25 (-0800), Matthias Kaehlcke wrote:
> > Try and register an Energy Model from mediatek-cpufreq to allow
> > interested subsystems like the task scheduler to use the provided
> > information.
> > 
> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> > ---
> >  drivers/cpufreq/mediatek-cpufreq.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c
> > index eb8920d398181..e6168ee582783 100644
> > --- a/drivers/cpufreq/mediatek-cpufreq.c
> > +++ b/drivers/cpufreq/mediatek-cpufreq.c
> > @@ -460,6 +460,8 @@ static int mtk_cpufreq_init(struct cpufreq_policy *policy)
> >  		return ret;
> >  	}
> >  
> > +	dev_pm_opp_of_register_em(policy->cpus);
> 
> I'm not familiar with the mediatek-cpufreq driver so bear with me, but
> the code sets policy->cpus just below here. Is there any particular
> reason for not using that in PM_EM ?

You are prefectly right, I missed the obvious and didn't get my hands
on hardware yet for testing.

So much for screwing up a one-liner ... I'll send a fix.

I thought Viresh already applied the patch, however in opp/linux-next
I currently only see the other one of this series for qcom-hw, so it
seems sending a new version rather than a fix-up patch is the way to
go.

Thanks for the review!

> >  	cpumask_copy(policy->cpus, &info->cpus);
> >  	policy->freq_table = freq_table;
> >  	policy->driver_data = info;
> 
> Thanks,
> Quentin
Viresh Kumar Feb. 7, 2019, 4:08 a.m. UTC | #3
On 06-02-19, 10:16, Matthias Kaehlcke wrote:
> You are prefectly right, I missed the obvious and didn't get my hands
> on hardware yet for testing.
> 
> So much for screwing up a one-liner ... I'll send a fix.
> 
> I thought Viresh already applied the patch, however in opp/linux-next
> I currently only see the other one of this series for qcom-hw, so it
> seems sending a new version rather than a fix-up patch is the way to
> go.

Yeah, I dropped it after Quentin reported the issue.

Patch
diff mbox series

diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c
index eb8920d398181..e6168ee582783 100644
--- a/drivers/cpufreq/mediatek-cpufreq.c
+++ b/drivers/cpufreq/mediatek-cpufreq.c
@@ -460,6 +460,8 @@  static int mtk_cpufreq_init(struct cpufreq_policy *policy)
 		return ret;
 	}
 
+	dev_pm_opp_of_register_em(policy->cpus);
+
 	cpumask_copy(policy->cpus, &info->cpus);
 	policy->freq_table = freq_table;
 	policy->driver_data = info;