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] [thread-next>] [day] [month] [year] [list]
Date: Wed, 22 May 2024 21:53:17 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Nuno Sá <noname.nuno@...il.com>,
 Radu Sabau <radu.sabau@...log.com>, Jean Delvare <jdelvare@...e.com>,
 Jonathan Corbet <corbet@....net>, linux-hwmon@...r.kernel.org,
 linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] drivers: hwmon: max31827: Add debugfs support

On 5/22/24 06:10, Nuno Sá wrote:
> On Wed, 2024-05-22 at 15:39 +0300, Radu Sabau wrote:
>> Add debugfs support by creating directory in sys-fs which includes
>> debugfs specific files used for configuring the device by
>> preference.
>>
>> Signed-off-b: Radu Sabau <radu.sabau@...log.com>
>> ---
>>   Documentation/hwmon/max31827.rst |  25 ++++
>>   drivers/hwmon/max31827.c         | 202 ++++++++++++++++++++++++++++++-
>>   2 files changed, 225 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/hwmon/max31827.rst b/Documentation/hwmon/max31827.rst
>> index 9c11a9518c67..940310be6075 100644
>> --- a/Documentation/hwmon/max31827.rst
>> +++ b/Documentation/hwmon/max31827.rst
>> @@ -142,3 +142,28 @@ usage (+33% for both write and reads) in normal conditions.
>>   Since this operation implies there will be an extra delay to each
>>   transaction, PEC can be disabled or enabled through sysfs.
>>   Just write 1  to the "pec" file for enabling PEC and 0 for disabling it.
>> +
>> +DebugFs entries
>> +---------------
>> +
>> +The chip also has a configuration register where each bit stands for a specific
>> +functionality to be configured. Hence as one would like to have access to these
>> +features, we give access to them in debugfs.
>> +
>> +.. warning:: The debugfs interface is subject to change without notice
>> +             and is only available when the kernel is compiled with
>> +             ``CONFIG_DEBUG_FS`` defined.
>> +
>> +``/sys/kernel/debug/max31827/``
>> +contains the following attributes:
>> +
>> +==============  ===============================================================
>> +alarm_polarity  Write 1 for ALARM pin active state is low, 0 otherwise
>> +comp_int        Set to 1 if OT and UT status bits are in interrupt mode
>> +fault_queue     Number of consecutive temperature faults until OT and UT faults
>> +                are indicated in status bits
>> +pec_error       Set to 1 if PEC Enable bit is set, 0 otherwise
>> +resolution      2-bit value that select the conversion resolution, please see
>> +                datasheet for corresponding values
>> +timeout         Write 1 do disable bus timeout, 0 otherwise
> 
>>>From the description, the above really don't look like they belong into a debug
> interface...
> 

Correct. The chip should be configured using firmware properties, which for the
most part is already supported. An acceptable exception is PEC, but that
configuration flag, if implemented as attribute, should be attached to the
i2c client interface to match other drivers.

Guenter


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