sensors: occ: Skip counter type of sensors

Message ID 1508396903-19476-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com
State New
Headers show
Series
  • sensors: occ: Skip counter type of sensors
Related show

Commit Message

Shilpasri G Bhat Oct. 19, 2017, 7:08 a.m.
Don't add counter type of sensors to device-tree as they don't
fit into hwmon sensor interface.

Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
---
 hw/occ-sensor.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Stewart Smith Oct. 23, 2017, 1:39 a.m. | #1
Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> writes:
> Don't add counter type of sensors to device-tree as they don't
> fit into hwmon sensor interface.

Shouldn't we expose these in the device tree somehow anyway? even if we
don't currently have a good way to read it from kernel?

I'd prefer we add something in skiboot now so we can get kernel patches
out later rather than be stuck with not being able to read these sensors
at all for the first rounds of machines.

Patch

diff --git a/hw/occ-sensor.c b/hw/occ-sensor.c
index 1042c11..3de91a0 100644
--- a/hw/occ-sensor.c
+++ b/hw/occ-sensor.c
@@ -591,6 +591,9 @@  void occ_sensors_init(void)
 			struct cpu_thread *c = NULL;
 			u32 handler;
 
+			if (md[i].structure_type != OCC_SENSOR_READING_FULL)
+				continue;
+
 			if (!(md[i].type & HWMON_SENSORS_MASK))
 				continue;