aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorShilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>2017-11-20 11:39:37 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-11-20 20:36:07 -0600
commitcbbd16bfbeef40b9f98d9d457fa024a23bfcc23e (patch)
tree50d77686a5a4f2d7dd22ece23a83464d41e605b0 /include
parent701556d2ea9b890a389183907ae484b78c05c665 (diff)
downloadskiboot-cbbd16bfbeef40b9f98d9d457fa024a23bfcc23e.zip
skiboot-cbbd16bfbeef40b9f98d9d457fa024a23bfcc23e.tar.gz
skiboot-cbbd16bfbeef40b9f98d9d457fa024a23bfcc23e.tar.bz2
sensors: dts: Assert special wakeup on idle cores while reading temperature
In P9, when a core enters a stop state, its clocks will be stopped to save power and hence we will not be able to perform a scom operation to read the DTS temperature sensor. Hence, assert a special wakeup on cores that have entered a stop state in order to successfully complete the scom operation. Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> [rlippert@google.com: Clear special wakeup only when it succeeds] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r--include/cpu.h14
-rw-r--r--include/dts.h2
2 files changed, 15 insertions, 1 deletions
diff --git a/include/cpu.h b/include/cpu.h
index 168fa99..d4b7a42 100644
--- a/include/cpu.h
+++ b/include/cpu.h
@@ -23,6 +23,7 @@
#include <device.h>
#include <opal.h>
#include <stack.h>
+#include <timer.h>
/*
* cpu_thread is our internal structure representing each
@@ -102,6 +103,16 @@ struct cpu_thread {
struct lock dctl_lock; /* primary only */
bool dctl_stopped; /* per thread */
uint32_t special_wakeup_count; /* primary */
+
+ /*
+ * For reading DTS sensors async
+ */
+ struct lock dts_lock;
+ struct timer dts_timer;
+ void *sensor_data;
+ u32 sensor_attr;
+ u32 token;
+ bool dts_read_in_progress;
};
/* This global is set to 1 to allow secondaries to callin,
@@ -284,4 +295,7 @@ extern void cpu_idle_delay(unsigned long delay);
extern void cpu_set_radix_mode(void);
extern void cpu_fast_reboot_complete(void);
+int dctl_set_special_wakeup(struct cpu_thread *t);
+int dctl_clear_special_wakeup(struct cpu_thread *t);
+
#endif /* __CPU_H */
diff --git a/include/dts.h b/include/dts.h
index b37919f..17e2e15 100644
--- a/include/dts.h
+++ b/include/dts.h
@@ -19,7 +19,7 @@
#include <stdint.h>
-extern int64_t dts_sensor_read(uint32_t sensor_hndl, uint32_t *sensor_data);
+extern int64_t dts_sensor_read(u32 sensor_hndl, int token, u32 *sensor_data);
extern bool dts_sensor_create_nodes(struct dt_node *sensors);
#endif /* __DTS_H */