Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1383953 > unrolled thread

[PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2

Started byViresh Kumar <viresh.kumar@linaro.org>
First post2016-04-21 11:00 +0200
Last post2016-04-25 23:50 +0200
Articles 7 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2 Viresh Kumar <viresh.kumar@linaro.org> - 2016-04-21 11:00 +0200
    Re: [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms  without operating-points-v2 Stephen Boyd <sboyd@codeaurora.org> - 2016-04-23 00:30 +0200
      Re: [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms  without operating-points-v2 Viresh Kumar <viresh.kumar@linaro.org> - 2016-04-25 11:40 +0200
        Re: [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms  without operating-points-v2 "Rafael J. Wysocki" <rafael@kernel.org> - 2016-04-25 23:50 +0200
          Re: [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms  without operating-points-v2 Stephen Boyd <sboyd@codeaurora.org> - 2016-04-26 00:00 +0200
            Re: [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2 "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-04-26 00:10 +0200
        Re: [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms  without operating-points-v2 Stephen Boyd <sboyd@codeaurora.org> - 2016-04-25 23:50 +0200

#1383953 — [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2

FromViresh Kumar <viresh.kumar@linaro.org>
Date2016-04-21 11:00 +0200
Subject[PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2
Message-ID<rqiCR-6mQ-3@gated-at.bofh.it>
Existing platforms, which do not support operating-points-v2, can
explicitly tell the opp core that some of the CPUs share opp tables,
with help of dev_pm_opp_set_sharing_cpus().

For such platforms, explicitly ask the opp core to provide list of CPUs
sharing the opp table with current cpu device, before falling back to
platform data.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/cpufreq-dt.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index 5f8dbe640a20..aca9bec00f91 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -147,7 +147,7 @@ static int cpufreq_init(struct cpufreq_policy *policy)
 	struct clk *cpu_clk;
 	struct dev_pm_opp *suspend_opp;
 	unsigned int transition_latency;
-	bool opp_v1 = false;
+	bool fallback = false;
 	const char *name;
 	int ret;
 
@@ -167,14 +167,16 @@ static int cpufreq_init(struct cpufreq_policy *policy)
 	/* Get OPP-sharing information from "operating-points-v2" bindings */
 	ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, policy->cpus);
 	if (ret) {
+		if (ret != -ENOENT)
+			goto out_put_clk;
+
 		/*
 		 * operating-points-v2 not supported, fallback to old method of
-		 * finding shared-OPPs for backward compatibility.
+		 * finding shared-OPPs for backward compatibility if the
+		 * platform hasn't set sharing CPUs.
 		 */
-		if (ret == -ENOENT)
-			opp_v1 = true;
-		else
-			goto out_put_clk;
+		if (dev_pm_opp_get_sharing_cpus(cpu_dev, policy->cpus))
+			fallback = true;
 	}
 
 	/*
@@ -214,7 +216,7 @@ static int cpufreq_init(struct cpufreq_policy *policy)
 		goto out_free_opp;
 	}
 
-	if (opp_v1) {
+	if (fallback) {
 		struct cpufreq_dt_platform_data *pd = cpufreq_get_driver_data();
 
 		if (!pd || !pd->independent_clocks)
-- 
2.7.1.410.g6faf27b

[toc] | [next] | [standalone]


#1385511 — Re: [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2

FromStephen Boyd <sboyd@codeaurora.org>
Date2016-04-23 00:30 +0200
SubjectRe: [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2
Message-ID<rqRKi-Ux-13@gated-at.bofh.it>
In reply to#1383953
On 04/21, Viresh Kumar wrote:
> @@ -167,14 +167,16 @@ static int cpufreq_init(struct cpufreq_policy *policy)
>  	/* Get OPP-sharing information from "operating-points-v2" bindings */
>  	ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, policy->cpus);
>  	if (ret) {
> +		if (ret != -ENOENT)
> +			goto out_put_clk;
> +
>  		/*
>  		 * operating-points-v2 not supported, fallback to old method of
> -		 * finding shared-OPPs for backward compatibility.
> +		 * finding shared-OPPs for backward compatibility if the
> +		 * platform hasn't set sharing CPUs.
>  		 */
> -		if (ret == -ENOENT)
> -			opp_v1 = true;
> -		else
> -			goto out_put_clk;
> +		if (dev_pm_opp_get_sharing_cpus(cpu_dev, policy->cpus))
> +			fallback = true;

I'm sort of lost, we make the same call twice here. Why would the
return value change between the first time and the second?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [prev] | [next] | [standalone]


#1386174 — Re: [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2

FromViresh Kumar <viresh.kumar@linaro.org>
Date2016-04-25 11:40 +0200
SubjectRe: [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2
Message-ID<rrL9M-3t5-21@gated-at.bofh.it>
In reply to#1385511
On 22-04-16, 15:27, Stephen Boyd wrote:
> On 04/21, Viresh Kumar wrote:
> > @@ -167,14 +167,16 @@ static int cpufreq_init(struct cpufreq_policy *policy)
> >  	/* Get OPP-sharing information from "operating-points-v2" bindings */
> >  	ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, policy->cpus);
> >  	if (ret) {
> > +		if (ret != -ENOENT)
> > +			goto out_put_clk;
> > +
> >  		/*
> >  		 * operating-points-v2 not supported, fallback to old method of
> > -		 * finding shared-OPPs for backward compatibility.
> > +		 * finding shared-OPPs for backward compatibility if the
> > +		 * platform hasn't set sharing CPUs.
> >  		 */
> > -		if (ret == -ENOENT)
> > -			opp_v1 = true;
> > -		else
> > -			goto out_put_clk;
> > +		if (dev_pm_opp_get_sharing_cpus(cpu_dev, policy->cpus))
> > +			fallback = true;
> 
> I'm sort of lost, we make the same call twice here. Why would the
> return value change between the first time and the second?

Two different APIs, which look similar :)

The first one tries to find the sharing-cpus relation from DT, the
other one is for v1 bindings and finds it due to platform code
dev_pm_opp_set_sharing_cpus() call.

-- 
viresh

[toc] | [prev] | [next] | [standalone]


#1386927 — Re: [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2

From"Rafael J. Wysocki" <rafael@kernel.org>
Date2016-04-25 23:50 +0200
SubjectRe: [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2
Message-ID<rrWyd-4kQ-5@gated-at.bofh.it>
In reply to#1386174
On Mon, Apr 25, 2016 at 11:45 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
> On 04/25, Viresh Kumar wrote:
>> On 22-04-16, 15:27, Stephen Boyd wrote:
>> > On 04/21, Viresh Kumar wrote:
>> > > @@ -167,14 +167,16 @@ static int cpufreq_init(struct cpufreq_policy *policy)
>> > >   /* Get OPP-sharing information from "operating-points-v2" bindings */
>> > >   ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, policy->cpus);
> [..]
>> > > +         if (dev_pm_opp_get_sharing_cpus(cpu_dev, policy->cpus))
>> > > +                 fallback = true;
>> >
>> > I'm sort of lost, we make the same call twice here. Why would the
>> > return value change between the first time and the second?
>>
>> Two different APIs, which look similar :)
>>
>> The first one tries to find the sharing-cpus relation from DT, the
>> other one is for v1 bindings and finds it due to platform code
>> dev_pm_opp_set_sharing_cpus() call.
>
> Ah thanks. My eyes glossed over the "of" part. Sounds fine.

So that would be an "ACK", right?

[toc] | [prev] | [next] | [standalone]


#1386944 — Re: [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2

FromStephen Boyd <sboyd@codeaurora.org>
Date2016-04-26 00:00 +0200
SubjectRe: [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2
Message-ID<rrWHV-4pq-23@gated-at.bofh.it>
In reply to#1386927
On 04/25, Rafael J. Wysocki wrote:
> On Mon, Apr 25, 2016 at 11:45 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
> > On 04/25, Viresh Kumar wrote:
> >> On 22-04-16, 15:27, Stephen Boyd wrote:
> >> > On 04/21, Viresh Kumar wrote:
> >> > > @@ -167,14 +167,16 @@ static int cpufreq_init(struct cpufreq_policy *policy)
> >> > >   /* Get OPP-sharing information from "operating-points-v2" bindings */
> >> > >   ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, policy->cpus);
> > [..]
> >> > > +         if (dev_pm_opp_get_sharing_cpus(cpu_dev, policy->cpus))
> >> > > +                 fallback = true;
> >> >
> >> > I'm sort of lost, we make the same call twice here. Why would the
> >> > return value change between the first time and the second?
> >>
> >> Two different APIs, which look similar :)
> >>
> >> The first one tries to find the sharing-cpus relation from DT, the
> >> other one is for v1 bindings and finds it due to platform code
> >> dev_pm_opp_set_sharing_cpus() call.
> >
> > Ah thanks. My eyes glossed over the "of" part. Sounds fine.
> 
> So that would be an "ACK", right?

Sure, I thought this was going for another round though.

I had to go back and re-read the patch once more, but you can
have my reviewed-by on this one too.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [prev] | [next] | [standalone]


#1386951

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2016-04-26 00:10 +0200
Message-ID<rrWRB-4Qn-29@gated-at.bofh.it>
In reply to#1386944
On Monday, April 25, 2016 02:56:08 PM Stephen Boyd wrote:
> On 04/25, Rafael J. Wysocki wrote:
> > On Mon, Apr 25, 2016 at 11:45 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
> > > On 04/25, Viresh Kumar wrote:
> > >> On 22-04-16, 15:27, Stephen Boyd wrote:
> > >> > On 04/21, Viresh Kumar wrote:
> > >> > > @@ -167,14 +167,16 @@ static int cpufreq_init(struct cpufreq_policy *policy)
> > >> > >   /* Get OPP-sharing information from "operating-points-v2" bindings */
> > >> > >   ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, policy->cpus);
> > > [..]
> > >> > > +         if (dev_pm_opp_get_sharing_cpus(cpu_dev, policy->cpus))
> > >> > > +                 fallback = true;
> > >> >
> > >> > I'm sort of lost, we make the same call twice here. Why would the
> > >> > return value change between the first time and the second?
> > >>
> > >> Two different APIs, which look similar :)
> > >>
> > >> The first one tries to find the sharing-cpus relation from DT, the
> > >> other one is for v1 bindings and finds it due to platform code
> > >> dev_pm_opp_set_sharing_cpus() call.
> > >
> > > Ah thanks. My eyes glossed over the "of" part. Sounds fine.
> > 
> > So that would be an "ACK", right?
> 
> Sure, I thought this was going for another round though.

OK

> I had to go back and re-read the patch once more, but you can
> have my reviewed-by on this one too.

Well, I'm still unsure what about the [6/10].

I have applied [1-5/10] for now and I'll be expecting updates or resends of
the rest.

Thanks,
Rafael

[toc] | [prev] | [next] | [standalone]


#1386936 — Re: [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2

FromStephen Boyd <sboyd@codeaurora.org>
Date2016-04-25 23:50 +0200
SubjectRe: [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2
Message-ID<rrWyd-4kQ-7@gated-at.bofh.it>
In reply to#1386174
On 04/25, Viresh Kumar wrote:
> On 22-04-16, 15:27, Stephen Boyd wrote:
> > On 04/21, Viresh Kumar wrote:
> > > @@ -167,14 +167,16 @@ static int cpufreq_init(struct cpufreq_policy *policy)
> > >  	/* Get OPP-sharing information from "operating-points-v2" bindings */
> > >  	ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, policy->cpus);
[..]
> > > +		if (dev_pm_opp_get_sharing_cpus(cpu_dev, policy->cpus))
> > > +			fallback = true;
> > 
> > I'm sort of lost, we make the same call twice here. Why would the
> > return value change between the first time and the second?
> 
> Two different APIs, which look similar :)
> 
> The first one tries to find the sharing-cpus relation from DT, the
> other one is for v1 bindings and finds it due to platform code
> dev_pm_opp_set_sharing_cpus() call.

Ah thanks. My eyes glossed over the "of" part. Sounds fine.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web