Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1375766imm; Thu, 19 Jul 2018 00:01:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpelZyNN1DYbZ9nTfPtBC3lOurfJE7g+4JrsWkmwpE1iLJZX+WUjgiQibY9hBDonE1tSTxg/ X-Received: by 2002:a63:ee4e:: with SMTP id n14-v6mr8952625pgk.159.1531983691554; Thu, 19 Jul 2018 00:01:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531983691; cv=none; d=google.com; s=arc-20160816; b=U/hGwEruVJstSG0PK7+INwK80fC64szZPlw6Y+bURVKeeFArIsf4Q9Lr4A09vm+cR4 ad1ljDnd4eHAx9YXst/RpU2pI9H+4f5Caj6vtL29rA1WuSL3hCYxA88zGgHR7u4+nJTf vG8BCFQLI6lq32tZx05T7wHIBcDbjsXYLyvldv+5P1bShwmjpnv8mdV8wYyHWP2/wYeF +VqwhFqYCqwo4NqW6nfPuRzORRXuoBVLLZcGcnc4DiSQIlBQvgmjlEgHGjirh+4Rm8p8 TYb5xu2hef7uWfnAupGQ5InfLtth3wAE82LN8oCHA5oGWcMB+HzImErasjuCuAanoypc u2pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:mime-version:date:references :in-reply-to:subject:cc:to:from:arc-authentication-results; bh=on1jwt+33+H1wCkyaXH/1HBRKWzgWj8KILWACat/jpE=; b=vXnGtLC6SzBsNU5KYjLZPDg6KgIu3EyT9eU3lIniRjbrWfml/Woc8YbCClS+V3Bcj9 BMQ0iWwDlMyL+biNsUZG+yzuIbtJ7ASEd8rOh4uBlUdxaKI3hX9jSjjahHhmDwLPTMqq 01Dh9B/6E+l+dIx477psVWp9kw34ambvp4GFvU9J2cNKv2U1PzONXvouzpa8fknWEAhN z//rsoivJ5kbMI7/Azz7stI27kdbwG50LI2CEwU7h9zKNYQFQfAGw1CCQp6wZ+w9uBu8 pxkXz9GWpx03u27Hkkw6lapKZ+oR73ErT/w4iv2XblUuBmxGpCriRL1b+8R4q0p4r3QS 4BYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a7-v6si5314484pfg.200.2018.07.19.00.01.16; Thu, 19 Jul 2018 00:01:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730651AbeGSHlK (ORCPT + 99 others); Thu, 19 Jul 2018 03:41:10 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56032 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730195AbeGSHlK (ORCPT ); Thu, 19 Jul 2018 03:41:10 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6J6rxta035052 for ; Thu, 19 Jul 2018 02:59:33 -0400 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0a-001b2d01.pphosted.com with ESMTP id 2kahqsrqj8-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 19 Jul 2018 02:59:32 -0400 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 19 Jul 2018 00:59:31 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 19 Jul 2018 00:59:28 -0600 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6J6xRWM8061370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 18 Jul 2018 23:59:27 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 143966E050; Thu, 19 Jul 2018 00:59:27 -0600 (MDT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6A03B6E04C; Thu, 19 Jul 2018 00:59:25 -0600 (MDT) Received: from birb.localdomain (unknown [9.102.57.239]) by b03ledav001.gho.boulder.ibm.com (Postfix) with SMTP; Thu, 19 Jul 2018 00:59:25 -0600 (MDT) Received: by birb.localdomain (Postfix, from userid 1000) id 175824EC69D; Thu, 19 Jul 2018 16:59:21 +1000 (AEST) From: Stewart Smith To: Shilpasri G Bhat , mpe@ellerman.id.au, linux@roeck-us.net Cc: linuxppc-dev@lists.ozlabs.org, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, ego@linux.vnet.ibm.com, Shilpasri G Bhat Subject: Re: [PATCH v6 2/2] hwmon: ibmpowernv: Add attributes to enable/disable sensor groups In-Reply-To: <1531937610-6454-3-git-send-email-shilpa.bhat@linux.vnet.ibm.com> References: <1531937610-6454-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> <1531937610-6454-3-git-send-email-shilpa.bhat@linux.vnet.ibm.com> Date: Thu, 19 Jul 2018 16:59:21 +1000 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 18071906-8235-0000-0000-00000DD48F21 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009390; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01062932; UDB=6.00545790; IPR=6.00840784; MB=3.00022198; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-19 06:59:30 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18071906-8236-0000-0000-000041EF2904 Message-Id: <87lga7r9rq.fsf@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-19_03:,, 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=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807190076 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Shilpasri G Bhat writes: > On-Chip-Controller(OCC) is an embedded micro-processor in POWER9 chip > which measures various system and chip level sensors. These sensors > comprises of environmental sensors (like power, temperature, current > and voltage) and performance sensors (like utilization, frequency). > All these sensors are copied to main memory at a regular interval of > 100ms. OCC provides a way to select a group of sensors that is copied > to the main memory to increase the update frequency of selected sensor > groups. When a sensor-group is disabled, OCC will not copy it to main > memory and those sensors read 0 values. OCC is an implementation detail rather than a core part of this firmware API. Why not something like this: OPAL firmware provides the facility for some groups of sensors to be enabled/disabled at runtime to give the user the option of using the system resources for collecting these sensors or not. For example, on POWER9 systems, the On Chip Controller (OCC) gathers various system and chip level sensors and maintains their values in main memory. > +static int init_sensor_group_data(struct platform_device *pdev, > + struct platform_data *pdata) > +{ > + struct sensor_group_data *sgrp_data; > + struct device_node *groups, *sgrp; > + enum sensors type; > + int count = 0, ret = 0; > + > + groups = of_find_node_by_path("/ibm,opal/sensor-groups"); > + if (!groups) > + return ret; Why not look for the compatible property? -- Stewart Smith OPAL Architect, IBM.