Linux-PM Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/2] cpufreq: drivers: Enable frequency invariance in qcom-cpufreq-hw
@ 2019-08-08 13:18 Douglas RAILLARD
  2019-08-08 17:32 ` Quentin Perret
  0 siblings, 1 reply; 5+ messages in thread
From: Douglas RAILLARD @ 2019-08-08 13:18 UTC (permalink / raw)
  To: linux-kernel, linux-arm-msm, linux-pm; +Cc: rjw, viresh.kumar, agross

Add calls to arch_set_freq_scale() in qcom-cpufreq-hw driver to enable
frequency invariance.

Signed-off-by: Douglas RAILLARD <douglas.raillard@arm.com>
---
 drivers/cpufreq/qcom-cpufreq-hw.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
index 4b0b50403901..3bd3b8b268d9 100644
--- a/drivers/cpufreq/qcom-cpufreq-hw.c
+++ b/drivers/cpufreq/qcom-cpufreq-hw.c
@@ -34,9 +34,12 @@ static int qcom_cpufreq_hw_target_index(struct cpufreq_policy *policy,
 					unsigned int index)
 {
 	void __iomem *perf_state_reg = policy->driver_data;
+	unsigned long freq = policy->freq_table[index].frequency;
 
 	writel_relaxed(index, perf_state_reg);
 
+	arch_set_freq_scale(policy->related_cpus, freq,
+			    policy->cpuinfo.max_freq);
 	return 0;
 }
 
@@ -63,6 +66,7 @@ static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy,
 {
 	void __iomem *perf_state_reg = policy->driver_data;
 	int index;
+	unsigned long freq;
 
 	index = policy->cached_resolved_idx;
 	if (index < 0)
@@ -70,7 +74,11 @@ static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy,
 
 	writel_relaxed(index, perf_state_reg);
 
-	return policy->freq_table[index].frequency;
+	freq = policy->freq_table[index].frequency;
+	arch_set_freq_scale(policy->related_cpus, freq,
+			    policy->cpuinfo.max_freq);
+
+	return freq;
 }
 
 static int qcom_cpufreq_hw_read_lut(struct device *cpu_dev,
-- 
2.22.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] cpufreq: drivers: Enable frequency invariance in qcom-cpufreq-hw
  2019-08-08 13:18 [PATCH 1/2] cpufreq: drivers: Enable frequency invariance in qcom-cpufreq-hw Douglas RAILLARD
@ 2019-08-08 17:32 ` Quentin Perret
  2019-08-09 10:16   ` Douglas Raillard
  0 siblings, 1 reply; 5+ messages in thread
From: Quentin Perret @ 2019-08-08 17:32 UTC (permalink / raw)
  To: Douglas RAILLARD
  Cc: linux-kernel, linux-arm-msm, linux-pm, rjw, viresh.kumar, agross

Hi Douglas,

On Thursday 08 Aug 2019 at 14:18:57 (+0100), Douglas RAILLARD wrote:
> Add calls to arch_set_freq_scale() in qcom-cpufreq-hw driver to enable
> frequency invariance.

Is there a patch 2/2 ?

> 
> Signed-off-by: Douglas RAILLARD <douglas.raillard@arm.com>
> ---
>  drivers/cpufreq/qcom-cpufreq-hw.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
> index 4b0b50403901..3bd3b8b268d9 100644
> --- a/drivers/cpufreq/qcom-cpufreq-hw.c
> +++ b/drivers/cpufreq/qcom-cpufreq-hw.c
> @@ -34,9 +34,12 @@ static int qcom_cpufreq_hw_target_index(struct cpufreq_policy *policy,
>  					unsigned int index)
>  {
>  	void __iomem *perf_state_reg = policy->driver_data;
> +	unsigned long freq = policy->freq_table[index].frequency;
>  
>  	writel_relaxed(index, perf_state_reg);
>  
> +	arch_set_freq_scale(policy->related_cpus, freq,
> +			    policy->cpuinfo.max_freq);
>  	return 0;
>  }
>  
> @@ -63,6 +66,7 @@ static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy,
>  {
>  	void __iomem *perf_state_reg = policy->driver_data;
>  	int index;
> +	unsigned long freq;
>  
>  	index = policy->cached_resolved_idx;
>  	if (index < 0)
> @@ -70,7 +74,11 @@ static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy,
>  
>  	writel_relaxed(index, perf_state_reg);
>  
> -	return policy->freq_table[index].frequency;
> +	freq = policy->freq_table[index].frequency;
> +	arch_set_freq_scale(policy->related_cpus, freq,
> +			    policy->cpuinfo.max_freq);
> +
> +	return freq;
>  }
>  
>  static int qcom_cpufreq_hw_read_lut(struct device *cpu_dev,
> -- 
> 2.22.0

Reviewed-by: Quentin Perret <quentin.perret@arm.com>

Thanks,
Quentin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] cpufreq: drivers: Enable frequency invariance in qcom-cpufreq-hw
  2019-08-08 17:32 ` Quentin Perret
