* [RFC][PATCH 1/7] ARM: OMAP4: cpuidle - Remove unused valid field
2012-03-21 9:27 [RFC][PATCH 0/7] OMAP4 cpuidle cleanup Daniel Lezcano
@ 2012-03-21 9:27 ` Daniel Lezcano
2012-03-21 9:41 ` Shilimkar, Santosh
2012-03-21 9:27 ` [RFC][PATCH 2/7] ARM: OMAP4: cpuidle - Declare the states with the driver declaration Daniel Lezcano
` (7 subsequent siblings)
8 siblings, 1 reply; 34+ messages in thread
From: Daniel Lezcano @ 2012-03-21 9:27 UTC (permalink / raw)
To: linux-omap; +Cc: linux-arm-kernel, linaro-dev
The 'valid' field is never used in the code, let's remove it.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
arch/arm/mach-omap2/cpuidle44xx.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
index cfdbb86..1210229 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -29,16 +29,15 @@ struct omap4_idle_statedata {
u32 cpu_state;
u32 mpu_logic_state;
u32 mpu_state;
- u8 valid;
};
static struct cpuidle_params cpuidle_params_table[] = {
/* C1 - CPU0 ON + CPU1 ON + MPU ON */
- {.exit_latency = 2 + 2 , .target_residency = 5, .valid = 1},
+ {.exit_latency = 2 + 2 , .target_residency = 5 },
/* C2- CPU0 OFF + CPU1 OFF + MPU CSWR */
- {.exit_latency = 328 + 440 , .target_residency = 960, .valid = 1},
+ {.exit_latency = 328 + 440 , .target_residency = 960 },
/* C3 - CPU0 OFF + CPU1 OFF + MPU OSWR */
- {.exit_latency = 460 + 518 , .target_residency = 1100, .valid = 1},
+ {.exit_latency = 460 + 518 , .target_residency = 1100 },
};
#define OMAP4_NUM_STATES ARRAY_SIZE(cpuidle_params_table)
@@ -171,7 +170,6 @@ static inline struct omap4_idle_statedata *_fill_cstate_usage(
struct omap4_idle_statedata *cx = &omap4_idle_data[idx];
struct cpuidle_state_usage *state_usage = &dev->states_usage[idx];
- cx->valid = cpuidle_params_table[idx].valid;
cpuidle_set_statedata(state_usage, cx);
return cx;
@@ -207,7 +205,6 @@ int __init omap4_idle_init(void)
_fill_cstate(drv, 0, "MPUSS ON");
drv->safe_state_index = 0;
cx = _fill_cstate_usage(dev, 0);
- cx->valid = 1; /* C1 is always valid */
cx->cpu_state = PWRDM_POWER_ON;
cx->mpu_state = PWRDM_POWER_ON;
cx->mpu_logic_state = PWRDM_POWER_RET;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 34+ messages in thread* Re: [RFC][PATCH 1/7] ARM: OMAP4: cpuidle - Remove unused valid field
2012-03-21 9:27 ` [RFC][PATCH 1/7] ARM: OMAP4: cpuidle - Remove unused valid field Daniel Lezcano
@ 2012-03-21 9:41 ` Shilimkar, Santosh
2012-03-21 9:46 ` Daniel Lezcano
0 siblings, 1 reply; 34+ messages in thread
From: Shilimkar, Santosh @ 2012-03-21 9:41 UTC (permalink / raw)
To: Daniel Lezcano; +Cc: linux-omap, linux-arm-kernel, linaro-dev
On Wed, Mar 21, 2012 at 2:57 PM, Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
> The 'valid' field is never used in the code, let's remove it.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
It is used during the registration. This field has been very useful for
debug when need to disable a C-state etc.
So unless and until there is a strong reason, i would like to retain it.
Regards
Santosh
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [RFC][PATCH 1/7] ARM: OMAP4: cpuidle - Remove unused valid field
2012-03-21 9:41 ` Shilimkar, Santosh
@ 2012-03-21 9:46 ` Daniel Lezcano
[not found] ` <4F69A37A.7020606-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
0 siblings, 1 reply; 34+ messages in thread
From: Daniel Lezcano @ 2012-03-21 9:46 UTC (permalink / raw)
To: Shilimkar, Santosh; +Cc: linux-omap, linux-arm-kernel, linaro-dev
On 03/21/2012 10:41 AM, Shilimkar, Santosh wrote:
> On Wed, Mar 21, 2012 at 2:57 PM, Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>> The 'valid' field is never used in the code, let's remove it.
>>
>> Signed-off-by: Daniel Lezcano<daniel.lezcano@linaro.org>
>> ---
> It is used during the registration. This field has been very useful for
> debug when need to disable a C-state etc.
> So unless and until there is a strong reason, i would like to retain it.
IMO if it used for debug purpose, it should be moved to the debug code
and if the debug code is not upstream, then that 'valid' should not be
here but in the out-of-tree code.
By the way, this may be a debate for nothing because a patchset is on
the way to disable C-states from sysfs.
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 34+ messages in thread
* [RFC][PATCH 2/7] ARM: OMAP4: cpuidle - Declare the states with the driver declaration
2012-03-21 9:27 [RFC][PATCH 0/7] OMAP4 cpuidle cleanup Daniel Lezcano
2012-03-21 9:27 ` [RFC][PATCH 1/7] ARM: OMAP4: cpuidle - Remove unused valid field Daniel Lezcano
@ 2012-03-21 9:27 ` Daniel Lezcano
2012-03-21 9:50 ` Santosh Shilimkar
2012-03-21 13:31 ` Jean Pihet
2012-03-21 9:27 ` [RFC][PATCH 3/7] ARM: OMAP4: cpuidle - Remove the cpuidle_params_table table Daniel Lezcano
` (6 subsequent siblings)
8 siblings, 2 replies; 34+ messages in thread
From: Daniel Lezcano @ 2012-03-21 9:27 UTC (permalink / raw)
To: linux-omap; +Cc: linux-arm-kernel, linaro-dev
The cpuidle API allows to declare statically the states in the driver
structure. Let's use it.
We do no longer need the fill_cstate function called at runtime and
by the way adding more instructions at boot time.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
arch/arm/mach-omap2/cpuidle44xx.c | 56 +++++++++++++++++++++----------------
1 files changed, 32 insertions(+), 24 deletions(-)
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
index 1210229..cd6bee7 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -148,21 +148,38 @@ DEFINE_PER_CPU(struct cpuidle_device, omap4_idle_dev);
struct cpuidle_driver omap4_idle_driver = {
.name = "omap4_idle",
.owner = THIS_MODULE,
+ .states = {
+ {
+ /* C1 - CPU0 ON + CPU1 ON + MPU ON */
+ .exit_latency = 2 + 2,
+ .target_residency = 5,
+ .flags = CPUIDLE_FLAG_TIME_VALID,
+ .enter = omap4_enter_idle,
+ .name = "C1",
+ .desc = "MPUSS ON"
+ },
+ {
+ /* C2 - CPU0 OFF + CPU1 OFF + MPU CSWR */
+ .exit_latency = 328 + 440,
+ .target_residency = 960,
+ .flags = CPUIDLE_FLAG_TIME_VALID,
+ .enter = omap4_enter_idle,
+ .name = "C2",
+ .desc = "MPUSS CSWR",
+ },
+ {
+ /* C3 - CPU0 OFF + CPU1 OFF + MPU OSWR */
+ .exit_latency = 460 + 518,
+ .target_residency = 1100,
+ .flags = CPUIDLE_FLAG_TIME_VALID,
+ .enter = omap4_enter_idle,
+ .name = "C3",
+ .desc = "MPUSS OSWR",
+ },
+ },
+ .state_count = OMAP4_NUM_STATES,
};
-static inline void _fill_cstate(struct cpuidle_driver *drv,
- int idx, const char *descr)
-{
- struct cpuidle_state *state = &drv->states[idx];
-
- state->exit_latency = cpuidle_params_table[idx].exit_latency;
- state->target_residency = cpuidle_params_table[idx].target_residency;
- state->flags = CPUIDLE_FLAG_TIME_VALID;
- state->enter = omap4_enter_idle;
- sprintf(state->name, "C%d", idx + 1);
- strncpy(state->desc, descr, CPUIDLE_DESC_LEN);
-}
-
static inline struct omap4_idle_statedata *_fill_cstate_usage(
struct cpuidle_device *dev,
int idx)
@@ -196,37 +213,28 @@ int __init omap4_idle_init(void)
if ((!mpu_pd) || (!cpu0_pd) || (!cpu1_pd))
return -ENODEV;
-
- drv->safe_state_index = -1;
dev = &per_cpu(omap4_idle_dev, cpu_id);
dev->cpu = cpu_id;
- /* C1 - CPU0 ON + CPU1 ON + MPU ON */
- _fill_cstate(drv, 0, "MPUSS ON");
- drv->safe_state_index = 0;
cx = _fill_cstate_usage(dev, 0);
cx->cpu_state = PWRDM_POWER_ON;
cx->mpu_state = PWRDM_POWER_ON;
cx->mpu_logic_state = PWRDM_POWER_RET;
- /* C2 - CPU0 OFF + CPU1 OFF + MPU CSWR */
- _fill_cstate(drv, 1, "MPUSS CSWR");
cx = _fill_cstate_usage(dev, 1);
cx->cpu_state = PWRDM_POWER_OFF;
cx->mpu_state = PWRDM_POWER_RET;
cx->mpu_logic_state = PWRDM_POWER_RET;
- /* C3 - CPU0 OFF + CPU1 OFF + MPU OSWR */
- _fill_cstate(drv, 2, "MPUSS OSWR");
cx = _fill_cstate_usage(dev, 2);
cx->cpu_state = PWRDM_POWER_OFF;
cx->mpu_state = PWRDM_POWER_RET;
cx->mpu_logic_state = PWRDM_POWER_OFF;
- drv->state_count = OMAP4_NUM_STATES;
cpuidle_register_driver(&omap4_idle_driver);
- dev->state_count = OMAP4_NUM_STATES;
+ dev->state_count = drv->state_count;
+
if (cpuidle_register_device(dev)) {
pr_err("%s: CPUidle register device failed\n", __func__);
return -EIO;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 34+ messages in thread* Re: [RFC][PATCH 2/7] ARM: OMAP4: cpuidle - Declare the states with the driver declaration
2012-03-21 9:27 ` [RFC][PATCH 2/7] ARM: OMAP4: cpuidle - Declare the states with the driver declaration Daniel Lezcano
@ 2012-03-21 9:50 ` Santosh Shilimkar
2012-03-21 13:31 ` Jean Pihet
1 sibling, 0 replies; 34+ messages in thread
From: Santosh Shilimkar @ 2012-03-21 9:50 UTC (permalink / raw)
To: Daniel Lezcano; +Cc: linux-omap, linux-arm-kernel, linaro-dev, Jean Pihet
+ Jean,
On Wednesday 21 March 2012 02:57 PM, Daniel Lezcano wrote:
> The cpuidle API allows to declare statically the states in the driver
> structure. Let's use it.
> We do no longer need the fill_cstate function called at runtime and
> by the way adding more instructions at boot time.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
Jean added the fill_cstate() kind of helpers o.w in the old
cpuidle code9OMAP30, static tables were used. Ofcourse those
tables were not uinsg the cpuidle driver structure.
Regards
santosh
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [RFC][PATCH 2/7] ARM: OMAP4: cpuidle - Declare the states with the driver declaration
2012-03-21 9:27 ` [RFC][PATCH 2/7] ARM: OMAP4: cpuidle - Declare the states with the driver declaration Daniel Lezcano
2012-03-21 9:50 ` Santosh Shilimkar
@ 2012-03-21 13:31 ` Jean Pihet
2012-03-21 14:12 ` Daniel Lezcano
1 sibling, 1 reply; 34+ messages in thread
From: Jean Pihet @ 2012-03-21 13:31 UTC (permalink / raw)
To: Daniel Lezcano; +Cc: linux-omap, linux-arm-kernel, linaro-dev
On Wed, Mar 21, 2012 at 10:27 AM, Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
> The cpuidle API allows to declare statically the states in the driver
> structure. Let's use it.
> We do no longer need the fill_cstate function called at runtime and
> by the way adding more instructions at boot time.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
> arch/arm/mach-omap2/cpuidle44xx.c | 56 +++++++++++++++++++++----------------
> 1 files changed, 32 insertions(+), 24 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
> index 1210229..cd6bee7 100644
> --- a/arch/arm/mach-omap2/cpuidle44xx.c
> +++ b/arch/arm/mach-omap2/cpuidle44xx.c
> @@ -148,21 +148,38 @@ DEFINE_PER_CPU(struct cpuidle_device, omap4_idle_dev);
> struct cpuidle_driver omap4_idle_driver = {
> .name = "omap4_idle",
> .owner = THIS_MODULE,
> + .states = {
> + {
> + /* C1 - CPU0 ON + CPU1 ON + MPU ON */
> + .exit_latency = 2 + 2,
> + .target_residency = 5,
> + .flags = CPUIDLE_FLAG_TIME_VALID,
> + .enter = omap4_enter_idle,
> + .name = "C1",
> + .desc = "MPUSS ON"
> + },
...
> + },
> + .state_count = OMAP4_NUM_STATES,
> };
>
> -static inline void _fill_cstate(struct cpuidle_driver *drv,
> - int idx, const char *descr)
> -{
> - struct cpuidle_state *state = &drv->states[idx];
> -
> - state->exit_latency = cpuidle_params_table[idx].exit_latency;
> - state->target_residency = cpuidle_params_table[idx].target_residency;
> - state->flags = CPUIDLE_FLAG_TIME_VALID;
> - state->enter = omap4_enter_idle;
> - sprintf(state->name, "C%d", idx + 1);
> - strncpy(state->desc, descr, CPUIDLE_DESC_LEN);
> -}
I am OK with this change, which makes the code more readable (and so
maintainable).
> -
> static inline struct omap4_idle_statedata *_fill_cstate_usage(
> struct cpuidle_device *dev,
> int idx)
> @@ -196,37 +213,28 @@ int __init omap4_idle_init(void)
> if ((!mpu_pd) || (!cpu0_pd) || (!cpu1_pd))
> return -ENODEV;
>
> -
> - drv->safe_state_index = -1;
> dev = &per_cpu(omap4_idle_dev, cpu_id);
> dev->cpu = cpu_id;
>
> - /* C1 - CPU0 ON + CPU1 ON + MPU ON */
> - _fill_cstate(drv, 0, "MPUSS ON");
> - drv->safe_state_index = 0;
I would keep this or add a clear comment that C1 is the safe state.
...
Thanks,
Jean
> --
> 1.7.5.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 34+ messages in thread* Re: [RFC][PATCH 2/7] ARM: OMAP4: cpuidle - Declare the states with the driver declaration
2012-03-21 13:31 ` Jean Pihet
@ 2012-03-21 14:12 ` Daniel Lezcano
0 siblings, 0 replies; 34+ messages in thread
From: Daniel Lezcano @ 2012-03-21 14:12 UTC (permalink / raw)
To: Jean Pihet; +Cc: linux-omap, linux-arm-kernel, linaro-dev
On 03/21/2012 02:31 PM, Jean Pihet wrote:
> On Wed, Mar 21, 2012 at 10:27 AM, Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>> The cpuidle API allows to declare statically the states in the driver
>> structure. Let's use it.
>> We do no longer need the fill_cstate function called at runtime and
>> by the way adding more instructions at boot time.
>>
>> Signed-off-by: Daniel Lezcano<daniel.lezcano@linaro.org>
>> ---
>> arch/arm/mach-omap2/cpuidle44xx.c | 56 +++++++++++++++++++++----------------
>> 1 files changed, 32 insertions(+), 24 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
>> index 1210229..cd6bee7 100644
>> --- a/arch/arm/mach-omap2/cpuidle44xx.c
>> +++ b/arch/arm/mach-omap2/cpuidle44xx.c
>> @@ -148,21 +148,38 @@ DEFINE_PER_CPU(struct cpuidle_device, omap4_idle_dev);
>> struct cpuidle_driver omap4_idle_driver = {
>> .name = "omap4_idle",
>> .owner = THIS_MODULE,
>> + .states = {
>> + {
>> + /* C1 - CPU0 ON + CPU1 ON + MPU ON */
>> + .exit_latency = 2 + 2,
>> + .target_residency = 5,
>> + .flags = CPUIDLE_FLAG_TIME_VALID,
>> + .enter = omap4_enter_idle,
>> + .name = "C1",
>> + .desc = "MPUSS ON"
>> + },
> ...
>> + },
>> + .state_count = OMAP4_NUM_STATES,
>> };
>>
>> -static inline void _fill_cstate(struct cpuidle_driver *drv,
>> - int idx, const char *descr)
>> -{
>> - struct cpuidle_state *state =&drv->states[idx];
>> -
>> - state->exit_latency = cpuidle_params_table[idx].exit_latency;
>> - state->target_residency = cpuidle_params_table[idx].target_residency;
>> - state->flags = CPUIDLE_FLAG_TIME_VALID;
>> - state->enter = omap4_enter_idle;
>> - sprintf(state->name, "C%d", idx + 1);
>> - strncpy(state->desc, descr, CPUIDLE_DESC_LEN);
>> -}
> I am OK with this change, which makes the code more readable (and so
> maintainable).
>
>> -
>> static inline struct omap4_idle_statedata *_fill_cstate_usage(
>> struct cpuidle_device *dev,
>> int idx)
>> @@ -196,37 +213,28 @@ int __init omap4_idle_init(void)
>> if ((!mpu_pd) || (!cpu0_pd) || (!cpu1_pd))
>> return -ENODEV;
>>
>> -
>> - drv->safe_state_index = -1;
>> dev =&per_cpu(omap4_idle_dev, cpu_id);
>> dev->cpu = cpu_id;
>>
>> - /* C1 - CPU0 ON + CPU1 ON + MPU ON */
>> - _fill_cstate(drv, 0, "MPUSS ON");
>> - drv->safe_state_index = 0;
> I would keep this or add a clear comment that C1 is the safe state.
Actually with the driver's states declaration, the safe_state_index is
initialized to zero, which means the default safe_state is always 0 with
the new API. But I can add the initialization anyway in the structure
declaration if you want.
> ...
>
> Thanks,
> Jean
>
>> --
>> 1.7.5.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 34+ messages in thread
* [RFC][PATCH 3/7] ARM: OMAP4: cpuidle - Remove the cpuidle_params_table table
2012-03-21 9:27 [RFC][PATCH 0/7] OMAP4 cpuidle cleanup Daniel Lezcano
2012-03-21 9:27 ` [RFC][PATCH 1/7] ARM: OMAP4: cpuidle - Remove unused valid field Daniel Lezcano
2012-03-21 9:27 ` [RFC][PATCH 2/7] ARM: OMAP4: cpuidle - Declare the states with the driver declaration Daniel Lezcano
@ 2012-03-21 9:27 ` Daniel Lezcano
2012-03-21 9:27 ` [RFC][PATCH 4/7] ARM: OMAP4: cpuidle - fix static omap4_idle_data declaration Daniel Lezcano
` (5 subsequent siblings)
8 siblings, 0 replies; 34+ messages in thread
From: Daniel Lezcano @ 2012-03-21 9:27 UTC (permalink / raw)
To: linux-omap; +Cc: linux-arm-kernel, linaro-dev
We do not longer need this table as we defined the values
in the driver states.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
arch/arm/mach-omap2/cpuidle44xx.c | 11 +----------
1 files changed, 1 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
index cd6bee7..0455858 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -31,16 +31,7 @@ struct omap4_idle_statedata {
u32 mpu_state;
};
-static struct cpuidle_params cpuidle_params_table[] = {
- /* C1 - CPU0 ON + CPU1 ON + MPU ON */
- {.exit_latency = 2 + 2 , .target_residency = 5 },
- /* C2- CPU0 OFF + CPU1 OFF + MPU CSWR */
- {.exit_latency = 328 + 440 , .target_residency = 960 },
- /* C3 - CPU0 OFF + CPU1 OFF + MPU OSWR */
- {.exit_latency = 460 + 518 , .target_residency = 1100 },
-};
-
-#define OMAP4_NUM_STATES ARRAY_SIZE(cpuidle_params_table)
+#define OMAP4_NUM_STATES 3
struct omap4_idle_statedata omap4_idle_data[OMAP4_NUM_STATES];
static struct powerdomain *mpu_pd, *cpu0_pd, *cpu1_pd;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 34+ messages in thread* [RFC][PATCH 4/7] ARM: OMAP4: cpuidle - fix static omap4_idle_data declaration
2012-03-21 9:27 [RFC][PATCH 0/7] OMAP4 cpuidle cleanup Daniel Lezcano
` (2 preceding siblings ...)
2012-03-21 9:27 ` [RFC][PATCH 3/7] ARM: OMAP4: cpuidle - Remove the cpuidle_params_table table Daniel Lezcano
@ 2012-03-21 9:27 ` Daniel Lezcano
2012-03-21 9:51 ` Santosh Shilimkar
2012-03-21 9:27 ` [RFC][PATCH 5/7] ARM: OMAP4: cpuidle - Initialize omap4_idle_data at compile time Daniel Lezcano
` (4 subsequent siblings)
8 siblings, 1 reply; 34+ messages in thread
From: Daniel Lezcano @ 2012-03-21 9:27 UTC (permalink / raw)
To: linux-omap; +Cc: linux-arm-kernel, linaro-dev
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
arch/arm/mach-omap2/cpuidle44xx.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
index 0455858..254f97b 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -33,7 +33,7 @@ struct omap4_idle_statedata {
#define OMAP4_NUM_STATES 3
-struct omap4_idle_statedata omap4_idle_data[OMAP4_NUM_STATES];
+static struct omap4_idle_statedata omap4_idle_data[OMAP4_NUM_STATES];
static struct powerdomain *mpu_pd, *cpu0_pd, *cpu1_pd;
/**
--
1.7.5.4
^ permalink raw reply related [flat|nested] 34+ messages in thread* Re: [RFC][PATCH 4/7] ARM: OMAP4: cpuidle - fix static omap4_idle_data declaration
2012-03-21 9:27 ` [RFC][PATCH 4/7] ARM: OMAP4: cpuidle - fix static omap4_idle_data declaration Daniel Lezcano
@ 2012-03-21 9:51 ` Santosh Shilimkar
0 siblings, 0 replies; 34+ messages in thread
From: Santosh Shilimkar @ 2012-03-21 9:51 UTC (permalink / raw)
To: Daniel Lezcano; +Cc: linux-omap, linux-arm-kernel, linaro-dev
On Wednesday 21 March 2012 02:57 PM, Daniel Lezcano wrote:
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
> arch/arm/mach-omap2/cpuidle44xx.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
> index 0455858..254f97b 100644
> --- a/arch/arm/mach-omap2/cpuidle44xx.c
> +++ b/arch/arm/mach-omap2/cpuidle44xx.c
> @@ -33,7 +33,7 @@ struct omap4_idle_statedata {
>
> #define OMAP4_NUM_STATES 3
>
> -struct omap4_idle_statedata omap4_idle_data[OMAP4_NUM_STATES];
> +static struct omap4_idle_statedata omap4_idle_data[OMAP4_NUM_STATES];
OK
Regards
santosh
^ permalink raw reply [flat|nested] 34+ messages in thread
* [RFC][PATCH 5/7] ARM: OMAP4: cpuidle - Initialize omap4_idle_data at compile time
2012-03-21 9:27 [RFC][PATCH 0/7] OMAP4 cpuidle cleanup Daniel Lezcano
` (3 preceding siblings ...)
2012-03-21 9:27 ` [RFC][PATCH 4/7] ARM: OMAP4: cpuidle - fix static omap4_idle_data declaration Daniel Lezcano
@ 2012-03-21 9:27 ` Daniel Lezcano
2012-03-21 9:27 ` [RFC][PATCH 6/7] ARM: OMAP4: cpuidle - use the omap4_idle_data variable directly Daniel Lezcano
` (3 subsequent siblings)
8 siblings, 0 replies; 34+ messages in thread
From: Daniel Lezcano @ 2012-03-21 9:27 UTC (permalink / raw)
To: linux-omap; +Cc: linux-arm-kernel, linaro-dev
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
arch/arm/mach-omap2/cpuidle44xx.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
index 254f97b..e14cd56 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -33,7 +33,24 @@ struct omap4_idle_statedata {
#define OMAP4_NUM_STATES 3
-static struct omap4_idle_statedata omap4_idle_data[OMAP4_NUM_STATES];
+static struct omap4_idle_statedata omap4_idle_data[] = {
+ {
+ .cpu_state = PWRDM_POWER_ON,
+ .mpu_state = PWRDM_POWER_ON,
+ .mpu_logic_state = PWRDM_POWER_RET,
+ },
+ {
+ .cpu_state = PWRDM_POWER_OFF,
+ .mpu_state = PWRDM_POWER_RET,
+ .mpu_logic_state = PWRDM_POWER_RET,
+ },
+ {
+ .cpu_state = PWRDM_POWER_OFF,
+ .mpu_state = PWRDM_POWER_RET,
+ .mpu_logic_state = PWRDM_POWER_OFF,
+ },
+};
+
static struct powerdomain *mpu_pd, *cpu0_pd, *cpu1_pd;
/**
--
1.7.5.4
^ permalink raw reply related [flat|nested] 34+ messages in thread* [RFC][PATCH 6/7] ARM: OMAP4: cpuidle - use the omap4_idle_data variable directly
2012-03-21 9:27 [RFC][PATCH 0/7] OMAP4 cpuidle cleanup Daniel Lezcano
` (4 preceding siblings ...)
2012-03-21 9:27 ` [RFC][PATCH 5/7] ARM: OMAP4: cpuidle - Initialize omap4_idle_data at compile time Daniel Lezcano
@ 2012-03-21 9:27 ` Daniel Lezcano
2012-03-21 9:27 ` [RFC][PATCH 7/7] ARM: OMAP4: cpuidle - remove omap4_idle_data initialization at boot time Daniel Lezcano
` (2 subsequent siblings)
8 siblings, 0 replies; 34+ messages in thread
From: Daniel Lezcano @ 2012-03-21 9:27 UTC (permalink / raw)
To: linux-omap; +Cc: linux-arm-kernel, linaro-dev
We are storing the 'omap4_idle_data' in the private data field
if the cpuidle device. As we are using this variable only in this file,
that does not really make sense. Let's use the global variable directly
instead dereferencing pointers in an idle critical loop.
Also, that simplfies the code.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
arch/arm/mach-omap2/cpuidle44xx.c | 17 +++++------------
1 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
index e14cd56..cb91d1f 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -24,7 +24,7 @@
#ifdef CONFIG_CPU_IDLE
-/* Machine specific information to be recorded in the C-state driver_data */
+/* Machine specific information */
struct omap4_idle_statedata {
u32 cpu_state;
u32 mpu_logic_state;
@@ -67,8 +67,7 @@ static int omap4_enter_idle(struct cpuidle_device *dev,
struct cpuidle_driver *drv,
int index)
{
- struct omap4_idle_statedata *cx =
- cpuidle_get_statedata(&dev->states_usage[index]);
+ struct omap4_idle_statedata *cx = &omap4_idle_data[index];
struct timespec ts_preidle, ts_postidle, ts_idle;
u32 cpu1_state;
int idle_time;
@@ -92,7 +91,7 @@ static int omap4_enter_idle(struct cpuidle_device *dev,
cpu1_state = pwrdm_read_pwrst(cpu1_pd);
if (cpu1_state != PWRDM_POWER_OFF) {
new_state_idx = drv->safe_state_index;
- cx = cpuidle_get_statedata(&dev->states_usage[new_state_idx]);
+ cx = &omap4_idle_data[new_state_idx]
}
if (index > 0)
@@ -193,15 +192,9 @@ static inline struct omap4_idle_statedata *_fill_cstate_usage(
int idx)
{
struct omap4_idle_statedata *cx = &omap4_idle_data[idx];
- struct cpuidle_state_usage *state_usage = &dev->states_usage[idx];
-
- cpuidle_set_statedata(state_usage, cx);
-
return cx;
}
-
-
/**
* omap4_idle_init - Init routine for OMAP4 idle
*
@@ -210,9 +203,9 @@ static inline struct omap4_idle_statedata *_fill_cstate_usage(
*/
int __init omap4_idle_init(void)
{
- struct omap4_idle_statedata *cx;
- struct cpuidle_device *dev;
+ struct omap4_idle_statedata *cx = &omap4_idle_data[index];
struct cpuidle_driver *drv = &omap4_idle_driver;
+ struct cpuidle_device *dev;
unsigned int cpu_id = 0;
mpu_pd = pwrdm_lookup("mpu_pwrdm");
--
1.7.5.4
^ permalink raw reply related [flat|nested] 34+ messages in thread* [RFC][PATCH 7/7] ARM: OMAP4: cpuidle - remove omap4_idle_data initialization at boot time
2012-03-21 9:27 [RFC][PATCH 0/7] OMAP4 cpuidle cleanup Daniel Lezcano
` (5 preceding siblings ...)
2012-03-21 9:27 ` [RFC][PATCH 6/7] ARM: OMAP4: cpuidle - use the omap4_idle_data variable directly Daniel Lezcano
@ 2012-03-21 9:27 ` Daniel Lezcano
2012-03-21 9:36 ` [RFC][PATCH 0/7] OMAP4 cpuidle cleanup Shilimkar, Santosh
2012-03-21 10:07 ` Santosh Shilimkar
8 siblings, 0 replies; 34+ messages in thread
From: Daniel Lezcano @ 2012-03-21 9:27 UTC (permalink / raw)
To: linux-omap; +Cc: linux-arm-kernel, linaro-dev
We initialized it at compile time, no need to do that at boot
time.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
arch/arm/mach-omap2/cpuidle44xx.c | 26 +-------------------------
1 files changed, 1 insertions(+), 25 deletions(-)
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
index cb91d1f..fd220f9 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -33,7 +33,7 @@ struct omap4_idle_statedata {
#define OMAP4_NUM_STATES 3
-static struct omap4_idle_statedata omap4_idle_data[] = {
+static struct omap4_idle_statedata omap4_idle_data[OMAP4_NUM_STATES] = {
{
.cpu_state = PWRDM_POWER_ON,
.mpu_state = PWRDM_POWER_ON,
@@ -187,14 +187,6 @@ struct cpuidle_driver omap4_idle_driver = {
.state_count = OMAP4_NUM_STATES,
};
-static inline struct omap4_idle_statedata *_fill_cstate_usage(
- struct cpuidle_device *dev,
- int idx)
-{
- struct omap4_idle_statedata *cx = &omap4_idle_data[idx];
- return cx;
-}
-
/**
* omap4_idle_init - Init routine for OMAP4 idle
*
@@ -203,7 +195,6 @@ static inline struct omap4_idle_statedata *_fill_cstate_usage(
*/
int __init omap4_idle_init(void)
{
- struct omap4_idle_statedata *cx = &omap4_idle_data[index];
struct cpuidle_driver *drv = &omap4_idle_driver;
struct cpuidle_device *dev;
unsigned int cpu_id = 0;
@@ -217,21 +208,6 @@ int __init omap4_idle_init(void)
dev = &per_cpu(omap4_idle_dev, cpu_id);
dev->cpu = cpu_id;
- cx = _fill_cstate_usage(dev, 0);
- cx->cpu_state = PWRDM_POWER_ON;
- cx->mpu_state = PWRDM_POWER_ON;
- cx->mpu_logic_state = PWRDM_POWER_RET;
-
- cx = _fill_cstate_usage(dev, 1);
- cx->cpu_state = PWRDM_POWER_OFF;
- cx->mpu_state = PWRDM_POWER_RET;
- cx->mpu_logic_state = PWRDM_POWER_RET;
-
- cx = _fill_cstate_usage(dev, 2);
- cx->cpu_state = PWRDM_POWER_OFF;
- cx->mpu_state = PWRDM_POWER_RET;
- cx->mpu_logic_state = PWRDM_POWER_OFF;
-
cpuidle_register_driver(&omap4_idle_driver);
dev->state_count = drv->state_count;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 34+ messages in thread* Re: [RFC][PATCH 0/7] OMAP4 cpuidle cleanup
2012-03-21 9:27 [RFC][PATCH 0/7] OMAP4 cpuidle cleanup Daniel Lezcano
` (6 preceding siblings ...)
2012-03-21 9:27 ` [RFC][PATCH 7/7] ARM: OMAP4: cpuidle - remove omap4_idle_data initialization at boot time Daniel Lezcano
@ 2012-03-21 9:36 ` Shilimkar, Santosh
[not found] ` <CAMQu2gxit11dSbruPLCGx37TRwo9mwNCN9JXn0fZLDTVGu2GcA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-03-21 10:07 ` Santosh Shilimkar
8 siblings, 1 reply; 34+ messages in thread
From: Shilimkar, Santosh @ 2012-03-21 9:36 UTC (permalink / raw)
To: Daniel Lezcano; +Cc: linux-omap, linux-arm-kernel, linaro-dev
On Wed, Mar 21, 2012 at 2:57 PM, Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
> This patchset is a proposition to improve a bit the code.
> The changes are code cleanup and does not change the behavior of the
> driver itself.
>
Thanks. Will have a look at your series.
> A couple a things call my intention. Why the cpuidle device is set for cpu0 only
Because the mainline code CPUIDLE is supported along with CPUhotplug.
This is going to change though with Couple CPUIDLE and corresponding
OMAP updates.
> and why the WFI is not used ?
>
I didn't get this question. Do you mean the generic WFI?
If yes, then, it's mainly because OMAP need additional
custom barriers.
Regards
Santosh
^ permalink raw reply [flat|nested] 34+ messages in thread* Re: [RFC][PATCH 0/7] OMAP4 cpuidle cleanup
2012-03-21 9:27 [RFC][PATCH 0/7] OMAP4 cpuidle cleanup Daniel Lezcano
` (7 preceding siblings ...)
2012-03-21 9:36 ` [RFC][PATCH 0/7] OMAP4 cpuidle cleanup Shilimkar, Santosh
@ 2012-03-21 10:07 ` Santosh Shilimkar
2012-03-21 10:49 ` Daniel Lezcano
` (2 more replies)
8 siblings, 3 replies; 34+ messages in thread
From: Santosh Shilimkar @ 2012-03-21 10:07 UTC (permalink / raw)
To: Daniel Lezcano; +Cc: linux-omap, linux-arm-kernel, Linaro Dev, Jean Pihet
Daniel,
On Wednesday 21 March 2012 02:57 PM, Daniel Lezcano wrote:
> This patchset is a proposition to improve a bit the code.
> The changes are code cleanup and does not change the behavior of the
> driver itself.
>
> A couple a things call my intention. Why the cpuidle device is set for cpu0 only
> and why the WFI is not used ?
>
> Daniel Lezcano (7):
> ARM: OMAP4: cpuidle - Remove unused valid field
> ARM: OMAP4: cpuidle - Declare the states with the driver declaration
> ARM: OMAP4: cpuidle - Remove the cpuidle_params_table table
> ARM: OMAP4: cpuidle - fix static omap4_idle_data declaration
> ARM: OMAP4: cpuidle - Initialize omap4_idle_data at compile time
> ARM: OMAP4: cpuidle - use the omap4_idle_data variable directly
> ARM: OMAP4: cpuidle - remove omap4_idle_data initialization at boot
> time
>
The series looks fine to me in general. This clean-up is applicable
for OMAP3 cpuidle code as well.
I want Jean to look at this series because some of his earlier
clean up has introduced those custom functions which
are getting removed in this series.
Regards
santosh
^ permalink raw reply [flat|nested] 34+ messages in thread* Re: [RFC][PATCH 0/7] OMAP4 cpuidle cleanup
2012-03-21 10:07 ` Santosh Shilimkar
@ 2012-03-21 10:49 ` Daniel Lezcano
2012-03-21 13:19 ` Jean Pihet
2012-03-21 13:43 ` Jean Pihet
2 siblings, 0 replies; 34+ messages in thread
From: Daniel Lezcano @ 2012-03-21 10:49 UTC (permalink / raw)
To: Santosh Shilimkar; +Cc: linux-omap, linux-arm-kernel, Linaro Dev, Jean Pihet
On 03/21/2012 11:07 AM, Santosh Shilimkar wrote:
> Daniel,
>
> On Wednesday 21 March 2012 02:57 PM, Daniel Lezcano wrote:
>> This patchset is a proposition to improve a bit the code.
>> The changes are code cleanup and does not change the behavior of the
>> driver itself.
>>
>> A couple a things call my intention. Why the cpuidle device is set for cpu0 only
>> and why the WFI is not used ?
>>
>> Daniel Lezcano (7):
>> ARM: OMAP4: cpuidle - Remove unused valid field
>> ARM: OMAP4: cpuidle - Declare the states with the driver declaration
>> ARM: OMAP4: cpuidle - Remove the cpuidle_params_table table
>> ARM: OMAP4: cpuidle - fix static omap4_idle_data declaration
>> ARM: OMAP4: cpuidle - Initialize omap4_idle_data at compile time
>> ARM: OMAP4: cpuidle - use the omap4_idle_data variable directly
>> ARM: OMAP4: cpuidle - remove omap4_idle_data initialization at boot
>> time
>>
> The series looks fine to me in general. This clean-up is applicable
> for OMAP3 cpuidle code as well.
Yes, I am planning to do the same for omap3.
Thanks for reviewing.
-- Daniel
> I want Jean to look at this series because some of his earlier
> clean up has introduced those custom functions which
> are getting removed in this series.
>
> Regards
> santosh
>
>
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [RFC][PATCH 0/7] OMAP4 cpuidle cleanup
2012-03-21 10:07 ` Santosh Shilimkar
2012-03-21 10:49 ` Daniel Lezcano
@ 2012-03-21 13:19 ` Jean Pihet
2012-03-21 14:13 ` Daniel Lezcano
2012-03-21 14:23 ` Shilimkar, Santosh
2012-03-21 13:43 ` Jean Pihet
2 siblings, 2 replies; 34+ messages in thread
From: Jean Pihet @ 2012-03-21 13:19 UTC (permalink / raw)
To: Santosh Shilimkar, Daniel Lezcano
Cc: linux-omap, linux-arm-kernel, Linaro Dev
Hi Santosh, Daniel,
On Wed, Mar 21, 2012 at 11:07 AM, Santosh Shilimkar
<santosh.shilimkar@ti.com> wrote:
> Daniel,
>
> On Wednesday 21 March 2012 02:57 PM, Daniel Lezcano wrote:
>> This patchset is a proposition to improve a bit the code.
>> The changes are code cleanup and does not change the behavior of the
>> driver itself.
>>
>> A couple a things call my intention. Why the cpuidle device is set for cpu0 only
>> and why the WFI is not used ?
>>
>> Daniel Lezcano (7):
>> ARM: OMAP4: cpuidle - Remove unused valid field
>> ARM: OMAP4: cpuidle - Declare the states with the driver declaration
>> ARM: OMAP4: cpuidle - Remove the cpuidle_params_table table
>> ARM: OMAP4: cpuidle - fix static omap4_idle_data declaration
>> ARM: OMAP4: cpuidle - Initialize omap4_idle_data at compile time
>> ARM: OMAP4: cpuidle - use the omap4_idle_data variable directly
>> ARM: OMAP4: cpuidle - remove omap4_idle_data initialization at boot
>> time
>>
> The series looks fine to me in general. This clean-up is applicable
> for OMAP3 cpuidle code as well.
>
> I want Jean to look at this series because some of his earlier
> clean up has introduced those custom functions which
> are getting removed in this series.
I am OK with the patch set, I only have minor remarks to the individual patches.
Reviewed-by: Jean Pihet <j-pihet@ti.com>
>
> Regards
> santosh
>
>
Thanks!
Jean
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [RFC][PATCH 0/7] OMAP4 cpuidle cleanup
2012-03-21 13:19 ` Jean Pihet
@ 2012-03-21 14:13 ` Daniel Lezcano
2012-03-21 14:23 ` Shilimkar, Santosh
1 sibling, 0 replies; 34+ messages in thread
From: Daniel Lezcano @ 2012-03-21 14:13 UTC (permalink / raw)
To: Jean Pihet; +Cc: Santosh Shilimkar, linux-omap, linux-arm-kernel, Linaro Dev
On 03/21/2012 02:19 PM, Jean Pihet wrote:
> Hi Santosh, Daniel,
>
> On Wed, Mar 21, 2012 at 11:07 AM, Santosh Shilimkar
> <santosh.shilimkar@ti.com> wrote:
>> Daniel,
>>
>> On Wednesday 21 March 2012 02:57 PM, Daniel Lezcano wrote:
>>> This patchset is a proposition to improve a bit the code.
>>> The changes are code cleanup and does not change the behavior of the
>>> driver itself.
>>>
>>> A couple a things call my intention. Why the cpuidle device is set for cpu0 only
>>> and why the WFI is not used ?
>>>
>>> Daniel Lezcano (7):
>>> ARM: OMAP4: cpuidle - Remove unused valid field
>>> ARM: OMAP4: cpuidle - Declare the states with the driver declaration
>>> ARM: OMAP4: cpuidle - Remove the cpuidle_params_table table
>>> ARM: OMAP4: cpuidle - fix static omap4_idle_data declaration
>>> ARM: OMAP4: cpuidle - Initialize omap4_idle_data at compile time
>>> ARM: OMAP4: cpuidle - use the omap4_idle_data variable directly
>>> ARM: OMAP4: cpuidle - remove omap4_idle_data initialization at boot
>>> time
>>>
>> The series looks fine to me in general. This clean-up is applicable
>> for OMAP3 cpuidle code as well.
>>
>> I want Jean to look at this series because some of his earlier
>> clean up has introduced those custom functions which
>> are getting removed in this series.
> I am OK with the patch set, I only have minor remarks to the individual patches.
>
> Reviewed-by: Jean Pihet<j-pihet@ti.com>
Thanks for the review Jean.
>>
>>
>
> Thanks!
> Jean
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [RFC][PATCH 0/7] OMAP4 cpuidle cleanup
2012-03-21 13:19 ` Jean Pihet
2012-03-21 14:13 ` Daniel Lezcano
@ 2012-03-21 14:23 ` Shilimkar, Santosh
1 sibling, 0 replies; 34+ messages in thread
From: Shilimkar, Santosh @ 2012-03-21 14:23 UTC (permalink / raw)
To: Jean Pihet; +Cc: Daniel Lezcano, linux-omap, linux-arm-kernel, Linaro Dev
On Wed, Mar 21, 2012 at 6:49 PM, Jean Pihet <jean.pihet@newoldbits.com> wrote:
> Hi Santosh, Daniel,
>
> On Wed, Mar 21, 2012 at 11:07 AM, Santosh Shilimkar
> <santosh.shilimkar@ti.com> wrote:
>> Daniel,
>>
>> On Wednesday 21 March 2012 02:57 PM, Daniel Lezcano wrote:
>>> This patchset is a proposition to improve a bit the code.
>>> The changes are code cleanup and does not change the behavior of the
>>> driver itself.
>>>
>>> A couple a things call my intention. Why the cpuidle device is set for cpu0 only
>>> and why the WFI is not used ?
>>>
>>> Daniel Lezcano (7):
>>> ARM: OMAP4: cpuidle - Remove unused valid field
>>> ARM: OMAP4: cpuidle - Declare the states with the driver declaration
>>> ARM: OMAP4: cpuidle - Remove the cpuidle_params_table table
>>> ARM: OMAP4: cpuidle - fix static omap4_idle_data declaration
>>> ARM: OMAP4: cpuidle - Initialize omap4_idle_data at compile time
>>> ARM: OMAP4: cpuidle - use the omap4_idle_data variable directly
>>> ARM: OMAP4: cpuidle - remove omap4_idle_data initialization at boot
>>> time
>>>
>> The series looks fine to me in general. This clean-up is applicable
>> for OMAP3 cpuidle code as well.
>>
>> I want Jean to look at this series because some of his earlier
>> clean up has introduced those custom functions which
>> are getting removed in this series.
> I am OK with the patch set, I only have minor remarks to the individual patches.
>
> Reviewed-by: Jean Pihet <j-pihet@ti.com>
>
Thanks Jean for looking at it.
Daniel,
Feel free to add.
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [RFC][PATCH 0/7] OMAP4 cpuidle cleanup
2012-03-21 10:07 ` Santosh Shilimkar
2012-03-21 10:49 ` Daniel Lezcano
2012-03-21 13:19 ` Jean Pihet
@ 2012-03-21 13:43 ` Jean Pihet
2012-03-21 14:19 ` Daniel Lezcano
2012-03-21 16:42 ` Daniel Lezcano
2 siblings, 2 replies; 34+ messages in thread
From: Jean Pihet @ 2012-03-21 13:43 UTC (permalink / raw)
To: Santosh Shilimkar
Cc: Daniel Lezcano, linux-omap, linux-arm-kernel, Linaro Dev
On Wed, Mar 21, 2012 at 11:07 AM, Santosh Shilimkar
<santosh.shilimkar@ti.com> wrote:
> Daniel,
>
> On Wednesday 21 March 2012 02:57 PM, Daniel Lezcano wrote:
>> This patchset is a proposition to improve a bit the code.
>> The changes are code cleanup and does not change the behavior of the
>> driver itself.
>>
>> A couple a things call my intention. Why the cpuidle device is set for cpu0 only
>> and why the WFI is not used ?
>>
>> Daniel Lezcano (7):
>> ARM: OMAP4: cpuidle - Remove unused valid field
>> ARM: OMAP4: cpuidle - Declare the states with the driver declaration
>> ARM: OMAP4: cpuidle - Remove the cpuidle_params_table table
>> ARM: OMAP4: cpuidle - fix static omap4_idle_data declaration
>> ARM: OMAP4: cpuidle - Initialize omap4_idle_data at compile time
>> ARM: OMAP4: cpuidle - use the omap4_idle_data variable directly
>> ARM: OMAP4: cpuidle - remove omap4_idle_data initialization at boot
>> time
>>
> The series looks fine to me in general. This clean-up is applicable
> for OMAP3 cpuidle code as well.
Great!
However OMAP3 has a few specific things that cannot be removed as easily:
- the 'valid' flag is used because only certain combinations of power
domains states are possible,
- the latency settings can be overriden by the board code, so the
cpuidle_params struct is needed.
> I want Jean to look at this series because some of his earlier
> clean up has introduced those custom functions which
> are getting removed in this series.
>
> Regards
> santosh
>
>
Thanks,
Jean
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [RFC][PATCH 0/7] OMAP4 cpuidle cleanup
2012-03-21 13:43 ` Jean Pihet
@ 2012-03-21 14:19 ` Daniel Lezcano
2012-03-21 16:42 ` Daniel Lezcano
1 sibling, 0 replies; 34+ messages in thread
From: Daniel Lezcano @ 2012-03-21 14:19 UTC (permalink / raw)
To: Jean Pihet; +Cc: Santosh Shilimkar, linux-omap, linux-arm-kernel, Linaro Dev
On 03/21/2012 02:43 PM, Jean Pihet wrote:
> On Wed, Mar 21, 2012 at 11:07 AM, Santosh Shilimkar
> <santosh.shilimkar@ti.com> wrote:
>> Daniel,
>>
>> On Wednesday 21 March 2012 02:57 PM, Daniel Lezcano wrote:
>>> This patchset is a proposition to improve a bit the code.
>>> The changes are code cleanup and does not change the behavior of the
>>> driver itself.
>>>
>>> A couple a things call my intention. Why the cpuidle device is set for cpu0 only
>>> and why the WFI is not used ?
>>>
>>> Daniel Lezcano (7):
>>> ARM: OMAP4: cpuidle - Remove unused valid field
>>> ARM: OMAP4: cpuidle - Declare the states with the driver declaration
>>> ARM: OMAP4: cpuidle - Remove the cpuidle_params_table table
>>> ARM: OMAP4: cpuidle - fix static omap4_idle_data declaration
>>> ARM: OMAP4: cpuidle - Initialize omap4_idle_data at compile time
>>> ARM: OMAP4: cpuidle - use the omap4_idle_data variable directly
>>> ARM: OMAP4: cpuidle - remove omap4_idle_data initialization at boot
>>> time
>>>
>> The series looks fine to me in general. This clean-up is applicable
>> for OMAP3 cpuidle code as well.
> Great!
> However OMAP3 has a few specific things that cannot be removed as easily:
> - the 'valid' flag is used because only certain combinations of power
> domains states are possible,
> - the latency settings can be overriden by the board code, so the
> cpuidle_params struct is needed.
Right, I noticed that. I am looking for a way to have a similar cleanup
for omap3 but without breaking the rx51 board.
Thanks
-- Daniel
>> I want Jean to look at this series because some of his earlier
>> clean up has introduced those custom functions which
>> are getting removed in this series.
>>
>> Regards
>> santosh
>>
>>
>
> Thanks,
> Jean
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [RFC][PATCH 0/7] OMAP4 cpuidle cleanup
2012-03-21 13:43 ` Jean Pihet
2012-03-21 14:19 ` Daniel Lezcano
@ 2012-03-21 16:42 ` Daniel Lezcano
2012-03-21 21:54 ` Kevin Hilman
1 sibling, 1 reply; 34+ messages in thread
From: Daniel Lezcano @ 2012-03-21 16:42 UTC (permalink / raw)
To: Jean Pihet; +Cc: Santosh Shilimkar, linux-omap, linux-arm-kernel, Linaro Dev
On 03/21/2012 02:43 PM, Jean Pihet wrote:
> On Wed, Mar 21, 2012 at 11:07 AM, Santosh Shilimkar
> <santosh.shilimkar@ti.com> wrote:
>> Daniel,
>>
>> On Wednesday 21 March 2012 02:57 PM, Daniel Lezcano wrote:
>>> This patchset is a proposition to improve a bit the code.
>>> The changes are code cleanup and does not change the behavior of the
>>> driver itself.
>>>
>>> A couple a things call my intention. Why the cpuidle device is set for cpu0 only
>>> and why the WFI is not used ?
>>>
>>> Daniel Lezcano (7):
>>> ARM: OMAP4: cpuidle - Remove unused valid field
>>> ARM: OMAP4: cpuidle - Declare the states with the driver declaration
>>> ARM: OMAP4: cpuidle - Remove the cpuidle_params_table table
>>> ARM: OMAP4: cpuidle - fix static omap4_idle_data declaration
>>> ARM: OMAP4: cpuidle - Initialize omap4_idle_data at compile time
>>> ARM: OMAP4: cpuidle - use the omap4_idle_data variable directly
>>> ARM: OMAP4: cpuidle - remove omap4_idle_data initialization at boot
>>> time
>>>
>> The series looks fine to me in general. This clean-up is applicable
>> for OMAP3 cpuidle code as well.
> Great!
> However OMAP3 has a few specific things that cannot be removed as easily:
> - the 'valid' flag is used because only certain combinations of power
> domains states are possible,
When I look the board-rx51 code I see:
static struct cpuidle_params rx51_cpuidle_params[] = {
/* C1 */
{110 + 162, 5 , 1},
/* C2 */
{106 + 180, 309, 1},
/* C3 */
{107 + 410, 46057, 0},
/* C4 */
{121 + 3374, 46057, 0},
/* C5 */
{855 + 1146, 46057, 1},
/* C6 */
{7580 + 4134, 484329, 0},
/* C7 */
{7505 + 15274, 484329, 1},
};
If C3, C4, C6 are not valid, so AFAICS never used in the cpuidle code
why the values are 'exit_latency' and 'target_residency' specified ? I
mean why don't we have { 0, 0, 0 } ? Is it just for information ?
I understand the purpose of this code but it looks a bit tricky and hard
to factor out. Is it acceptable to create a new cpuidle driver for rx51
then we factor out the code between omap3, omap4 and rx51 when all the
code consistent ?
> - the latency settings can be overriden by the board code, so the
> cpuidle_params struct is needed.
>
>> I want Jean to look at this series because some of his earlier
>> clean up has introduced those custom functions which
>> are getting removed in this series.
>>
>> Regards
>> santosh
>>
>>
>
> Thanks,
> Jean
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 34+ messages in thread* Re: [RFC][PATCH 0/7] OMAP4 cpuidle cleanup
2012-03-21 16:42 ` Daniel Lezcano
@ 2012-03-21 21:54 ` Kevin Hilman
[not found] ` <873991d3hs.fsf-l0cyMroinI0@public.gmane.org>
0 siblings, 1 reply; 34+ messages in thread
From: Kevin Hilman @ 2012-03-21 21:54 UTC (permalink / raw)
To: Daniel Lezcano
Cc: Jean Pihet, Santosh Shilimkar, linux-omap, linux-arm-kernel,
Linaro Dev
Daniel Lezcano <daniel.lezcano@linaro.org> writes:
> On 03/21/2012 02:43 PM, Jean Pihet wrote:
>> On Wed, Mar 21, 2012 at 11:07 AM, Santosh Shilimkar
>> <santosh.shilimkar@ti.com> wrote:
>>> Daniel,
>>>
>>> On Wednesday 21 March 2012 02:57 PM, Daniel Lezcano wrote:
>>>> This patchset is a proposition to improve a bit the code.
>>>> The changes are code cleanup and does not change the behavior of the
>>>> driver itself.
>>>>
>>>> A couple a things call my intention. Why the cpuidle device is set for cpu0 only
>>>> and why the WFI is not used ?
>>>>
>>>> Daniel Lezcano (7):
>>>> ARM: OMAP4: cpuidle - Remove unused valid field
>>>> ARM: OMAP4: cpuidle - Declare the states with the driver declaration
>>>> ARM: OMAP4: cpuidle - Remove the cpuidle_params_table table
>>>> ARM: OMAP4: cpuidle - fix static omap4_idle_data declaration
>>>> ARM: OMAP4: cpuidle - Initialize omap4_idle_data at compile time
>>>> ARM: OMAP4: cpuidle - use the omap4_idle_data variable directly
>>>> ARM: OMAP4: cpuidle - remove omap4_idle_data initialization at boot
>>>> time
>>>>
>>> The series looks fine to me in general. This clean-up is applicable
>>> for OMAP3 cpuidle code as well.
>> Great!
>> However OMAP3 has a few specific things that cannot be removed as easily:
>> - the 'valid' flag is used because only certain combinations of power
>> domains states are possible,
>
> When I look the board-rx51 code I see:
>
> static struct cpuidle_params rx51_cpuidle_params[] = {
> /* C1 */
> {110 + 162, 5 , 1},
> /* C2 */
> {106 + 180, 309, 1},
> /* C3 */
> {107 + 410, 46057, 0},
> /* C4 */
> {121 + 3374, 46057, 0},
> /* C5 */
> {855 + 1146, 46057, 1},
> /* C6 */
> {7580 + 4134, 484329, 0},
> /* C7 */
> {7505 + 15274, 484329, 1},
> };
>
> If C3, C4, C6 are not valid, so AFAICS never used in the cpuidle code
> why the values are 'exit_latency' and 'target_residency' specified ? I
> mean why don't we have { 0, 0, 0 } ? Is it just for information ?
Yes, because getting those numbers were based on some board-specific
measurements, and we don't want those values to be lost. Also, some
usage patterns might want to (re)enable those states.
> I understand the purpose of this code but it looks a bit tricky and
> hard to factor out. Is it acceptable to create a new cpuidle driver
> for rx51 then we factor out the code between omap3, omap4 and rx51
> when all the code consistent ?
I don't like that idea. All the code is the same, the only thing we
need is the ability to pass in board-specific latency numbers for the
C-states.
These latency numbers are obviously quite significant when it comes to
the final power consumption, and these values often depend on
board-specific settings. Until there are generic frameworks for
defining all the latencies involved, passing these values in from board
files is absolutly needed.
Kevin
^ permalink raw reply [flat|nested] 34+ messages in thread