OMAP3: PM: CPUidle cstates names and descriptions
Subsystems (3)
v2 cover OMAP3: PM: CPUidle cstates names and descriptions
Hello all,
Here is a patch set with minor changes to improve our current cpuidle name convention and also to add some description about them.
Currently, depending on which Cstates are enabled/disabled, there is a inconsistency between C-state name and what power domain states it is supposed to reach when that C-state is selected. Besides, there is no way to determine what each C-state is supposed to be, from user space point of view.
So, these two minor changes, first, reports the power domain states inside the desc node, and also uses a consistent name convention for each cstate, based on power domain states.
BR,
Eduardo Valentin (2):
OMAP3: PM: Add cpuidle C-state description information
OMAP3: PM: Consistently report cpuidle C-state's names
arch/arm/mach-omap2/cpuidle34xx.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
PATCH v2 1/2 OMAP3: PM: Add cpuidle C-state description information
From: Eduardo Valentin <[email protected]>
Add a basic description information for each cpuidle C-state. The info contains only which state the MPU, NEON and CORE power domains should reach when the C-state is selected.
--- arch/arm/mach-omap2/cpuidle34xx.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/cpuidle34xx.c +4 -0
@@ -339,6 +339,7 @@ struct cpuidle_driver omap3_idle_driver = {*/ int __init omap3_idle_init (void ) { +const char *pd_states[4 ] = {"OFF" ,"RET" ,"INA" ,"ON " };int i, count =0 ;struct omap3_processor_cx *cx;struct cpuidle_state *state;
@@ -367,6 +368,9 @@ int __init omap3_idle_init(void)if (cx->type ==OMAP3_STATE_C1 ) dev->safe_state = state;sprintf (state->name,"C%d" , count+1 ); +sprintf (state->desc,"MPU=%s NEON=%s CORE=%s" , + pd_states[cx->mpu_state], pd_states[cx->mpu_state], + pd_states[cx->core_state]); count++; }
Signature · 1 line
1.6.5.7.g9ecb2
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCHv2 1/2] OMAP3: PM: Add cpuidle C-state description information
Quoted 29 lines · ext Kevin Hilman
Quoted 7 lines · Eduardo Valentin
From: Eduardo Valentin <[email protected]>
Add a basic description information for each cpuidle C-state. The info contains only which state the MPU, NEON and CORE power domains should reach when the C-state is selected.
Signed-off-by Eduardo Valentin <[email protected]>I like this series. Some minor comments...
arch/arm/mach-omap2/cpuidle34xx.c struct cpuidle_driver omap3_idle_driver = { · line 342
Quoted 13 lines
--- arch/arm/mach-omap2/cpuidle34xx.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)arch/arm/mach-omap2/cpuidle34xx.c +1
-0@@ -339,6 +339,7 @@ struct cpuidle_driver omap3_idle_driver = {*/ int __init omap3_idle_init (void ) { +const char *pd_states[4 ] = {"OFF" ,"RET" ,"INA" ,"ON " };I'd rather see something like this for this array, just in case those values change for any reason.
Quoted 5 lines
static const char *pd_states[] = {
[PWRDM_POWER_OFF] = "OFF",
[PWRDM_POWER_RET] = "RET",
[PWRDM_POWER_INACTIVE] = "INA",
[PWRDM_POWER_ON] = "ON",Nice! I'll resend with your proposal.
Quoted 17 lines
};
Quoted 15 lines
arch/arm/mach-omap2/cpuidle34xx.c +3
-0int i, count =0 ;struct omap3_processor_cx *cx;struct cpuidle_state *state;@@ -367,6 +368,9 @@ int __init omap3_idle_init(void)if (cx->type ==OMAP3_STATE_C1 ) dev->safe_state = state;sprintf (state->name,"C%d" , count+1 ); +sprintf (state->desc,"MPU=%s NEON=%s CORE=%s" , + pd_states[cx->mpu_state], pd_states[cx->mpu_state], + pd_states[cx->core_state]); count++; }Signature · 1 line
1.6.5.7.g9ecb2
Signature · 1 line
Eduardo Valentin
PATCH v2 2/2 OMAP3: PM: Consistently report cpuidle C-state's names
In reply to Eduardo ValentinFrom: Eduardo Valentin <[email protected]>
This patch changes the naming convention for OMAP3 cpuidle C-states. Currently, depending on which Cstates are enabled/disabled, there is a inconsistency between C-state name and what power domain states it is supposed to reach when that C-state is selected.
For instance, if all cstates are enabled, "C1" means mpu on and core on. But if this exact cstate is disabled, then "C1" doesn't mean same power domains state configuration anymore.
So, this patch tries changing the cstates naming convention in order to proper and consistently report the cstates names.
--- arch/arm/mach-omap2/cpuidle34xx.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/cpuidle34xx.c +1 -1
@@ -367,7 +367,7 @@ int __init omap3_idle_init(void) omap3_enter_idle_bm : omap3_enter_idle;if (cx->type ==OMAP3_STATE_C1 ) dev->safe_state = state; -sprintf (state->name,"C%d" , count+1 ); +sprintf (state->name,"C%d" , cx->type +1 );sprintf (state->desc,"MPU=%s NEON=%s CORE=%s" , pd_states[cx->mpu_state], pd_states[cx->mpu_state], pd_states[cx->core_state]);
Signature · 1 line
1.6.5.7.g9ecb2
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCHv2 2/2] OMAP3: PM: Consistently report cpuidle C-state's names
Hello Kevin,
Quoted 18 lines · ext Kevin Hilman
Quoted 7 lines · Eduardo Valentin
From: Eduardo Valentin <[email protected]>
This patch changes the naming convention for OMAP3 cpuidle C-states. Currently, depending on which Cstates are enabled/disabled, there is a inconsistency between C-state name and what power domain states it is supposed to reach when that C-state is selected.
Quoted 8 lines
For instance, if all cstates are enabled, "C1" means mpu on and core on. But if this exact cstate is disabled, then "C1" doesn't mean same power domains state configuration anymore.
So, this patch tries changing the cstates naming convention in order to proper and consistently report the cstates names.
Signed-off-by Eduardo Valentin <[email protected]>
Quoted 8 lines
I like this, however...
Have you considered patching powertop as well? Powertop doesn't seem to take into consideration the 'desc' field and just names C-states in increasing order.
So this patch combined with current powertop acutally makes things even more confusing. :(
Right. I didn't think about powertop in the first place, but you are right. It is worth to have similar changes also on it, to properly use the 'desc' and name fields.
I will figure out about it as well.
Quoted 22 lines
Kevin
Quoted 19 lines
--- arch/arm/mach-omap2/cpuidle34xx.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/arm/mach-omap2/cpuidle34xx.c +1
-1@@ -367,7 +367,7 @@ int __init omap3_idle_init(void) omap3_enter_idle_bm : omap3_enter_idle;if (cx->type ==OMAP3_STATE_C1 ) dev->safe_state = state; -sprintf (state->name,"C%d" , count+1 ); +sprintf (state->name,"C%d" , cx->type +1 );sprintf (state->desc,"MPU=%s NEON=%s CORE=%s" , pd_states[cx->mpu_state], pd_states[cx->mpu_state], pd_states[cx->core_state]);Signature · 1 line
1.6.5.7.g9ecb2
Signature · 1 line
Eduardo Valentin