Thread (6 messages) flat view 6 messages, 5 authors, 2020-09-17

Re: [PATCH] powerpc/powernv/idle: add a basic stop 0-3 driver for POWER10

From: Gautham R Shenoy <hidden>
Date: 2020-08-19 17:38:57

On Wed, Aug 19, 2020 at 07:47:00PM +1000, Nicholas Piggin wrote:
This driver does not restore stop > 3 state, so it limits itself
to states which do not lose full state or TB.

The POWER10 SPRs are sufficiently different from P9 that it seems
easier to split out the P10 code. The POWER10 deep sleep code
(e.g., the BHRB restore) has been taken out, but it can be re-added
when stop > 3 support is added.
MMCRA[BHRB] save/restore was in the shallow stop-state path. But we
can add it back later.
Cc: Ryan P Grimm <redacted>
Cc: Michael Neuling <redacted>
Cc: Gautham R. Shenoy <redacted>
Cc: Pratik Rajesh Sampat <redacted>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Just a minor comment below. But otherwise the patch looks good to me.

[..snip..]
quoted hunk ↗ jump to hunk
@@ -1093,11 +1200,15 @@ int validate_psscr_val_mask(u64 *psscr_val, u64 *psscr_mask, u32 flags)
  * @dt_idle_states: Number of idle state entries
  * Returns 0 on success
  */
-static void __init pnv_power9_idle_init(void)
+static void __init pnv_arch300_idle_init(void)
 {
 	u64 max_residency_ns = 0;
 	int i;

+	/* stop is not really architected, we only have p9,p10 drivers */
+	if (!pvr_version_is(PVR_POWER10) && !pvr_version_is(PVR_POWER9))
+		return;
+
 	/*
 	 * pnv_deepest_stop_{val,mask} should be set to values corresponding to
 	 * the deepest stop state.
@@ -1112,6 +1223,11 @@ static void __init pnv_power9_idle_init(void)
 		struct pnv_idle_states_t *state = &pnv_idle_states[i];
 		u64 psscr_rl = state->psscr_val & PSSCR_RL_MASK;

+		/* No deep loss driver implemented for POWER10 yet */
+		if (pvr_version_is(PVR_POWER10) &&
+				state->flags & (OPAL_PM_TIMEBASE_STOP|OPAL_PM_LOSE_FULL_CONTEXT))
+			continue;
+
Should we have a pr_info() informing the user the kernel is skipping
over these stop states ?

Reviewed-by: Gautham R. Shenoy <redacted>
 		if ((state->flags & OPAL_PM_TIMEBASE_STOP) &&
 		     (pnv_first_tb_loss_level > psscr_rl))
 			pnv_first_tb_loss_level = psscr_rl;
--
Thanks and Regards
gautham.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help