[Skiboot] [PATCH V7 2/3] occ: Fix Pstate ordering for P9

Vaidyanathan Srinivasan svaidy at linux.vnet.ibm.com
Fri May 26 17:08:52 AEST 2017


* Michael Neuling <mikey at neuling.org> [2017-05-22 11:13:38]:

> On Tue, 2017-02-14 at 02:01 +0530, Shilpasri G Bhat wrote:
> > In P9 the pstate values are positive. They are continuous set of
> > unsigned integers [0 to +N] where Pmax is 0 and Pmin is N. The
> > linear ordering of pstates for P9 has changed compared to P8.
> > P8 has neagtive pstate values advertised as [0 to -N] where Pmax
> > is 0 and Pmin is -N. This patch adds helper routines to abstract
> > pstate comparison with pmax and adds sanity pstate limit checks.
> > This patch also fixes pstate arithmetic by using labs().
> 
> Can you put this comment inline in the code?  There is no mention of Pmax Pmin
> where cmp_postive/negative_pstates() is making it difficult to understand what
> it's actually doing.

Yes, we can explain this difference in specification inline in code.
Will update in a repost.

> 
> Alternatively, why don't we convert what we get on P8 to positive numbers, so
> that all the pstates numbers are positive.  Then we don't need this clumsy
> negative/positive code.

The firmware interface specification allows POWER8 IDs to be a signed
number and practically we can have negative PState IDs that are higher
frequency and positive PState IDs that are lower frequencies.

Treating them as unsigned make validation of the range and boundaries
provided by OCC difficult between POWER8 and POWER9.

The good part is that the current firmware interface for POWER9 and
future platforms treat the PState IDs as positive and hence future
platforms and implementation are clean.

--Vaidy



More information about the Skiboot mailing list