Re: [PATCH 1/2] cpufreq: return early from __cpufreq_driver_getavg()

2012-10-19 Thread Viresh Kumar
On Oct 20, 2012 3:37 AM, "Rafael J. Wysocki" wrote: > > On Saturday 20 of October 2012 01:42:05 Viresh Kumar wrote: > > There is no need to do cpufreq_get_cpu() and cpufreq_put_cpu() for drivers that > > don't support getavg() routine. > > > > Signed-off-by: Viresh Kumar > > The patch doesn't see

[PATCH] acpi/cpuidle: reinitialize power_usage values when adding/removing C-states

2012-10-19 Thread Julius Werner
When cpuidle drivers do not supply explicit power_usage values, cpuidle/driver.c inserts dummy values instead. When a running processor dynamically gains new C-states (e.g. after ACPI events), the power_usage values of those states will stay uninitialized, and cpuidle governors will never choose to

Re: [PATCH 1/2] cpufreq: return early from __cpufreq_driver_getavg()

2012-10-19 Thread Rafael J. Wysocki
On Saturday 20 of October 2012 01:42:05 Viresh Kumar wrote: > There is no need to do cpufreq_get_cpu() and cpufreq_put_cpu() for drivers > that > don't support getavg() routine. > > Signed-off-by: Viresh Kumar The patch doesn't seem to follow the changelog or the other way around. Thanks, Rafa

[PATCH 1/2] cpufreq: return early from __cpufreq_driver_getavg()

2012-10-19 Thread Viresh Kumar
There is no need to do cpufreq_get_cpu() and cpufreq_put_cpu() for drivers that don't support getavg() routine. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.

Re: [PATCH 4/4][V2] cpuidle: support multiple drivers

2012-10-19 Thread Lorenzo Pieralisi
On Fri, Oct 19, 2012 at 11:10:49AM +0100, Daniel Lezcano wrote: [...] > @@ -394,9 +404,9 @@ EXPORT_SYMBOL_GPL(cpuidle_disable_device); > static int __cpuidle_register_device(struct cpuidle_device *dev) > { > int ret; > - struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver()

Re: [PATCH 0/4][V2] cpuidle : multiple drivers support

2012-10-19 Thread Lorenzo Pieralisi
On Fri, Oct 19, 2012 at 11:10:45AM +0100, Daniel Lezcano wrote: > The discussion about having different cpus on the system with > different latencies bring us to a first attemp by adding a > pointer in the cpuidle_device to the states array. > > But as Rafael suggested, it would make more sense to

[PATCH 3/4][V2] cpuidle: prepare the driver core to be multi drivers aware

2012-10-19 Thread Daniel Lezcano
This patch is a preparation for the multiple drivers support. As the next patch will introduce the multiple drivers with the Kconfig option and we want to keep the code clean and understandable, this patch defines a set of functions for encapsulating some common parts and split what should be done

[PATCH 1/4][V2] cpuidle: move driver's refcount to cpuidle

2012-10-19 Thread Daniel Lezcano
We want to support different cpuidle drivers co-existing together. In this case we should move the refcount to the cpuidle_driver structure to handle several drivers at a time. Signed-off-by: Daniel Lezcano Acked-by: Peter De Schrijver --- drivers/cpuidle/driver.c | 13 - include/

[PATCH 4/4][V2] cpuidle: support multiple drivers

2012-10-19 Thread Daniel Lezcano
With the tegra3 and the big.LITTLE [1] new architectures, several cpus with different characteristics (latencies and states) can co-exists on the system. The cpuidle framework has the limitation of handling only identical cpus. This patch removes this limitation by introducing the multiple driver

[PATCH 2/4][V2] cpuidle: move driver checking within the lock section

2012-10-19 Thread Daniel Lezcano
The code is racy and the check with cpuidle_curr_driver should be done under the lock. I don't find a path in the different drivers where that could happen because the arch specific drivers are written in such way it is not possible to register a driver while it is unregistered, except maybe in a

[PATCH 0/4][V2] cpuidle : multiple drivers support

2012-10-19 Thread Daniel Lezcano
The discussion about having different cpus on the system with different latencies bring us to a first attemp by adding a pointer in the cpuidle_device to the states array. But as Rafael suggested, it would make more sense to create a driver per cpu [1]. This patch adds support for multiple cpuidl

[PATCH 3/5] cpuidle / ACPI : pass the cpuidle_device parameter

2012-10-19 Thread Daniel Lezcano
The cpuidle_device is retrieved in the function by using directly the global variable. But the caller of this function already have this device and it can be passed as a parameter. That is one small step to encapsulate the code more. Signed-off-by: Daniel Lezcano --- drivers/acpi/processor_idle.

[PATCH 5/5] cpuidle / ACPI : pass the cpuidle driver as parameter

2012-10-19 Thread Daniel Lezcano
Instead of refering to a global variable in the function, let's pass the cpuidle_driver as a parameter to this function. Signed-off-by: Daniel Lezcano --- drivers/acpi/processor_idle.c | 11 ++- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/processor_idle.

[PATCH 1/5] cpuidle / ACPI : remove unused definition

2012-10-19 Thread Daniel Lezcano
The different definitions are not used anywhere in the code. Signed-off-by: Daniel Lezcano --- drivers/acpi/processor_idle.c |7 --- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index e8086c7..1f536a3 100644

[PATCH 2/5] cpuidle / ACPI : remove pointless headers

2012-10-19 Thread Daniel Lezcano
These different headers are not needed. Signed-off-by: Daniel Lezcano --- drivers/acpi/processor_idle.c | 13 - 1 files changed, 0 insertions(+), 13 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 1f536a3..9aac69b 100644 --- a/drivers/

[PATCH 4/5] cpuidle / ACPI : change indentation logic

2012-10-19 Thread Daniel Lezcano
This patch changes the indentation by returning from the function if pr->flags.power is not set. That allows to have the remaining code out of a 'if' section. Even if the patch does not fix anything, it makes the code a bit more readable for the future cleanups. Signed-off-by: Daniel Lezcano ---