linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpufreq: qcom-hw: enable boost support
@ 2021-01-13  6:52 Shawn Guo
  2021-01-14 15:33 ` Steev Klimaszewski
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shawn Guo @ 2021-01-13  6:52 UTC (permalink / raw)
  To: Rafael J . Wysocki, Viresh Kumar
  Cc: Bjorn Andersson, Andy Gross, Steev Klimaszewski, linux-pm,
	linux-arm-msm, Shawn Guo

At least on sdm850, the 2956800 khz is detected as a boost frequency in
function qcom_cpufreq_hw_read_lut().  Let's enable boost support by
calling cpufreq_enable_boost_support(), so that we can get the boost
frequency by switching it on via 'boost' sysfs entry like below.

 $ echo 1 > /sys/devices/system/cpu/cpufreq/boost

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/cpufreq/qcom-cpufreq-hw.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
index 315ee987d2d3..6eb88463a24e 100644
--- a/drivers/cpufreq/qcom-cpufreq-hw.c
+++ b/drivers/cpufreq/qcom-cpufreq-hw.c
@@ -351,6 +351,12 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)
 
 	dev_pm_opp_of_register_em(cpu_dev, policy->cpus);
 
+	if (policy_has_boost_freq(policy)) {
+		ret = cpufreq_enable_boost_support();
+		if (ret)
+			dev_warn(cpu_dev, "failed to enable boost: %d\n", ret);
+	}
+
 	return 0;
 error:
 	devm_iounmap(dev, base);
-- 
2.17.1


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

* Re: [PATCH] cpufreq: qcom-hw: enable boost support
  2021-01-13  6:52 [PATCH] cpufreq: qcom-hw: enable boost support Shawn Guo
@ 2021-01-14 15:33 ` Steev Klimaszewski
  2021-01-14 16:18 ` Bjorn Andersson
  2021-01-18  6:44 ` Viresh Kumar
  2 siblings, 0 replies; 4+ messages in thread
From: Steev Klimaszewski @ 2021-01-14 15:33 UTC (permalink / raw)
  To: Shawn Guo, Rafael J . Wysocki, Viresh Kumar
  Cc: Bjorn Andersson, Andy Gross, linux-pm, linux-arm-msm


On 1/13/21 12:52 AM, Shawn Guo wrote:
> At least on sdm850, the 2956800 khz is detected as a boost frequency in
> function qcom_cpufreq_hw_read_lut().  Let's enable boost support by
> calling cpufreq_enable_boost_support(), so that we can get the boost
> frequency by switching it on via 'boost' sysfs entry like below.
>
>  $ echo 1 > /sys/devices/system/cpu/cpufreq/boost
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
>  drivers/cpufreq/qcom-cpufreq-hw.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
> index 315ee987d2d3..6eb88463a24e 100644
> --- a/drivers/cpufreq/qcom-cpufreq-hw.c
> +++ b/drivers/cpufreq/qcom-cpufreq-hw.c
> @@ -351,6 +351,12 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)
>  
>  	dev_pm_opp_of_register_em(cpu_dev, policy->cpus);
>  
> +	if (policy_has_boost_freq(policy)) {
> +		ret = cpufreq_enable_boost_support();
> +		if (ret)
> +			dev_warn(cpu_dev, "failed to enable boost: %d\n", ret);
> +	}
> +
>  	return 0;
>  error:
>  	devm_iounmap(dev, base);
Tested-by: Steev Klimaszewski <steev@kali.org>

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

* Re: [PATCH] cpufreq: qcom-hw: enable boost support
  2021-01-13  6:52 [PATCH] cpufreq: qcom-hw: enable boost support Shawn Guo
  2021-01-14 15:33 ` Steev Klimaszewski
@ 2021-01-14 16:18 ` Bjorn Andersson
  2021-01-18  6:44 ` Viresh Kumar
  2 siblings, 0 replies; 4+ messages in thread
From: Bjorn Andersson @ 2021-01-14 16:18 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Rafael J . Wysocki, Viresh Kumar, Andy Gross, Steev Klimaszewski,
	linux-pm, linux-arm-msm

On Wed 13 Jan 00:52 CST 2021, Shawn Guo wrote:

> At least on sdm850, the 2956800 khz is detected as a boost frequency in
> function qcom_cpufreq_hw_read_lut().  Let's enable boost support by
> calling cpufreq_enable_boost_support(), so that we can get the boost
> frequency by switching it on via 'boost' sysfs entry like below.
> 
>  $ echo 1 > /sys/devices/system/cpu/cpufreq/boost
> 
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> ---
>  drivers/cpufreq/qcom-cpufreq-hw.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
> index 315ee987d2d3..6eb88463a24e 100644
> --- a/drivers/cpufreq/qcom-cpufreq-hw.c
> +++ b/drivers/cpufreq/qcom-cpufreq-hw.c
> @@ -351,6 +351,12 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)
>  
>  	dev_pm_opp_of_register_em(cpu_dev, policy->cpus);
>  
> +	if (policy_has_boost_freq(policy)) {
> +		ret = cpufreq_enable_boost_support();
> +		if (ret)
> +			dev_warn(cpu_dev, "failed to enable boost: %d\n", ret);
> +	}
> +
>  	return 0;
>  error:
>  	devm_iounmap(dev, base);
> -- 
> 2.17.1
> 

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

* Re: [PATCH] cpufreq: qcom-hw: enable boost support
  2021-01-13  6:52 [PATCH] cpufreq: qcom-hw: enable boost support Shawn Guo
  2021-01-14 15:33 ` Steev Klimaszewski
  2021-01-14 16:18 ` Bjorn Andersson
@ 2021-01-18  6:44 ` Viresh Kumar
  2 siblings, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2021-01-18  6:44 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Rafael J . Wysocki, Bjorn Andersson, Andy Gross,
	Steev Klimaszewski, linux-pm, linux-arm-msm

On 13-01-21, 14:52, Shawn Guo wrote:
> At least on sdm850, the 2956800 khz is detected as a boost frequency in
> function qcom_cpufreq_hw_read_lut().  Let's enable boost support by
> calling cpufreq_enable_boost_support(), so that we can get the boost
> frequency by switching it on via 'boost' sysfs entry like below.
> 
>  $ echo 1 > /sys/devices/system/cpu/cpufreq/boost
> 
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
>  drivers/cpufreq/qcom-cpufreq-hw.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
> index 315ee987d2d3..6eb88463a24e 100644
> --- a/drivers/cpufreq/qcom-cpufreq-hw.c
> +++ b/drivers/cpufreq/qcom-cpufreq-hw.c
> @@ -351,6 +351,12 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)
>  
>  	dev_pm_opp_of_register_em(cpu_dev, policy->cpus);
>  
> +	if (policy_has_boost_freq(policy)) {
> +		ret = cpufreq_enable_boost_support();
> +		if (ret)
> +			dev_warn(cpu_dev, "failed to enable boost: %d\n", ret);
> +	}
> +
>  	return 0;
>  error:
>  	devm_iounmap(dev, base);

Applied. Thanks.

-- 
viresh

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

end of thread, other threads:[~2021-01-18  6:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-13  6:52 [PATCH] cpufreq: qcom-hw: enable boost support Shawn Guo
2021-01-14 15:33 ` Steev Klimaszewski
2021-01-14 16:18 ` Bjorn Andersson
2021-01-18  6:44 ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).