diff options
author | Vipin K Parashar <vipin@linux.vnet.ibm.com> | 2017-03-10 14:57:32 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-03-31 07:22:56 +0300 |
commit | 17bb69515c6dfbe282e8a9df08ffb719ff4dbc73 (patch) | |
tree | dbdce278e818cd83380f6f76fae42982d233b256 /arch/powerpc/platforms/powernv/opal-sensor.c | |
parent | 4f9b514b765a3057341f3236c94877d9413babc7 (diff) | |
download | linux-17bb69515c6dfbe282e8a9df08ffb719ff4dbc73.tar.xz |
powerpc/powernv: Handle OPAL_WRONG_STATE in opal_get_sensor_data()
OPAL returns OPAL_WRONG_STATE upon failing to provide sensor data due to
core sleeping/offline. Add a check in opal_get_sensor_data() for sensor
read failure with OPAL_WRONG_STATE return code and return -EIO.
Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/powernv/opal-sensor.c')
-rw-r--r-- | arch/powerpc/platforms/powernv/opal-sensor.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/opal-sensor.c b/arch/powerpc/platforms/powernv/opal-sensor.c index 308efd170c27..aa267f120033 100644 --- a/arch/powerpc/platforms/powernv/opal-sensor.c +++ b/arch/powerpc/platforms/powernv/opal-sensor.c @@ -64,6 +64,10 @@ int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data) *sensor_data = be32_to_cpu(data); break; + case OPAL_WRONG_STATE: + ret = -EIO; + break; + default: ret = opal_error_code(ret); break; |