Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1689729imm; Thu, 19 Jul 2018 06:20:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeXCSyoDwt9u1GrADvWP7c4pw5zikdDubRY6aAn127j6tvq2om7jgZxB90/r5HLSC7Zhhl6 X-Received: by 2002:a63:6743:: with SMTP id b64-v6mr9878481pgc.91.1532006453176; Thu, 19 Jul 2018 06:20:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532006453; cv=none; d=google.com; s=arc-20160816; b=ngy4Q4Uuv0OWet+izM3JDwHO/mAOJunY1z8WoMLQyfSciyVvOjJ2QID5oXN7aXxTck onRzP8XfAF5kvnXOwQZSRQrN37h1PhDTuHXl2laXZG7zDh8K+k9LKgLywYm+2n6LpdNK 1nleU0kWVJKVmWEh98Dth4LAU29QNTG86nrqOFW7l/W1Ale34Mp6aniY/2lj5W+sFZZr cxiEfIWBDoPBx9vGrs9YtDwF8SE9dUZF9U0Ngj/vhVN7gTBFC0Nx5nXsHiFu06ieUI55 inD5joBBHNU6DWLv43owqg2LSjEy7nVJL6VPCTxw9limpbpBrR2iu9vAD2ndv+KCnv4V 9ILg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=eK7DK4EKZhKuTSwUdarYW60Hdi0X4ze2hasQ4ld8WCA=; b=XaT0iIQ9345zfTFqT/SUKMp/r6wg1K1aaZmivAaIgvEdlbvtxQBi1QegzFfsGYZA+3 dCDE9zhOvQkqOR/NgCbIJxvwf5WXPWgawX7Q/+uYqMYsGQrPG/4P/FuaiT3pTwo//Mzz 9CnOEyNZVUHCnUXXGjnNAh2AmJoE7Ru2ZPTubUne8zxcjXlVuO8m7svX7j+uiaXoKnAh UUCkq+EeJPDYl+JOSGjjSg6rP086PeUV9UG+4+qtTiWj/8RmDVSCFhq5FQ2oQzXpS5VZ vhFde4cpg7fAeIKdbSZYJPzjfC+kebAZ9kXcw5LvCwSqlKmmAMM7TWzbtPSiK4VtN3TH VNXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=eCMyUC4b; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q65-v6si5870137pga.283.2018.07.19.06.20.38; Thu, 19 Jul 2018 06:20:53 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=eCMyUC4b; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731713AbeGSODD (ORCPT + 99 others); Thu, 19 Jul 2018 10:03:03 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:35964 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727584AbeGSODD (ORCPT ); Thu, 19 Jul 2018 10:03:03 -0400 Received: by mail-pg1-f194.google.com with SMTP id s7-v6so314955pgv.3; Thu, 19 Jul 2018 06:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=eK7DK4EKZhKuTSwUdarYW60Hdi0X4ze2hasQ4ld8WCA=; b=eCMyUC4bJfdOqyR1K8s04XxD0KJBlLkmuzYhmN67dusF/jQ1kIpO/RjkvF62p1nazT qteC+7vSc/RvqSAce47CXbkwfbDBImWf/fFoN3AWmrMRYdw3mfA28wT6/wGws6FV9v8k 3GyBsJymQ/MA0tBQBR9UiNarjFy1GfgE73sI2rTgAbzfA6voCWQ5CRXfS0FxSbDf+Zy2 P4oKvS5f4RDvQSEi1P3CoiqS/lUsEns9GPt0xpZDLsmvKE/zMQEMUzR5Ja07hF0TPw9f E7pXmZp/Uqx/Df73yWXytlTPWhJC65xL2WozjktWaR7Lmwhr2F82Rdwp4QSZybAfHAyf QURA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eK7DK4EKZhKuTSwUdarYW60Hdi0X4ze2hasQ4ld8WCA=; b=gx7MSWlap4YomrQfGQA1P71MaSNIjDGJPCywzaidsjOqmXXcmZ74hIuFEVp/y29lJ6 z37u/ZVAQrj5Png4iEP1dsBnPVsmefGnXPiSBPaIqbbKxSgXdBRZ2SSy3CH7WZ5L5q4S 2oI4iNOkenyt0Ss7S8WM3pnooA0Wqr2YukvnAWCmmxVKSPJ9rvG20cxzDV5jL3Pyd/81 bkkPGjAFmb42IvFdjBVabpVSMHcxenOeWD6A099OheFdBdG3l27FeYA69VoR/iEVv56U tKyEVi1DjGAmlQKpMAsKQ/2IIoPl6lNB8jzlgxVjvSSm4Ve1h1P5CP9HEozc3WP9ZB2l eUEg== X-Gm-Message-State: AOUpUlG/6X376VwDHOR8p6z7/k1vgnf0Y5cAae0unePXj87s5X+o73/p Co8aWGfCtDDVuI2Kk9INRb1KJLs9 X-Received: by 2002:a65:5106:: with SMTP id f6-v6mr9810978pgq.72.1532006395382; Thu, 19 Jul 2018 06:19:55 -0700 (PDT) Received: from server.roeck-us.net (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id o21-v6sm9740305pfa.54.2018.07.19.06.19.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jul 2018 06:19:54 -0700 (PDT) Subject: Re: [PATCH v6 2/2] hwmon: ibmpowernv: Add attributes to enable/disable sensor groups To: Stewart Smith , Shilpasri G Bhat , mpe@ellerman.id.au Cc: linuxppc-dev@lists.ozlabs.org, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, ego@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> <87lga7r9rq.fsf@linux.vnet.ibm.com> From: Guenter Roeck Message-ID: <06548ca9-8bc9-f0ec-7e75-1dd675972d13@roeck-us.net> Date: Thu, 19 Jul 2018 06:19:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <87lga7r9rq.fsf@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/18/2018 11:59 PM, Stewart Smith wrote: > 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? > > For both, I don't really care either way. Can you folks get to an agreement and let me know after you decided ? Thanks, Guenter