lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b1a34c68-d5e3-9a6f-67b1-6b6d2332f1c6@roeck-us.net>
Date:   Fri, 23 Nov 2018 08:38:50 -0800
From:   Guenter Roeck <linux@...ck-us.net>
To:     Nicolin Chen <nicoleotsuka@...il.com>
Cc:     jdelvare@...e.com, linux-hwmon@...r.kernel.org,
        linux-kernel@...r.kernel.org, corbet@....net,
        linux-doc@...r.kernel.org
Subject: Re: [PATCH] hwmon (ina3221) Add single-shot mode support

On 11/19/18 2:18 PM, Nicolin Chen wrote:
> On Mon, Nov 19, 2018 at 09:45:59AM -0800, Guenter Roeck wrote:
>>> In short, other than exposing it via a generic ABI to the user
>>> space, how about defining some policy to maintaining it within
>>> the driver?
> 
>> I think that would be a bad idea. It changes timing for everyone
>> curently using the driver. It also effectively disables monitoring,
>> which is the main purpose for using this chip (and other hardware
>> monitoring chips). This is indeed a key difference between iio
>> and hwmon - the main purpose of chips in the iio subsystem is to
>> be able report data efficiently to user space, not hardware monitoring.
>> I do not think it is appropriate to use iio requirements as argument
>> to change hwmon driver behavior (and vice versa).
> 
> OK...what about setting a default mode via DT? I didn't expect it
> to be possible until I found this existing solution. Though it is
> still in an iio driver, I don't think this should be iio specific.
> 
>    commit 023e30fb0d3a3b9d6b8dc9e47590aa544d58a22f
>    Author: Adriana Reus <adriana.reus@...el.com>
>    Date:   Tue Nov 24 12:59:49 2015 +0200
> 
>      Documentation: devicetree: Add property for controlling power saving
>                     mode for the us5182 als sensor
> 
>      Add a property to allow changing the default power-saving mode.
>      By default, at read raw the chip will activate and provide
>      one measurent, then it will shut itself down. However, the
>      chip can also work in "continuous" mode which may be more reliable
>      but is also more power consuming.
> 
>      Signed-off-by: Adriana Reus <adriana.reus@...el.com>
>      Acked-by: Rob Herring <robh@...nel.org>
>      Signed-off-by: Jonathan Cameron <jic23@...nel.org>
> 
> Would it be possible for me to apply a similar one? Since hwmon
> driver uses continuous mode by default, I will add a "one-shot"
> property instead of "continuous" -- all existing users won't be
> effected unless they place one-shot properties in DT bindings.
> 

I would accept such a patch, but it would for all practical purposes
disable the monitoring of limits. Make sure that is well documented.

Guenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