From: Joel Stanley <joel@jms.id.au>
To: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
Cc: rjw@rjwysocki.net, viresh.kumar@linaro.org,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
linuxppc-dev@ozlabs.org
Subject: Re: [PATCH v4 3/6] cpufreq: powernv: Register for OCC related opal_message notification
Date: Wed, 15 Jul 2015 15:47:01 +0930 [thread overview]
Message-ID: <1436941021.17171.12.camel@jms.id.au> (raw)
In-Reply-To: <1436796602-10228-4-git-send-email-shilpa.bhat@linux.vnet.ibm.com>
Hello,
On Mon, 2015-07-13 at 19:39 +0530, Shilpasri G Bhat wrote:
> diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c
> index d0c18c9..1f59958 100644
> --- a/drivers/cpufreq/powernv-cpufreq.c
> +++ b/drivers/cpufreq/powernv-cpufreq.c
> @@ -414,6 +415,71 @@ static struct notifier_block powernv_cpufreq_reboot_nb = {
> .notifier_call = powernv_cpufreq_reboot_notifier,
> };
>
> +static char throttle_reason[][30] = {
> + "No throttling",
> + "Power Cap",
> + "Processor Over Temperature",
> + "Power Supply Failure",
> + "Over Current",
> + "OCC Reset"
> + };
> +
> +static int powernv_cpufreq_occ_msg(struct notifier_block *nb,
> + unsigned long msg_type, void *_msg)
> +{
> + struct opal_msg *msg = _msg;
> + struct opal_occ_msg omsg;
> +
> + if (msg_type != OPAL_MSG_OCC)
> + return 0;
> +
> + memcpy(&omsg, msg->params, sizeof(omsg));
You need to ensure the of the members of struct opal_occ_msg are in the
correct byte order when copying them over.
Have you tested this code with in a little endian configuration?
Do the messages you're sending make sense for a system that has a BMC
instead of a FSP?
Cheers,
Joel
> +
> + switch (omsg.type) {
next prev parent reply other threads:[~2015-07-15 6:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-13 14:09 [PATCH v4 0/6] powernv: cpufreq: Report frequency throttle by OCC Shilpasri G Bhat
2015-07-13 14:09 ` [PATCH v4 1/6] cpufreq: powernv: Handle throttling due to Pmax capping at chip level Shilpasri G Bhat
2015-07-13 14:09 ` [PATCH v4 2/6] powerpc/powernv: Add definition of OPAL_MSG_OCC message type Shilpasri G Bhat
2015-07-13 14:09 ` [PATCH v4 3/6] cpufreq: powernv: Register for OCC related opal_message notification Shilpasri G Bhat
2015-07-15 6:17 ` Joel Stanley [this message]
2015-07-15 10:15 ` Shilpasri G Bhat
2015-07-13 14:10 ` [PATCH v4 4/6] cpufreq: powernv: Call throttle_check() on receiving OCC_THROTTLE Shilpasri G Bhat
2015-07-13 14:10 ` [PATCH v4 5/6] cpufreq: powernv: Report Psafe only if PMSR.psafe_mode_active bit is set Shilpasri G Bhat
2015-07-13 14:10 ` [PATCH v4 6/6] cpufreq: powernv: Restore cpu frequency to policy->cur on unthrottling Shilpasri G Bhat
2015-07-16 5:14 ` [PATCH v4 0/6] powernv: cpufreq: Report frequency throttle by OCC Viresh Kumar
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=1436941021.17171.12.camel@jms.id.au \
--to=joel@jms.id.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=rjw@rjwysocki.net \
--cc=shilpa.bhat@linux.vnet.ibm.com \
--cc=viresh.kumar@linaro.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®