On Sun, Aug 03, 2014 at 02:54:05PM +0530, Vaidyanathan Srinivasan wrote:
> @@ -131,7 +136,12 @@ static unsigned int pstate_id_to_freq(int pstate_id)
> int i;
>
> i = powernv_pstate_info.max - pstate_id;
> - BUG_ON(i >= powernv_pstate_info.nr_pstates || i < 0);
> + if (i >= powernv_pstate_info.nr_pstates || i < 0) {
> + pr_warn("PState id %d outside of PState table, "
> + "reporting nominal id %d instead\n",
> + pstate_id, powernv_pstate_info.nominal);
> + i = powernv_pstate_info.max - powernv_pstate_info.nominal;
As of now the default loglevel corresponds to KERN_WARNING so this
warning should get printed anyway. However, don't you think it would
be better if we make it a pr_err( ) since it's a platform error that's
causing the pstate_id to go out of bounds ?
Otherwise it looks ok.
Acked-by: Gautham R. Shenoy <[email protected]>
> + }
>
> return powernv_freqs[i].frequency;
> }
--
Thanks and Regards
gautham.
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev