diff mbox

[RESEND,1/3] thermal: mediatek: Add cpu dynamic power cooling model.

Message ID 1458029437-12846-2-git-send-email-dawei.chien@mediatek.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dawei Chien March 15, 2016, 8:10 a.m. UTC
MT8173 cpufreq driver select of_cpufreq_power_cooling_register registering
cooling devices with dynamic power coefficient.

Signed-off-by: Dawei Chien <dawei.chien@mediatek.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
This patch is base on patchset:
https://lkml.org/lkml/2015/11/17/251
---
 drivers/cpufreq/mt8173-cpufreq.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Comments

Viresh Kumar April 12, 2016, 5:38 a.m. UTC | #1
Hi Rafael,

On 15-03-16, 16:10, Dawei Chien wrote:
> MT8173 cpufreq driver select of_cpufreq_power_cooling_register registering
> cooling devices with dynamic power coefficient.
> 
> Signed-off-by: Dawei Chien <dawei.chien@mediatek.com>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Can you please apply this patch from Dawei ?
Rafael J. Wysocki April 13, 2016, 4:52 a.m. UTC | #2
On Tue, Apr 12, 2016 at 7:38 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> Hi Rafael,
>
> On 15-03-16, 16:10, Dawei Chien wrote:
>> MT8173 cpufreq driver select of_cpufreq_power_cooling_register registering
>> cooling devices with dynamic power coefficient.
>>
>> Signed-off-by: Dawei Chien <dawei.chien@mediatek.com>
>> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
>
> Can you please apply this patch from Dawei ?

I can, but I'm traveling this week, so that's rather going to happen next week.

Thanks,
Rafael
Matthias Brugger April 20, 2016, 11:58 a.m. UTC | #3
Hi Rafael,

On 13/04/16 06:52, Rafael J. Wysocki wrote:
> On Tue, Apr 12, 2016 at 7:38 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
>> Hi Rafael,
>>
>> On 15-03-16, 16:10, Dawei Chien wrote:
>>> MT8173 cpufreq driver select of_cpufreq_power_cooling_register registering
>>> cooling devices with dynamic power coefficient.
>>>
>>> Signed-off-by: Dawei Chien <dawei.chien@mediatek.com>
>>> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
>>
>> Can you please apply this patch from Dawei ?
>
> I can, but I'm traveling this week, so that's rather going to happen next week.
>

I don't see the patch in linux-next, did you forget to pick/push it?

Regards,
Matthias
Rafael J. Wysocki April 21, 2016, 12:41 a.m. UTC | #4
On Wednesday, April 20, 2016 01:58:07 PM Matthias Brugger wrote:
> Hi Rafael,
> 
> On 13/04/16 06:52, Rafael J. Wysocki wrote:
> > On Tue, Apr 12, 2016 at 7:38 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> >> Hi Rafael,
> >>
> >> On 15-03-16, 16:10, Dawei Chien wrote:
> >>> MT8173 cpufreq driver select of_cpufreq_power_cooling_register registering
> >>> cooling devices with dynamic power coefficient.
> >>>
> >>> Signed-off-by: Dawei Chien <dawei.chien@mediatek.com>
> >>> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> >>
> >> Can you please apply this patch from Dawei ?
> >
> > I can, but I'm traveling this week, so that's rather going to happen next week.
> >
> 
> I don't see the patch in linux-next, did you forget to pick/push it?

No, I didn't.  I just didn't have the time to get to them before.

Now, given that they are thermal patches, they really should go in via
linux-soc-thermal.git.

Eduardo, any chance to take care of these?

Thanks,
Rafael
Eduardo Valentin April 21, 2016, 3:01 a.m. UTC | #5
On Thu, Apr 21, 2016 at 02:41:24AM +0200, Rafael J. Wysocki wrote:
> On Wednesday, April 20, 2016 01:58:07 PM Matthias Brugger wrote:
> > Hi Rafael,
> > 
> > On 13/04/16 06:52, Rafael J. Wysocki wrote:
> > > On Tue, Apr 12, 2016 at 7:38 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> > >> Hi Rafael,
> > >>
> > >> On 15-03-16, 16:10, Dawei Chien wrote:
> > >>> MT8173 cpufreq driver select of_cpufreq_power_cooling_register registering
> > >>> cooling devices with dynamic power coefficient.
> > >>>
> > >>> Signed-off-by: Dawei Chien <dawei.chien@mediatek.com>
> > >>> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> > >>
> > >> Can you please apply this patch from Dawei ?
> > >
> > > I can, but I'm traveling this week, so that's rather going to happen next week.
> > >
> > 
> > I don't see the patch in linux-next, did you forget to pick/push it?
> 
> No, I didn't.  I just didn't have the time to get to them before.
> 
> Now, given that they are thermal patches, they really should go in via
> linux-soc-thermal.git.
> 
> Eduardo, any chance to take care of these?

Yes I can add this one, given that they have the proper acked-by. I was
a bit hesitant to just get them because they are touching
drivers/cpufreq. 

Anyways, I am adding this to my branch to the next merge window.


