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 <rgr...@us.ibm.com>
> Cc: Michael Neuling <mi...@neuling.org>
> Cc: Gautham R. Shenoy <e...@linux.vnet.ibm.com>
> Cc: Pratik Rajesh Sampat <psam...@linux.ibm.com>
> Signed-off-by: Nicholas Piggin <npig...@gmail.com>

Just a minor comment below. But otherwise the patch looks good to me.

[..snip..]

> @@ -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 <e...@linux.vnet.ibm.com>

>               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.

Reply via email to