aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>2018-01-19 11:05:56 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2018-01-30 20:42:38 -0600
commitbebe096ee242057094e546d3ecbb9a077d6b7111 (patch)
tree3a3b8a3fa068416e096532c5228a54982e16f57c
parent4f24ef23411d270ef392e1dc280479c0f5304305 (diff)
downloadskiboot-bebe096ee242057094e546d3ecbb9a077d6b7111.zip
skiboot-bebe096ee242057094e546d3ecbb9a077d6b7111.tar.gz
skiboot-bebe096ee242057094e546d3ecbb9a077d6b7111.tar.bz2
sensors: occ: Skip GPU sensors for non-gpu systems
Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--hw/occ-sensor.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/occ-sensor.c b/hw/occ-sensor.c
index cb05f7c..72c8964 100644
--- a/hw/occ-sensor.c
+++ b/hw/occ-sensor.c
@@ -553,6 +553,7 @@ void occ_sensors_init(void)
struct proc_chip *chip;
struct dt_node *sg, *exports;
int occ_num = 0, i;
+ bool has_gpu = false;
/* OCC inband sensors is only supported in P9 */
if (proc_gen != proc_gen_p9)
@@ -576,6 +577,9 @@ void occ_sensors_init(void)
dt_add_property_cells(sg, "#address-cells", 1);
dt_add_property_cells(sg, "#size-cells", 0);
+ if (dt_find_compatible_node(dt_root, NULL, "ibm,power9-npu"))
+ has_gpu = true;
+
for_each_chip(chip) {
struct occ_sensor_data_header *hb;
struct occ_sensor_name *md;
@@ -604,6 +608,9 @@ void occ_sensors_init(void)
if (!(md[i].type & HWMON_SENSORS_MASK))
continue;
+ if (md[i].location == OCC_SENSOR_LOC_GPU && !has_gpu)
+ continue;
+
if (md[i].location == OCC_SENSOR_LOC_CORE) {
int num = parse_entity(md[i].name, NULL);