> 
> Thanks,
> Rafael
>
Eduardo Valentin April 21, 2016, 3:40 a.m. UTC | #6
On Wed, Apr 20, 2016 at 08:01:41PM -0700, Eduardo Valentin wrote:
> On Thu, Apr 21, 2016 at 02:41:24AM +0200, Rafael J. Wysocki wrote:
> > On Wednesday, April 20, 2016 01:58:07 PM Matthias Brugger wrote:
> > > Hi Rafael,
> > > 
> > > On 13/04/16 06:52, Rafael J. Wysocki wrote:
> > > > On Tue, Apr 12, 2016 at 7:38 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> > > >> Hi Rafael,
> > > >>
> > > >> On 15-03-16, 16:10, Dawei Chien wrote:
> > > >>> MT8173 cpufreq driver select of_cpufreq_power_cooling_register registering
> > > >>> cooling devices with dynamic power coefficient.
> > > >>>
> > > >>> Signed-off-by: Dawei Chien <dawei.chien@mediatek.com>
> > > >>> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> > > >>
> > > >> Can you please apply this patch from Dawei ?
> > > >
> > > > I can, but I'm traveling this week, so that's rather going to happen next week.
> > > >
> > > 
> > > I don't see the patch in linux-next, did you forget to pick/push it?
> > 
> > No, I didn't.  I just didn't have the time to get to them before.
> > 
> > Now, given that they are thermal patches, they really should go in via
> > linux-soc-thermal.git.
> > 
> > Eduardo, any chance to take care of these?
> 
> Yes I can add this one, given that they have the proper acked-by. I was
> a bit hesitant to just get them because they are touching
> drivers/cpufreq. 
> 
> Anyways, I am adding this to my branch to the next merge window.

Added the driver changes. The dt parts should go via your platform tree.
And you can add my 
Acked-by: Eduardo Valentin <edubezval@gmail.com>

on the dt changes.

> 
> 
> > 
> > Thanks,
> > Rafael
> >
Rafael J. Wysocki April 21, 2016, 5:53 p.m. UTC | #7
On Thu, Apr 21, 2016 at 5:01 AM, Eduardo Valentin <edubezval@gmail.com> wrote:
> On Thu, Apr 21, 2016 at 02:41:24AM +0200, Rafael J. Wysocki wrote:
>> On Wednesday, April 20, 2016 01:58:07 PM Matthias Brugger wrote:
>> > Hi Rafael,
>> >
>> > On 13/04/16 06:52, Rafael J. Wysocki wrote:
>> > > On Tue, Apr 12, 2016 at 7:38 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
>> > >> Hi Rafael,
>> > >>
>> > >> On 15-03-16, 16:10, Dawei Chien wrote:
>> > >>> MT8173 cpufreq driver select of_cpufreq_power_cooling_register registering
>> > >>> cooling devices with dynamic power coefficient.
>> > >>>
>> > >>> Signed-off-by: Dawei Chien <dawei.chien@mediatek.com>
>> > >>> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
>> > >>
>> > >> Can you please apply this patch from Dawei ?
>> > >
>> > > I can, but I'm traveling this week, so that's rather going to happen next week.
>> > >
>> >
>> > I don't see the patch in linux-next, did you forget to pick/push it?
>>
>> No, I didn't.  I just didn't have the time to get to them before.
>>
>> Now, given that they are thermal patches, they really should go in via
>> linux-soc-thermal.git.
>>
>> Eduardo, any chance to take care of these?
>
> Yes I can add this one, given that they have the proper acked-by. I was
> a bit hesitant to just get them because they are touching
> drivers/cpufreq.

Generally, ACKs from Viresh are sufficient for ARM cpufreq drivers
unless the maintainers of the platform in question disagree.

> Anyways, I am adding this to my branch to the next merge window.

Thanks!
diff mbox

Patch

diff --git a/drivers/cpufreq/mt8173-cpufreq.c b/drivers/cpufreq/mt8173-cpufreq.c
index 1efba34..d8ad406 100644
--- a/drivers/cpufreq/mt8173-cpufreq.c
+++ b/drivers/cpufreq/mt8173-cpufreq.c
@@ -309,17 +309,24 @@  static int mtk_cpufreq_set_target(struct cpufreq_policy *policy,
 	return 0;
 }
 
+#define DYNAMIC_POWER "dynamic-power-coefficient"
+
 static void mtk_cpufreq_ready(struct cpufreq_policy *policy)
 {
 	struct mtk_cpu_dvfs_info *info = policy->driver_data;
 	struct device_node *np = of_node_get(info->cpu_dev->of_node);
+	u32 capacitance = 0;
 
 	if (WARN_ON(!np))
 		return;
 
 	if (of_find_property(np, "#cooling-cells", NULL)) {
-		info->cdev = of_cpufreq_cooling_register(np,
-							 policy->related_cpus);
+		of_property_read_u32(np, DYNAMIC_POWER, &capacitance);
+
+		info->cdev = of_cpufreq_power_cooling_register(np,
+						policy->related_cpus,
+						capacitance,
+						NULL);
 
 		if (IS_ERR(info->cdev)) {
 			dev_err(info->cpu_dev,