Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-07-01 Thread Viresh Kumar
On 2 July 2014 03:30, Mike Turquette wrote: > I can't help but think this is a pretty ugly solution. Why not specify Thanks :) > the nature of the cpu clock(s) in DT directly? There was a thread > already that discussed adding such a property to the CPU DT binding but > it seems to have gone

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-07-01 Thread Mike Turquette
Quoting Viresh Kumar (2014-07-01 04:14:04) > On 1 July 2014 00:03, Rob Herring wrote: > >> What about comparing "clocks" property in cpu DT nodes? > > > > What if a different clock is selected for some reason. > > I don't know why that will happen for CPUs sharing clock line. > > > I think a

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-07-01 Thread Viresh Kumar
On 1 July 2014 00:03, Rob Herring wrote: >> What about comparing "clocks" property in cpu DT nodes? > > What if a different clock is selected for some reason. I don't know why that will happen for CPUs sharing clock line. > I think a clock api function would be better. @Mike: What do you

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-07-01 Thread Viresh Kumar
On 1 July 2014 00:03, Rob Herring rob.herr...@linaro.org wrote: What about comparing clocks property in cpu DT nodes? What if a different clock is selected for some reason. I don't know why that will happen for CPUs sharing clock line. I think a clock api function would be better. @Mike:

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-07-01 Thread Mike Turquette
Quoting Viresh Kumar (2014-07-01 04:14:04) On 1 July 2014 00:03, Rob Herring rob.herr...@linaro.org wrote: What about comparing clocks property in cpu DT nodes? What if a different clock is selected for some reason. I don't know why that will happen for CPUs sharing clock line. I

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-07-01 Thread Viresh Kumar
On 2 July 2014 03:30, Mike Turquette mturque...@linaro.org wrote: I can't help but think this is a pretty ugly solution. Why not specify Thanks :) the nature of the cpu clock(s) in DT directly? There was a thread already that discussed adding such a property to the CPU DT binding but it

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-30 Thread Rob Herring
On Mon, Jun 30, 2014 at 2:57 AM, Viresh Kumar wrote: > On 27 June 2014 07:45, Viresh Kumar wrote: >> On 27 June 2014 07:23, Mike Turquette wrote: but it isn't future-proof if/when the clock framework starts returning dynamically allocated clock pointers for each clk_get() invocation.

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-30 Thread Viresh Kumar
On 27 June 2014 07:45, Viresh Kumar wrote: > On 27 June 2014 07:23, Mike Turquette wrote: >>> but it isn't future-proof if/when the clock framework starts returning >>> dynamically allocated clock pointers for each clk_get() invocation. >>> Maybe we need a function in the common clock framework

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-30 Thread Viresh Kumar
On 27 June 2014 07:45, Viresh Kumar viresh.ku...@linaro.org wrote: On 27 June 2014 07:23, Mike Turquette mturque...@linaro.org wrote: but it isn't future-proof if/when the clock framework starts returning dynamically allocated clock pointers for each clk_get() invocation. Maybe we need a

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-30 Thread Rob Herring
On Mon, Jun 30, 2014 at 2:57 AM, Viresh Kumar viresh.ku...@linaro.org wrote: On 27 June 2014 07:45, Viresh Kumar viresh.ku...@linaro.org wrote: On 27 June 2014 07:23, Mike Turquette mturque...@linaro.org wrote: but it isn't future-proof if/when the clock framework starts returning dynamically

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-29 Thread Viresh Kumar
On 28 June 2014 20:22, Shawn Guo wrote: > Thanks for all the effort on maintaining and improving cpufreq-cpu0 > driver. You're welcome.. > Your patch rewrote the most part of the driver, so I'd like to > hand over the driver to you. Please add yourself as the primary person > for

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-29 Thread Viresh Kumar
On 28 June 2014 20:22, Shawn Guo shawn@linaro.org wrote: Thanks for all the effort on maintaining and improving cpufreq-cpu0 driver. You're welcome.. Your patch rewrote the most part of the driver, so I'd like to hand over the driver to you. Please add yourself as the primary person

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-28 Thread Shawn Guo
On Wed, Jun 25, 2014 at 02:12:29PM +0530, Viresh Kumar wrote: > cpufreq-cpu0 driver supports only platforms which have single clock line > shared > among all CPUs. > > We already have platforms where this limitation doesn't hold true.For example > on > Qualcomm's KRAIT all CPUs have separate

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-28 Thread Shawn Guo
On Wed, Jun 25, 2014 at 02:12:29PM +0530, Viresh Kumar wrote: cpufreq-cpu0 driver supports only platforms which have single clock line shared among all CPUs. We already have platforms where this limitation doesn't hold true.For example on Qualcomm's KRAIT all CPUs have separate clock

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-26 Thread Viresh Kumar
On 27 June 2014 05:36, Stephen Boyd wrote: > I gave it a spin. It looks mostly good except for the infinite loop: Great !! > diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c > index b7ee67c4d1c0..6744321ae33d 100644 > --- a/drivers/cpufreq/cpufreq-cpu0.c > +++

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-26 Thread Viresh Kumar
On 27 June 2014 07:23, Mike Turquette wrote: >> but it isn't future-proof if/when the clock framework starts returning >> dynamically allocated clock pointers for each clk_get() invocation. >> Maybe we need a function in the common clock framework that tells us if >> the clocks are the same

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-26 Thread Mike Turquette
Quoting Stephen Boyd (2014-06-26 17:06:00) > Finally, checking for equivalent pointers from clk_get() will work now, Please don't do that. Even though it works for the current implementation, comparing those pointers from a driver violates how clkdev is supposed to work. The pointer returned by

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-26 Thread Stephen Boyd
On 06/26/14 03:52, Viresh Kumar wrote: > On 26 June 2014 00:32, Stephen Boyd wrote: >> I don't think this driver should be using regulator_get_optional() (Mark >> B. please correct me if I'm wrong). I doubt a supply is actually >> optional for CPUs, just some DTs aren't specifying them. In those

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-26 Thread Mark Brown
On Wed, Jun 25, 2014 at 12:02:25PM -0700, Stephen Boyd wrote: > I don't think this driver should be using regulator_get_optional() (Mark > B. please correct me if I'm wrong). I doubt a supply is actually > optional for CPUs, just some DTs aren't specifying them. In those cases, > the regulator

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-26 Thread Viresh Kumar
On 26 June 2014 00:32, Stephen Boyd wrote: > I don't think this driver should be using regulator_get_optional() (Mark > B. please correct me if I'm wrong). I doubt a supply is actually > optional for CPUs, just some DTs aren't specifying them. In those cases, > the regulator core will insert a

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-26 Thread Viresh Kumar
On 26 June 2014 00:32, Stephen Boyd wrote: >> + cpu_reg = regulator_get_optional(cpu_dev, "cpu0"); > I don't think this driver should be using regulator_get_optional() (Mark > B. please correct me if I'm wrong). I doubt a supply is actually > optional for CPUs, just some DTs aren't

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-26 Thread Viresh Kumar
On 26 June 2014 00:32, Stephen Boyd sb...@codeaurora.org wrote: + cpu_reg = regulator_get_optional(cpu_dev, cpu0); I don't think this driver should be using regulator_get_optional() (Mark B. please correct me if I'm wrong). I doubt a supply is actually optional for CPUs, just some DTs

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-26 Thread Viresh Kumar
On 26 June 2014 00:32, Stephen Boyd sb...@codeaurora.org wrote: I don't think this driver should be using regulator_get_optional() (Mark B. please correct me if I'm wrong). I doubt a supply is actually optional for CPUs, just some DTs aren't specifying them. In those cases, the regulator core

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-26 Thread Mark Brown
On Wed, Jun 25, 2014 at 12:02:25PM -0700, Stephen Boyd wrote: I don't think this driver should be using regulator_get_optional() (Mark B. please correct me if I'm wrong). I doubt a supply is actually optional for CPUs, just some DTs aren't specifying them. In those cases, the regulator core

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-26 Thread Stephen Boyd
On 06/26/14 03:52, Viresh Kumar wrote: On 26 June 2014 00:32, Stephen Boyd sb...@codeaurora.org wrote: I don't think this driver should be using regulator_get_optional() (Mark B. please correct me if I'm wrong). I doubt a supply is actually optional for CPUs, just some DTs aren't specifying

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-26 Thread Mike Turquette
Quoting Stephen Boyd (2014-06-26 17:06:00) Finally, checking for equivalent pointers from clk_get() will work now, Please don't do that. Even though it works for the current implementation, comparing those pointers from a driver violates how clkdev is supposed to work. The pointer returned by

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-26 Thread Viresh Kumar
On 27 June 2014 07:23, Mike Turquette mturque...@linaro.org wrote: but it isn't future-proof if/when the clock framework starts returning dynamically allocated clock pointers for each clk_get() invocation. Maybe we need a function in the common clock framework that tells us if the clocks are

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-26 Thread Viresh Kumar
On 27 June 2014 05:36, Stephen Boyd sb...@codeaurora.org wrote: I gave it a spin. It looks mostly good except for the infinite loop: Great !! diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index b7ee67c4d1c0..6744321ae33d 100644 ---

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-25 Thread Viresh Kumar
On 26 June 2014 00:32, Stephen Boyd wrote: > It should be easy enough to read the clocks property from DT for all the > CPU nodes and check to see if they're the same? Not everybody has clocks supported in DT and I am not sure if it will even work for the current users as well.. But yeah,

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-25 Thread Stephen Boyd
On 06/25/14 01:42, Viresh Kumar wrote: > cpufreq-cpu0 driver supports only platforms which have single clock line > shared > among all CPUs. > > We already have platforms where this limitation doesn't hold true.For example > on > Qualcomm's KRAIT all CPUs have separate clock line and so have

[PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-25 Thread Viresh Kumar
cpufreq-cpu0 driver supports only platforms which have single clock line shared among all CPUs. We already have platforms where this limitation doesn't hold true.For example on Qualcomm's KRAIT all CPUs have separate clock line and so have separate policies. Instead of adding another driver for

[PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-25 Thread Viresh Kumar
cpufreq-cpu0 driver supports only platforms which have single clock line shared among all CPUs. We already have platforms where this limitation doesn't hold true.For example on Qualcomm's KRAIT all CPUs have separate clock line and so have separate policies. Instead of adding another driver for

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-25 Thread Stephen Boyd
On 06/25/14 01:42, Viresh Kumar wrote: cpufreq-cpu0 driver supports only platforms which have single clock line shared among all CPUs. We already have platforms where this limitation doesn't hold true.For example on Qualcomm's KRAIT all CPUs have separate clock line and so have separate

Re: [PATCH 2/2] cpufreq: cpu0: Extend support beyond CPU0

2014-06-25 Thread Viresh Kumar
On 26 June 2014 00:32, Stephen Boyd sb...@codeaurora.org wrote: It should be easy enough to read the clocks property from DT for all the CPU nodes and check to see if they're the same? Not everybody has clocks supported in DT and I am not sure if it will even work for the current users as