Skip to contentSkip to conversation

cpuidle/powernv: Fix return value of idle index in fastsleep

PATCH In review Preeti U Murthy 1 participant 2 messages Oct 27, 2014 – Nov 10, 2014

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

PATCH 1/1 cpuidle/powernv: Fix return value of idle index in fastsleep

Commit dcb18694 : Fix ipi on Palmeto added a workaround to disable going into fastsleep on Palmeto boards which was reported to fail to boot when fastsleep was enabled. However it missed returning an idle index. Fix this.

There is probably no harm in returning the index of fastsleep although the cpu did not enter this state. The governor will notice the difference in the residency time in the idle state and the target residency of the idle state and prevent cpus from entering fastsleep from that point on. Hence the usage and time statistics logged for fastsleep will not be out of sync with reality except for the first entry.

---
Do we still need this workaround? Or can we get rid of the check on powersave_nap altogether?
---

 drivers/cpuidle/cpuidle-powernv.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpuidle/cpuidle-powernv.c +1 -1
index fa79392..c18da24 100644
@@ -70,7 +70,7 @@ static int fastsleep_loop(struct cpuidle_device *dev,
 	unsigned long new_lpcr;
 
 	if (powersave_nap < 2)
-		return;
+		return index;
 	if (unlikely(system_state < SYSTEM_RUNNING))
 		return index;
 
#1 lore raw

Hi Ben, Mikey,

Can you please take a look at this patch? I feel the commit dcb1869 was just a plug-in solution. Shouldn't we take a look at this again?

Ideally we should not need this check. With the cpuidle redesign on PowerNV going in, we can enable fastsleep at bootup itself and without checks on any debug parameters such as powersave_nap .We will then only need to check for powersave_nap == 0 and return only if that is the case. This check is still required since the user can disable all deep idle states by setting powersave_nap to 0.

Regards
Preeti U Murthy

Quoted 41 lines · Preeti U Murthy

Commit dcb18694 : Fix ipi on Palmeto added a workaround to disable going into fastsleep on Palmeto boards which was reported to fail to boot when fastsleep was enabled. However it missed returning an idle index. Fix this.

There is probably no harm in returning the index of fastsleep although the cpu did not enter this state. The governor will notice the difference in the residency time in the idle state and the target residency of the idle state and prevent cpus from entering fastsleep from that point on. Hence the usage and time statistics logged for fastsleep will not be out of sync with reality except for the first entry.

---
Do we still need this workaround? Or can we get rid of the check on powersave_nap altogether?
---

 drivers/cpuidle/cpuidle-powernv.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpuidle/cpuidle-powernv.c +1 -1
index fa79392..c18da24 100644
@@ -70,7 +70,7 @@ static int fastsleep_loop(struct cpuidle_device *dev,
 	unsigned long new_lpcr;
 
 	if (powersave_nap < 2)
-		return;
+		return index;
 	if (unlikely(system_state < SYSTEM_RUNNING))
 		return index;
 

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev