Received: by 10.213.65.68 with SMTP id h4csp444911imn; Tue, 13 Mar 2018 09:15:21 -0700 (PDT) X-Google-Smtp-Source: AG47ELseoKGR7zibRv3RLjXwY4O3WXoaK13Vxgf23b/GxJR1HZaaWFMPyBcHr2RG9F3SC2m0HvhR X-Received: by 10.99.121.5 with SMTP id u5mr938841pgc.444.1520957720971; Tue, 13 Mar 2018 09:15:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520957720; cv=none; d=google.com; s=arc-20160816; b=bJWOnxXU4IGh+Drae1KniCFWu6FMkhetMzhzjvY9Tf0tdwsWgqokdSQ4xy1Quv/g+0 HZQb71JC9u5EE+5FJqUWjGkuLCuYyYWfWnTv9mqcAxSHQJU1VhGkMH7IaSjtAF1hkT4q k9K10uQJPYEGdwtFRpSNDih1dEhxcmQICVPTZhFI0WLOrR7hDgGrbHcRIhqt4eccCsx4 jLLeGicen06ROYFwMzjzXGZVpm77SiHLdQdWORttWYPxfm9an4Dm9s6FS9aSWhM6lYyk lflJEDJlwb6sAH6L3je5+FEZCUHNRtJeQKz+9p6phdt2ZcGwn9FA5A9IXQ+u9sAv5JGd vwaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=76X3wQNuDoTEfO2JIH5mPOmDjci/e5kIFmYgcPSxnMc=; b=1F4CHfZhyC4XJu1kd4ODJ+6UaE+6960C+3wRXdhp7fnUOUjruhGL6v4VDESpIa+znO c8fKsHUOrpZ5/w4lj/Zo1XfGlx3Id7zCwLwTFfEks0tiSjtO0omv2wWI/6MSn+Zrymq+ Gm96YJwpWf0Csg0NATwCwI49l6x3P3hkXD0PrifMO9/WBnfc/pt6EwiE0pvHkcKFb3Zs 17jTVKKFmGGC2wM+wX0vgL2L/OwW2o4+3/Ccrzdg+2Ya9qMGZA17kUFLd7OlXmJrEJod lDgWeDMjjUV5CQ+jxJdY00XwEg61clxZm/9InRhmcIRpMQtcfuPy7MIe7/Bc9PoIRZpM hERQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=FdaZsV+m; 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 h193si270088pgc.591.2018.03.13.09.15.06; Tue, 13 Mar 2018 09:15:20 -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=FdaZsV+m; 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 S934172AbeCMQN6 (ORCPT + 99 others); Tue, 13 Mar 2018 12:13:58 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:38305 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932449AbeCMQNw (ORCPT ); Tue, 13 Mar 2018 12:13:52 -0400 Received: by mail-pf0-f196.google.com with SMTP id d26so62369pfn.5 for ; Tue, 13 Mar 2018 09:13:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=76X3wQNuDoTEfO2JIH5mPOmDjci/e5kIFmYgcPSxnMc=; b=FdaZsV+mkXHigwyYKsj8S0pz5JYP1MUlqNiTvpC3mo+2rCe40VTgPfDZAQRnLlCGzH lYIzdsMx9tBkSOxj+96ifTgOaNT5yfuUsTyGVDOADzs4M+zmG+gJzbNOxOh7ZbMpuAMB Xz2eKzQxrhj+Y3OAS/IN65hWgKjwaSbxfAr7+BFOX1GR14yLeUEMCBwMsU3YEhDOkXp/ X8rR/7dJvrSgcD/QoT6FtuHyoJiC0PjFHNW9T1UkbdRiUtmTFmcJA4ppo8W3rY0fpK3W ZA7SWukhH68toezISK5WZrNM2SmVpfGXGGzZidSZ8Elf8twlzxpygOg4R+VU3ozhSNTf uyig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=76X3wQNuDoTEfO2JIH5mPOmDjci/e5kIFmYgcPSxnMc=; b=Gy/1JaLlWvwze39iEIcQmMo0G8ov6K/fHE9ciN6FXxXTExMdck3RUPD7G2IRZxc2E5 A8om95vAc3NBYymjov98Y3Uya0/Zax6LJYNzvtztltwF7SO/3FWyOCC3i2vRLnoQLy6M aDM26S8voqHRAvsk3IM7nyZlDMhETmofiy+j7wg56yewF1YyslWwzTGvl8KDPOMrqm3R mNkri3DiBfNPuoTuM+sWPqo3A7RC1/EZyVLhjkmh7iT68vkZdC9uZI5ifpGD/OKsfioK uxcFw30AxyHS8mMgBhwLjHvt0aLBeMeKT78lWUObADMoyDtAO5TEB/zvhKbkeNk2xXiY bAgQ== X-Gm-Message-State: AElRT7EkoeR9+Bc3Q1/9fm++n4HpYMXkON8w4voWBTc+3ebDf1Wpj13f z3qXAojgWbPhKmCVz1Ukkas= X-Received: by 10.99.55.11 with SMTP id e11mr922776pga.237.1520957631009; Tue, 13 Mar 2018 09:13:51 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id m24sm1209979pfj.16.2018.03.13.09.13.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Mar 2018 09:13:50 -0700 (PDT) Date: Tue, 13 Mar 2018 09:13:49 -0700 From: Guenter Roeck To: Michael Ellerman Cc: Shilpasri G Bhat , Stewart Smith , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, ego@linux.vnet.ibm.com, akshay.adiga@linux.vnet.ibm.com, svaidy@linux.vnet.ibm.com, Andrew Jeffery Subject: Re: [PATCH] powerpc/powernv : Add support to enable sensor groups Message-ID: <20180313161349.GB8834@roeck-us.net> References: <1511760988-10377-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> <87bmjmzla7.fsf@concordia.ellerman.id.au> <06a771ec-fc79-0515-9166-f2a105eb33d0@linux.vnet.ibm.com> <87609nxfym.fsf@linux.vnet.ibm.com> <7b64ac19-5463-5f30-83bb-d5ff0611dc94@linux.vnet.ibm.com> <87a7vcgrwu.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a7vcgrwu.fsf@concordia.ellerman.id.au> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 13, 2018 at 10:02:09PM +1100, Michael Ellerman wrote: > Shilpasri G Bhat writes: > > On 12/04/2017 10:11 AM, Stewart Smith wrote: > >> Shilpasri G Bhat writes: > >>> On 11/28/2017 05:07 PM, Michael Ellerman wrote: > >>>> Shilpasri G Bhat writes: > >>>> > >>>>> Adds support to enable/disable a sensor group. This can be used to > >>>>> select the sensor groups that needs to be copied to main memory by > >>>>> OCC. Sensor groups like power, temperature, current, voltage, > >>>>> frequency, utilization can be enabled/disabled at runtime. > >>>>> > >>>>> Signed-off-by: Shilpasri G Bhat > >>>>> --- > >>>>> The skiboot patch for the opal call is posted below: > >>>>> https://lists.ozlabs.org/pipermail/skiboot/2017-November/009713.html > >>>> > >>>> Can you remind me why we're doing this with a completely bespoke sysfs > >>>> API, rather than using some generic sensors API? > >>> > >>> Disabling/Enabling sensor groups is not supported in the current generic sensors > >>> API. And also we dont export all type of sensors in HWMON as not all of them are > >>> environment sensors (like performance). > >> > >> Are there barriers to adding such concepts to the generic sensors API? > > > > Yes. > > > > HWMON does not support attributes for a sensor-group. If we are to extend HWMON > > to add new per-sensor attributes to disable/enable, then we need to do either of > > the below: > > > > 1) If any one of the sensor is disabled then all the sensors belonging to that > > group will be disabled. OR > > > > 2) To disable a sensor group we need to disable all the sensors belonging to > > that group. > > Either of those sound doable, the first is probably simpler, as long as > there's some way for userspace to understand that it is modifying the > state of the whole group. > > > Another problem is hwmon categorizes the sensor-groups based on the type of > > sensors like power, temp. If OCC allows multiple groups of the same type then > > this approach adds some more complexity to the user to identify the sensors > > belonging to correct group. > > I don't really understand this one, what do you mean by "If OCC allows"? > > Also do we really expect users to be using this API? Or rather tools? > > > And lastly HWMON does not allow platform specific non-standard sensor groups > > like CSM, job-scheduler, profiler. > > Have we actually made specific proposals to the hwmon maintainers on > adding/changing any of the above? Have they rejected those proposals and > told us to go away? > Those don't really sound like sensor groups at all. What does "job-scheduler" or "profiler" have to do with hardware monitoring ? We do allow additional attributes if it makes sense, but those should be hardware monitoring related. We also allow registration with other subsystems (such as gpio) if a hardware monitoring device also has gpio pins and it seems to cumbersome to request that an mfd driver is written. However, I am not convinced that completely unrelated attributes should be handled through the hwmon subsystem; if this is deemed necessary, it rather seems that hardware monitoring is one of many functionalities of a given chip, and such functionality should be handled elsewhere. For the rest (enabling or disabling sensors dynamically), I am not specifically opposed to improving the hwmon core to add such support, but someone would have to make a specific proposal. One key problem is that the hwmon API assumes 'static' sensor allocation. The behavior of sensors appearng or disappearing at runtime (even though it happens) is not well defined. Any proposal along that line will need to ensure that userspace behavior is well documented. Thanks, Guenter