[Skiboot] [PATCH v3 3/3] occ: Filter out entries from Pmin to Pmax in Pstate table
Shilpasri G Bhat
shilpa.bhat at linux.vnet.ibm.com
Thu Feb 11 16:44:35 AEDT 2016
Hi,
On 02/11/2016 10:22 AM, Joel Stanley wrote:
> On Wed, Feb 10, 2016 at 8:09 AM, Shilpasri G Bhat
> <shilpa.bhat at linux.vnet.ibm.com> wrote:
>> Parse the entire pstate table provided by OCC and filter out the
>> entries that are outside the Pmax and Pmin limits.
>
> Can you explain why we need to do this. Why does the OCC give us
> values that are outisde Pmax/Pmin?
Today, OCC does not give any pstates outside Pmin/Pmax. So this patchset is
completely redundant now.
But there were two requirements where we wanted to filter the pstates, which is
no more applicable:
1) When OCC agrees to export Psafe (which is below Pmin)
- this can be filtered out via nr_pstates
2) For characterization team, who want to change the pstate table at runtime
- as long as nr_pstates is constant we are still good. (Confirmed by Vaidy)
So we can drop this patch.
Thanks and Regards,
Shilpa
>
>>
>> Signed-off-by: Shilpasri G Bhat <shilpa.bhat at linux.vnet.ibm.com>
>> ---
>> hw/occ.c | 17 +++++++++++------
>> 1 file changed, 11 insertions(+), 6 deletions(-)
>>
>> diff --git a/hw/occ.c b/hw/occ.c
>> index 4a764ef..048f3ad 100644
>> --- a/hw/occ.c
>> +++ b/hw/occ.c
>> @@ -153,7 +153,7 @@ static bool add_cpu_pstate_properties(s8 *pstate_nom)
>> u8 *dt_vdd, *dt_vcs;
>> s8 *dt_core_max = NULL;
>> bool rc, ultra_turbo_en;
>> - int i;
>> + int i, j;
>>
>> prlog(PR_DEBUG, "OCC: CPU pstate state device tree init\n");
>>
>> @@ -241,11 +241,16 @@ static bool add_cpu_pstate_properties(s8 *pstate_nom)
>> dt_core_max[i] = occ_data->core_max[i];
>> }
>>
>> - for( i=0; i < nr_pstates; i++) {
>> - dt_id[i] = occ_data->pstates[i].id;
>> - dt_freq[i] = occ_data->pstates[i].freq_khz/1000;
>> - dt_vdd[i] = occ_data->pstates[i].vdd;
>> - dt_vcs[i] = occ_data->pstates[i].vcs;
>> + for (i = 0, j = 0; i < MAX_PSTATES && j < nr_pstates; i++) {
>> + if (occ_data->pstates[i].id > pmax ||
>> + occ_data->pstates[i].id < occ_data->pstate_min)
>> + continue;
>> +
>> + dt_id[j] = occ_data->pstates[i].id;
>> + dt_freq[j] = occ_data->pstates[i].freq_khz / 1000;
>> + dt_vdd[j] = occ_data->pstates[i].vdd;
>> + dt_vcs[j] = occ_data->pstates[i].vcs;
>> + j++;
>> }
>>
>> /* Add the device-tree entries */
>> --
>> 1.9.3
>>
>
More information about the Skiboot
mailing list