Skip to contentSkip to conversation

OMAP3: PM: CPUidle cstates names and descriptions

PATCH In review Eduardo Valentin 1 participant 5 messages Feb 16, 2010 – Mar 2, 2010 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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(-)
#1 lore raw

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
index 1cfa5a6..50fe9ab 100644
@@ -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]

#3 lore raw

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.

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
index 1cfa5a6..50fe9ab 100644
@@ -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 -0
 	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
Signature · 1 line
Eduardo Valentin
#4 lore raw

PATCH v2 2/2 OMAP3: PM: Consistently report cpuidle C-state's names

In reply to 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.

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
index 50fe9ab..7ab9992 100644
@@ -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]

#6 lore raw

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.

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
index 50fe9ab..7ab9992 100644
@@ -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