aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>2019-05-14 15:03:52 +0530
committerStewart Smith <stewart@linux.ibm.com>2019-05-20 14:20:29 +1000
commit92fd4f48014d34cb13d2c5e7de8e7b6dc1f28324 (patch)
treea19f7bd9d91751968aa139903f2373e4c2e1cf9c
parent3b36d5be5ea08c945de4075314be98e1a6a3d3dd (diff)
downloadskiboot-92fd4f48014d34cb13d2c5e7de8e7b6dc1f28324.zip
skiboot-92fd4f48014d34cb13d2c5e7de8e7b6dc1f28324.tar.gz
skiboot-92fd4f48014d34cb13d2c5e7de8e7b6dc1f28324.tar.bz2
occ-sensors: Check if OCC is reset while reading inband sensors
OCC may not be able to mark the sensor buffer as invalid while going down RESET. If OCC never comes back we will continue to read the stale sensor data. So verify if OCC is reset while reading the sensor values and propagate the appropriate error. Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r--hw/occ-sensor.c3
-rw-r--r--hw/occ.c5
-rw-r--r--include/occ.h2
3 files changed, 10 insertions, 0 deletions
diff --git a/hw/occ-sensor.c b/hw/occ-sensor.c
index c062f64..0337294 100644
--- a/hw/occ-sensor.c
+++ b/hw/occ-sensor.c
@@ -265,6 +265,9 @@ int occ_sensor_read(u32 handle, u64 *data)
if (attr > MAX_SENSOR_ATTR)
return OPAL_PARAMETER;
+ if (is_occ_reset())
+ return OPAL_HARDWARE;
+
hb = get_sensor_header_block(occ_num);
if (hb->valid != 1)
diff --git a/hw/occ.c b/hw/occ.c
index 60e176c..1d5581f 100644
--- a/hw/occ.c
+++ b/hw/occ.c
@@ -876,6 +876,11 @@ static inline u8 get_cpu_throttle(struct proc_chip *chip)
};
}
+bool is_occ_reset(void)
+{
+ return occ_reset;
+}
+
static void occ_throttle_poll(void *data __unused)
{
struct proc_chip *chip;
diff --git a/include/occ.h b/include/occ.h
index a46b921..6b831e0 100644
--- a/include/occ.h
+++ b/include/occ.h
@@ -50,6 +50,8 @@ extern void occ_add_sensor_groups(struct dt_node *sg, u32 *phandles,
extern int occ_sensor_group_enable(u32 group_hndl, int token, bool enable);
+extern bool is_occ_reset(void);
+
/*
* OCC Sensor Data
*