@ 2019-08-09 10:16   ` Douglas Raillard
  2019-08-09 10:37     ` Quentin Perret
  0 siblings, 1 reply; 5+ messages in thread
From: Douglas Raillard @ 2019-08-09 10:16 UTC (permalink / raw)
  To: Quentin Perret
  Cc: linux-kernel, linux-arm-msm, linux-pm, rjw, viresh.kumar, agross

Hi Quentin,

On 8/8/19 6:32 PM, Quentin Perret wrote:
> Hi Douglas,
> 
> On Thursday 08 Aug 2019 at 14:18:57 (+0100), Douglas RAILLARD wrote:
>> Add calls to arch_set_freq_scale() in qcom-cpufreq-hw driver to enable
>> frequency invariance.
> 
> Is there a patch 2/2 ?

That slipped through when format-patch-ing unrelated commits, there is no 2nd patch.

>>
>> Signed-off-by: Douglas RAILLARD <douglas.raillard@arm.com>
>> ---
>>   drivers/cpufreq/qcom-cpufreq-hw.c | 10 +++++++++-
>>   1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
>> index 4b0b50403901..3bd3b8b268d9 100644
>> --- a/drivers/cpufreq/qcom-cpufreq-hw.c
>> +++ b/drivers/cpufreq/qcom-cpufreq-hw.c
>> @@ -34,9 +34,12 @@ static int qcom_cpufreq_hw_target_index(struct cpufreq_policy *policy,
>>   					unsigned int index)
>>   {
>>   	void __iomem *perf_state_reg = policy->driver_data;
>> +	unsigned long freq = policy->freq_table[index].frequency;
>>   
>>   	writel_relaxed(index, perf_state_reg);
>>   
>> +	arch_set_freq_scale(policy->related_cpus, freq,
>> +			    policy->cpuinfo.max_freq);
>>   	return 0;
>>   }
>>   
>> @@ -63,6 +66,7 @@ static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy,
>>   {
>>   	void __iomem *perf_state_reg = policy->driver_data;
>>   	int index;
>> +	unsigned long freq;
>>   
>>   	index = policy->cached_resolved_idx;
>>   	if (index < 0)
>> @@ -70,7 +74,11 @@ static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy,
>>   
>>   	writel_relaxed(index, perf_state_reg);
>>   
>> -	return policy->freq_table[index].frequency;
>> +	freq = policy->freq_table[index].frequency;
>> +	arch_set_freq_scale(policy->related_cpus, freq,
>> +			    policy->cpuinfo.max_freq);
>> +
>> +	return freq;
>>   }
>>   
>>   static int qcom_cpufreq_hw_read_lut(struct device *cpu_dev,
>> -- 
>> 2.22.0
> 
> Reviewed-by: Quentin Perret <quentin.perret@arm.com>
> 
> Thanks,
> Quentin
> 

Thanks,
Douglas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] cpufreq: drivers: Enable frequency invariance in qcom-cpufreq-hw
  2019-08-09 10:16   ` Douglas Raillard
@ 2019-08-09 10:37     ` Quentin Perret
  2019-08-19  6:57       ` Viresh Kumar
  0 siblings, 1 reply; 5+ messages in thread
From: Quentin Perret @ 2019-08-09 10:37 UTC (permalink / raw)
  To: Douglas Raillard
  Cc: linux-kernel, linux-arm-msm, linux-pm, rjw, viresh.kumar, agross

On Friday 09 Aug 2019 at 11:16:12 (+0100), Douglas Raillard wrote:
> Hi Quentin,
> 
> On 8/8/19 6:32 PM, Quentin Perret wrote:
> > Hi Douglas,
> > 
> > On Thursday 08 Aug 2019 at 14:18:57 (+0100), Douglas RAILLARD wrote:
> > > Add calls to arch_set_freq_scale() in qcom-cpufreq-hw driver to enable
> > > frequency invariance.
> > 
> > Is there a patch 2/2 ?
> 
> That slipped through when format-patch-ing unrelated commits, there is no 2nd patch.
> 
> > > 
> > > Signed-off-by: Douglas RAILLARD <douglas.raillard@arm.com>
> > > ---
> > >   drivers/cpufreq/qcom-cpufreq-hw.c | 10 +++++++++-
> > >   1 file changed, 9 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
> > > index 4b0b50403901..3bd3b8b268d9 100644
> > > --- a/drivers/cpufreq/qcom-cpufreq-hw.c
> > > +++ b/drivers/cpufreq/qcom-cpufreq-hw.c
> > > @@ -34,9 +34,12 @@ static int qcom_cpufreq_hw_target_index(struct cpufreq_policy *policy,
> > >   					unsigned int index)
> > >   {
> > >   	void __iomem *perf_state_reg = policy->driver_data;
> > > +	unsigned long freq = policy->freq_table[index].frequency;
> > >   	writel_relaxed(index, perf_state_reg);
> > > +	arch_set_freq_scale(policy->related_cpus, freq,
> > > +			    policy->cpuinfo.max_freq);
> > >   	return 0;
> > >   }
> > > @@ -63,6 +66,7 @@ static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy,
> > >   {
> > >   	void __iomem *perf_state_reg = policy->driver_data;
> > >   	int index;
> > > +	unsigned long freq;
> > >   	index = policy->cached_resolved_idx;
> > >   	if (index < 0)
> > > @@ -70,7 +74,11 @@ static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy,
> > >   	writel_relaxed(index, perf_state_reg);
> > > -	return policy->freq_table[index].frequency;
> > > +	freq = policy->freq_table[index].frequency;
> > > +	arch_set_freq_scale(policy->related_cpus, freq,
> > > +			    policy->cpuinfo.max_freq);
> > > +
> > > +	return freq;
> > >   }
> > >   static int qcom_cpufreq_hw_read_lut(struct device *cpu_dev,
> > > -- 
> > > 2.22.0
> > 
> > Reviewed-by: Quentin Perret <quentin.perret@arm.com>
> > 
> > Thanks,
> > Quentin
> > 
> 
> Thanks,
> Douglas

Actually, one nit, the $subject should probably be formatted as:

  cpufreq: qcom-hw: invoke frequency-invariance setter function

for consistency with other patches in this area.

Thanks,
Quentin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] cpufreq: drivers: Enable frequency invariance in qcom-cpufreq-hw
  2019-08-09 10:37     ` Quentin Perret
@ 2019-08-19  6:57       ` Viresh Kumar
  0 siblings, 0 replies; 5+ messages in thread
From: Viresh Kumar @ 2019-08-19  6:57 UTC (permalink / raw)
  To: Quentin Perret
  Cc: Douglas Raillard, linux-kernel, linux-arm-msm, linux-pm, rjw, agross

On 09-08-19, 11:37, Quentin Perret wrote:
> Actually, one nit, the $subject should probably be formatted as:
> 
>   cpufreq: qcom-hw: invoke frequency-invariance setter function
> 
> for consistency with other patches in this area.

Applied with these changes. Thanks.

-- 
viresh

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-08 13:18 [PATCH 1/2] cpufreq: drivers: Enable frequency invariance in qcom-cpufreq-hw Douglas RAILLARD
2019-08-08 17:32 ` Quentin Perret
2019-08-09 10:16   ` Douglas Raillard
2019-08-09 10:37     ` Quentin Perret
2019-08-19  6:57       ` Viresh Kumar

Linux-PM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-pm/0 linux-pm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-pm linux-pm/ https://lore.kernel.org/linux-pm \
		linux-pm@vger.kernel.org linux-pm@archiver.kernel.org
	public-inbox-index linux-pm


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-pm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox