Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751821AbdG1IZm (ORCPT ); Fri, 28 Jul 2017 04:25:42 -0400 Received: from mail-pg0-f46.google.com ([74.125.83.46]:35061 "EHLO mail-pg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751800AbdG1IZk (ORCPT ); Fri, 28 Jul 2017 04:25:40 -0400 Date: Fri, 28 Jul 2017 13:55:37 +0530 From: Viresh Kumar To: Dietmar Eggemann Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux@arm.linux.org.uk, Greg Kroah-Hartman , Russell King , Catalin Marinas , Will Deacon , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , "Rafael J . Wysocki" , Sudeep Holla Subject: Re: [PATCH v3 04/10] cpufreq: dt: invoke frequency-invariance setter function Message-ID: <20170728082537.GB352@vireshk-i7> References: <20170727193312.9849-1-dietmar.eggemann@arm.com> <20170727193312.9849-5-dietmar.eggemann@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170727193312.9849-5-dietmar.eggemann@arm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1322 Lines: 39 On 27-07-17, 20:33, Dietmar Eggemann wrote: > Call the frequency-invariance setter function arch_set_freq_scale() > if the new frequency has been successfully set which is indicated by > dev_pm_opp_set_rate() returning 0. > > Cc: Rafael J. Wysocki > Cc: Viresh Kumar > Signed-off-by: Dietmar Eggemann > --- > drivers/cpufreq/cpufreq-dt.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > > diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c > index fef3c2160691..cbac8a7dbc50 100644 > --- a/drivers/cpufreq/cpufreq-dt.c > +++ b/drivers/cpufreq/cpufreq-dt.c > @@ -43,9 +43,17 @@ static struct freq_attr *cpufreq_dt_attr[] = { > static int set_target(struct cpufreq_policy *policy, unsigned int index) > { > struct private_data *priv = policy->driver_data; > + unsigned long freq = policy->freq_table[index].frequency; > + int ret; > + > + ret = dev_pm_opp_set_rate(priv->cpu_dev, freq * 1000); > > - return dev_pm_opp_set_rate(priv->cpu_dev, > - policy->freq_table[index].frequency * 1000); > + if (!ret) { > + arch_set_freq_scale(policy->related_cpus, freq, > + policy->cpuinfo.max_freq); > + } > + > + return ret; > } Acked-by: Viresh Kumar -- viresh