Skip to contentSkip to conversation

PM / devfreq: tegra30: Make CPUFreq notifier to take into account boosting

PATCH Applied Dmitry Osipenko 2 participants 2 messages Apr 2, 2020 – Apr 3, 2020

Subsystems (3)
lore
Share & tools
lore

Dmitry Osipenko

author maintainer
#0 lore raw

PATCH v2 1/1 PM / devfreq: tegra30: Make CPUFreq notifier to take into account boosting

We're taking into account both HW memory-accesses + CPU activity based on current CPU's frequency. For memory-accesses there is a kind of hysteresis in a form of "boosting" which is managed by the tegra30-devfreq driver. If current HW memory activity is higher than activity judged based of the CPU's frequency, then there is no need to schedule cpufreq_update_work because the result of the work will be a NO-OP. And thus, tegra_actmon_cpufreq_contribution() should return 0, meaning that at the moment CPU frequency doesn't contribute anything to the final decision about required memory clock rate.

---

Changelog:

v2: - Made commit's message more detailed, which was requested by Chanwoo Choi
in the review comment to v1.

- This patch is now made to be standalone because there are no dependencies in regards to this change.

 drivers/devfreq/tegra30-devfreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/devfreq/tegra30-devfreq.c +1 -1
index 28b2c7ca416e..dfc3ac93c584 100644
@@ -420,7 +420,7 @@ tegra_actmon_cpufreq_contribution(struct tegra_devfreq *tegra,
 
 	static_cpu_emc_freq = actmon_cpu_to_emc_rate(tegra, cpu_freq);
 
-	if (dev_freq >= static_cpu_emc_freq)
+	if (dev_freq + actmon_dev->boost_freq >= static_cpu_emc_freq)
 		return 0;
 
 	return static_cpu_emc_freq;
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 30 lines · Dmitry Osipenko

We're taking into account both HW memory-accesses + CPU activity based on current CPU's frequency. For memory-accesses there is a kind of hysteresis in a form of "boosting" which is managed by the tegra30-devfreq driver. If current HW memory activity is higher than activity judged based of the CPU's frequency, then there is no need to schedule cpufreq_update_work because the result of the work will be a NO-OP. And thus, tegra_actmon_cpufreq_contribution() should return 0, meaning that at the moment CPU frequency doesn't contribute anything to the final decision about required memory clock rate.

---

Changelog:

v2: - Made commit's message more detailed, which was requested by Chanwoo Choi
in the review comment to v1.

- This patch is now made to be standalone because there are no dependencies in regards to this change.

 drivers/devfreq/tegra30-devfreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/devfreq/tegra30-devfreq.c +0 -0
index 28b2c7ca416e..dfc3ac93c584 100644

drivers/devfreq/tegra30-devfreq.c tegra_actmon_cpufreq_contribution(struct tegra_devfreq *tegra, · line 426

Quoted 8 lines
drivers/devfreq/tegra30-devfreq.c +1 -1
@@ -420,7 +420,7 @@ tegra_actmon_cpufreq_contribution(struct tegra_devfreq *tegra,
 
 	static_cpu_emc_freq = actmon_cpu_to_emc_rate(tegra, cpu_freq);
 
-	if (dev_freq >= static_cpu_emc_freq)
+	if (dev_freq + actmon_dev->boost_freq >= static_cpu_emc_freq)
 		return 0;
 
 	return static_cpu_emc_freq;

Applied it. Thanks.

Signature · 3 lines
Best Regards,
Chanwoo Choi
Samsung Electronics