From patchwork Fri Jan 19 05:35:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shilpasri G Bhat X-Patchwork-Id: 863329 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zN8h20sLxz9s81 for ; Fri, 19 Jan 2018 16:36:18 +1100 (AEDT) Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zN8h16JZczF0ys for ; Fri, 19 Jan 2018 16:36:17 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=shilpa.bhat@linux.vnet.ibm.com; receiver=) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zN8gw4CDpzF0yN for ; Fri, 19 Jan 2018 16:36:12 +1100 (AEDT) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0J5XkQh044217 for ; Fri, 19 Jan 2018 00:36:10 -0500 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fk6rwg215-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 19 Jan 2018 00:36:09 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 19 Jan 2018 05:36:07 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 19 Jan 2018 05:36:05 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0J5a5jV43647148; Fri, 19 Jan 2018 05:36:05 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A6D4211C05C; Fri, 19 Jan 2018 05:29:47 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8CC3211C058; Fri, 19 Jan 2018 05:29:46 +0000 (GMT) Received: from oc4502181600.ibm.com (unknown [9.79.183.78]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 19 Jan 2018 05:29:46 +0000 (GMT) From: Shilpasri G Bhat To: skiboot@lists.ozlabs.org Date: Fri, 19 Jan 2018 11:05:56 +0530 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 x-cbid: 18011905-0040-0000-0000-000004267B89 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18011905-0041-0000-0000-000020C9F2AB Message-Id: <1516340157-27298-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-19_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801190068 Subject: [Skiboot] [PATCH 1/2] sensors: occ: Skip GPU sensors for non-gpu systems X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Signed-off-by: Shilpasri G Bhat --- hw/occ-sensor.c | 7 +++++++ 1 file changed, 7 insertions(+) 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);