From: Vipin K Parashar <vipin@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: stewart@linux.vnet.ibm.com, Vipin K Parashar <vipin@linux.vnet.ibm.com>
Subject: [PATCH v3] powernv/sensor: Handle OPAL_WRONG_STATE error return
Date: Sun, 5 Mar 2017 15:21:08 +0530 [thread overview]
Message-ID: <1488707468-16643-1-git-send-email-vipin@linux.vnet.ibm.com> (raw)
OPAL returns OPAL_WRONG_STATE upon failing to provide
sensor data due to core sleeping/offline. Added check
for OPAL_WRONG_STATE rerurn code with sensor read failure.
Also added a log message indicating sensor data being
queried for sleeping/offline core.
Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
---
Changes in v3:
- Added a new case for OPAL_WRONG_STATE in sensor read
along with a log message indicating sleeping/offline core
causing read fail.
arch/powerpc/platforms/powernv/opal-sensor.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/powerpc/platforms/powernv/opal-sensor.c b/arch/powerpc/platforms/powernv/opal-sensor.c
index 308efd1..fb6d6bb 100644
--- a/arch/powerpc/platforms/powernv/opal-sensor.c
+++ b/arch/powerpc/platforms/powernv/opal-sensor.c
@@ -64,6 +64,12 @@ int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data)
*sensor_data = be32_to_cpu(data);
break;
+ case OPAL_WRONG_STATE:
+ pr_notice("%s: Sensor data read failure due to "
+ "core sleeping/offline\n", __func__);
+ ret = -EIO;
+ break;
+
default:
ret = opal_error_code(ret);
break;
--
2.7.4
next reply other threads:[~2017-03-05 9:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-05 9:51 Vipin K Parashar [this message]
2017-03-06 5:01 ` [PATCH v3] powernv/sensor: Handle OPAL_WRONG_STATE error return Vaibhav Jain
2017-03-06 9:33 ` Michael Ellerman
2017-03-06 19:55 ` Vipin K Parashar
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=1488707468-16643-1-git-send-email-vipin@linux.vnet.ibm.com \
--to=vipin@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=stewart@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).