From: Gautham R Shenoy <ego@linux.vnet.ibm.com>
To: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>,
"Gautham R. Shenoy" <ego@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org,
Gavin Shan <gwshan@linux.vnet.ibm.com>,
Michael Ellerman <michaele@au1.ibm.com>
Subject: Re: [PATCH] powerpc/cpufreq: Add pr_warn() on OPAL firmware failures
Date: Mon, 4 Aug 2014 13:40:44 +0530 [thread overview]
Message-ID: <20140804081044.GA8221@in.ibm.com> (raw)
In-Reply-To: <20140803092158.20134.68818.stgit@drishya>
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 <ego@linux.vnet.ibm.com>
> + }
>
> return powernv_freqs[i].frequency;
> }
--
Thanks and Regards
gautham.
prev parent reply other threads:[~2014-08-04 8:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-03 9:24 [PATCH] powerpc/cpufreq: Add pr_warn() on OPAL firmware failures Vaidyanathan Srinivasan
2014-08-04 8:10 ` Gautham R Shenoy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140804081044.GA8221@in.ibm.com \
--to=ego@linux.vnet.ibm.com \
--cc=gwshan@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=michaele@au1.ibm.com \
--cc=preeti@linux.vnet.ibm.com \
--cc=svaidy@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.