Skip to contentSkip to conversation

cpufreq: qcom-hw: Register an Energy Model

PATCH Applied Matthias Kaehlcke 3 participants 6 messages Feb 5, 2019 – Feb 7, 2019

Subsystems (3)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 cpufreq: qcom-hw: Register an Energy Model

Try and register an Energy Model from qcom-cpufreq-hw to allow interested sub-systems like the task scheduler to use the provided information.

---
 drivers/cpufreq/qcom-cpufreq-hw.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpufreq/qcom-cpufreq-hw.c +2 -0
index d83939a1b3d4c..a16b9dca7ea3b 100644
@@ -205,6 +205,8 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)
 		goto error;
 	}
 
+	dev_pm_opp_of_register_em(policy->cpus);
+
 	policy->fast_switch_possible = true;
 
 	return 0;
Signature · 1 line
2.20.1.611.gfbb209baf1-goog
#1 lore raw

PATCH 2/2 cpufreq: mediatek: Register an Energy Model

Try and register an Energy Model from mediatek-cpufreq to allow interested subsystems like the task scheduler to use the provided information.

---
 drivers/cpufreq/mediatek-cpufreq.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpufreq/mediatek-cpufreq.c +2 -0
index eb8920d398181..e6168ee582783 100644
@@ -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;
Signature · 1 line
2.20.1.611.gfbb209baf1-goog
maintainer Applied
#5 lore raw
In reply to Matthias Kaehlcke
Quoted 14 lines · Matthias Kaehlcke

Try and register an Energy Model from qcom-cpufreq-hw to allow interested sub-systems like the task scheduler to use the provided information.

---
 drivers/cpufreq/qcom-cpufreq-hw.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpufreq/qcom-cpufreq-hw.c +0 -0
index d83939a1b3d4c..a16b9dca7ea3b 100644

drivers/cpufreq/qcom-cpufreq-hw.c static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) · line 212

Quoted 8 lines
drivers/cpufreq/qcom-cpufreq-hw.c +2 -0
@@ -205,6 +205,8 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)
 		goto error;
 	}
 
+	dev_pm_opp_of_register_em(policy->cpus);
+
 	policy->fast_switch_possible = true;
 
 	return 0;

Applied both. Thanks.

Signature · 1 line
viresh
#2 lore raw

Re: [PATCH 2/2] cpufreq: mediatek: Register an Energy Model

In reply to Matthias Kaehlcke

Hi Matthias,

Quoted 14 lines · Matthias Kaehlcke

Try and register an Energy Model from mediatek-cpufreq to allow interested subsystems like the task scheduler to use the provided information.

---
 drivers/cpufreq/mediatek-cpufreq.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpufreq/mediatek-cpufreq.c +0 -0
index eb8920d398181..e6168ee582783 100644

drivers/cpufreq/mediatek-cpufreq.c static int mtk_cpufreq_init(struct cpufreq_policy *policy) · line 463

Quoted 4 lines
drivers/cpufreq/mediatek-cpufreq.c +1 -0
@@ -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 ?

Quoted 6 lines
drivers/cpufreq/mediatek-cpufreq.c +0 -0
 	cpumask_copy(policy->cpus, &info->cpus);
 	policy->freq_table = freq_table;
 	policy->driver_data = info;
Signature · 1 line
2.20.1.611.gfbb209baf1-goog

Thanks,
Quentin

#3 lore raw

Re: [PATCH 2/2] cpufreq: mediatek: Register an Energy Model

Hi Quentin,

Quoted 20 lines · Quentin Perret

Hi Matthias,

Quoted 17 lines · Matthias Kaehlcke

Try and register an Energy Model from mediatek-cpufreq to allow interested subsystems like the task scheduler to use the provided information.

---
 drivers/cpufreq/mediatek-cpufreq.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpufreq/mediatek-cpufreq.c +0 -0
index eb8920d398181..e6168ee582783 100644
@@ -460,6 +460,8 @@ static int mtk_cpufreq_init(struct cpufreq_policy *policy)
 		return ret;
 	}
 
Quoted 5 lines

drivers/cpufreq/mediatek-cpufreq.c static int mtk_cpufreq_init(struct cpufreq_policy *policy) · line 463

Quoted 1 line
drivers/cpufreq/mediatek-cpufreq.c +1 -0
+	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!

Quoted 6 lines

drivers/cpufreq/mediatek-cpufreq.c static int mtk_cpufreq_init(struct cpufreq_policy *policy) · line 467

Quoted 3 lines
drivers/cpufreq/mediatek-cpufreq.c +0 -0
 	cpumask_copy(policy->cpus, &info->cpus);
 	policy->freq_table = freq_table;
 	policy->driver_data = info;

Thanks,
Quentin

maintainer
#4 lore raw

Re: [PATCH 2/2] cpufreq: mediatek: Register an Energy Model

Quoted 9 lines · Matthias Kaehlcke

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.

Signature · 1 line
viresh