From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.3 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BC94C4363D for ; Tue, 20 Oct 2020 23:41:54 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 43EA921707 for ; Tue, 20 Oct 2020 23:41:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RlWvxR26" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 43EA921707 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CG9Bk333szDqgF for ; Wed, 21 Oct 2020 10:41:50 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::f31; helo=mail-qv1-xf31.google.com; envelope-from=tbnguyen1985@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=RlWvxR26; dkim-atps=neutral Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CG98R2FcMzDqb1 for ; Wed, 21 Oct 2020 10:39:49 +1100 (AEDT) Received: by mail-qv1-xf31.google.com with SMTP id h11so154600qvq.7 for ; Tue, 20 Oct 2020 16:39:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EzcAwOW1kOiKHPVGBJ/eKiJ2ekH3ZIcqcT4mCyZp8bA=; b=RlWvxR26VYo0KNHedt2zfhhZzbQmHZE9PtHtBqZWVh0SBHyKh6sh4SotGpfxIZj+rR EwSc2Fb/ptzfDt1fNDtEnRw6uV59GcpU/RbEw5eCg/+505A/bwFYgmff2StsLpCEvhkT KPKQn1kitChGwBXsGVjoMFxNgYU6TVkEVIRkRby00Fy1GPve58vu4xHtUNnEQ7aw21sP TR8KbOpOV6I84KZm6DJMOthu3ELApzaGzxLBbJb8SGhS2zVDiwW9ob2PavlR1fyKGevS 5agY0eQApYvuzu4TkmNSWVOwV0yrkQUXWiLHya4F4KTgfzrrzpSOJqI72PCminpE4TPm yYZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EzcAwOW1kOiKHPVGBJ/eKiJ2ekH3ZIcqcT4mCyZp8bA=; b=s3gOBYgBPdnBzYPTrbTSz8nb5hqpfkLiJD3hX4UJENcJZFbn0IDmRw4SnQiIpY4RkW z0rwIpv7wQepJULW+X8UnQXMN2DGfODYuEpUpzlwBTmcUK1D2qH4WbtcWputpO1/7hi3 Wo8kZS9DphGlVU2GtO9gpF7HtgnMNZF+9Mni6YQf3ANSicqY8aJPYQRLg45h2pYqkapG 93NrzU/OdyxeECrjjOejDVN6KApvrDdY1CoQPAHFKF3KcGu9HBLSbAvh+eYDH5bIfndP AkaYhPUr6fPnnJvVHfFGRwkLG0TKjeLw+clBtVuBjlWmscWLd1zChv1LfxFBmr/638kd 5bcw== X-Gm-Message-State: AOAM533uij91Ii0ZtOfyShWmoL0er52cz34XJqJrodwoxgb9B96D/Nay bfYDJbT4sEYsifUBdv/ZJtdZOewfy97g2RNRegQ= X-Google-Smtp-Source: ABdhPJwzJWRnv8eJqp2/bwIxQx31MOpD/STZ5WZucup8ApY0lkQBjF0pIFhym2A5Y5VfeszUZSByWl6M+Qexcd2mh+M= X-Received: by 2002:ad4:4105:: with SMTP id i5mr356010qvp.47.1603237186312; Tue, 20 Oct 2020 16:39:46 -0700 (PDT) MIME-Version: 1.0 References: <4ff7b0cc-8e61-7fa7-19be-8427f281a0fc@linux.ibm.com> <2ac65a96-a447-e5b6-037d-2d785c16244b@linux.ibm.com> <20201020141804.GA5030@patrickw3-mbp.lan.stwcx.xyz> In-Reply-To: <20201020141804.GA5030@patrickw3-mbp.lan.stwcx.xyz> From: Thu Ba Nguyen Date: Wed, 21 Oct 2020 06:39:35 +0700 Message-ID: Subject: Re: Enable/Disable some sensors when Host On/Off To: Patrick Williams Content-Type: multipart/alternative; boundary="000000000000fb1c3705b222befb" X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: OpenBMC Maillist , Matt Spinler , Ed Tanous Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" --000000000000fb1c3705b222befb Content-Type: text/plain; charset="UTF-8" I am also concerned about phosphor-hwmon keep reading sensors in Dbus. Even those sensors are off or not available when the host is off. The other thing is the value of sensors which are using the same power domain with the host in the time host changing status. It can be invalid value and should be ignored. These sensors should be removed from Dbus when the host starts off/on. On Tue, Oct 20, 2020 at 9:18 PM Patrick Williams wrote: > On Tue, Oct 20, 2020 at 08:46:30AM -0500, Matt Spinler wrote: > > > > > > On 10/19/2020 10:23 AM, Thu Ba Nguyen wrote: > > > > > > I also thought about the solution for that features: > > > In the current hwmon we support GPIOCHIP + GPIO option which used to > > > enable sensors to read. In the hwmon code, we just set that pin and > wait > > > before reading. > > > I think we can support a similar option named GPIOENABLE + GPIOV. When > > > the status of Gpio pin defind in GPIOEANBLE match with GPIOV. > > > That sensors will be read and update to Dbus. > > > If not it will be removed from DBus until the GPIO pin math GPIOV. > > > Maybe we can have many different solutions. > ... > > > > > > If you don't mind, can you tell me how IBM supports that features? > > > > We lucked out out in that the driver was only loaded when power was on. > > > > Hi Thu, > > Is this something you could do similarly? Rather than have the driver > understand the GPIO directly you can trigger a phosphor-gpio-monitor > service that does a 'bind' / 'unbind' to dynamically enable and disable > the hwmon driver? > > Matt, is that how you have the driver configured to load / unload (I > assume your case is for the OCC). > > -- > Patrick Williams > --000000000000fb1c3705b222befb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I am also concerned about phosphor-hwmon keep reading sens= ors in Dbus.
Even those sensors are off or not available when the host = is off.

The other=C2=A0thing=C2=A0is the value of = sensors which are using the same power domain with the host in the time hos= t changing status.
It can be invalid value and should be ignored.= =C2=A0
These sensors should be removed from Dbus when the host st= arts off/on.


On Tue, Oct 20, 2020 at 9:18 PM Patrick Wi= lliams <patrick@stwcx.xyz> w= rote:
On Tue, Oct 20, 2020 at 08:46:30AM -0500, M= att Spinler wrote:
>
>
> On 10/19/2020 10:23 AM, Thu Ba Nguyen wrote:
> >
> > I also thought about the solution for that features:
> > In the current hwmon we support GPIOCHIP=C2=A0+ GPIO=C2=A0option = which used to
> > enable sensors to read. In the hwmon code, we just set that pin a= nd wait
> > before reading.
> > I think we can support a similar option named GPIOENABLE=C2=A0+ G= PIOV. When
> > the status of Gpio pin defind in GPIOEANBLE=C2=A0match with GPIOV= .
> > That sensors will be read and update to Dbus.
> > If not it will be removed from DBus until the GPIO pin math GPIOV= .
> > Maybe we can have many different solutions.
...
> >
> > If you don't mind, can you tell me how IBM supports that feat= ures?
>
> We lucked out out in that the driver was only loaded when power was on= .
>

Hi Thu,

Is this something you could do similarly?=C2=A0 Rather than have the driver=
understand the GPIO directly you can trigger a phosphor-gpio-monitor
service that does a 'bind' / 'unbind' to dynamically enable= and disable
the hwmon driver?

Matt, is that how you have the driver configured to load / unload (I
assume your case is for the OCC).

--
Patrick Williams
--000000000000fb1c3705b222befb--