public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Mark Studebaker <mds@paradyne.com>
Cc: Jan Dittmer <j.dittmer@portrix.net>,
	azarah@gentoo.org, KML <linux-kernel@vger.kernel.org>,
	Dominik Brodowski <linux@brodo.de>,
	sensors@Stimpy.netroedge.com
Subject: lm sensors sysfs file structure
Date: Wed, 26 Mar 2003 14:52:34 -0800	[thread overview]
Message-ID: <20030326225234.GA27436@kroah.com> (raw)
In-Reply-To: <3E82292E.536D9196@paradyne.com>

Subject changed to reflect change in topic, and to call attention to
others who might be interested.

On Wed, Mar 26, 2003 at 05:26:54PM -0500, Mark Studebaker wrote:
> If you rename the files and/or split multivalue files into separate
> single value files, or change the format of the contents,
> and continue these changes across the 30 or so "chip" drivers of ours,
> you will completely blow up our libsensors library, and userspace programs.

Well ideally libsensors can change and then userspace programs will
never know the difference :)

I need to start digging into the libsensors code to be able to back this
up, but at first glance I think it's feasible.

> If all the patches do is move all the files unchanged from
> /proc/sys/dev/sensors/... to /sysfs/... then that change is much much easier
> to incorporate in our programs.

True, but multi-valued files are not allowed in sysfs.  It's especially
obnoxious that you have 3 value files when you read them, but only
expect 2 values for writing.  The way I split up the values in the
lm75.c driver shows a user exactly which values are writable, and
enforces this on the file system level.

I don't want to detract from all of the work you, and the lm_sensors
group has done in the past, it's quite nice.  I'm just trying to fit the
drivers into current kernel policies in the best way possible.
Remember, I want this to work, and for everyone to come to an
understanding.

> lm_sensors /proc naming standars for sensors chip drivers:
> 
> http://www2.lm-sensors.nu/~lm78/cvs/lm_sensors2/doc/developers/proc

Thanks for the link.  I don't really think this is a problem.  As an
example, the temp files, which are currently defined as a proc file with
this description:

Entry	Values	Function
-----	------	--------
temp,
temp[1-3]  3	Temperature max, min or hysteresis, and input value.
	       	Floating point values XXX.X or XXX.XX in degrees Celcius.
		'temp' is used if there is only one temperature sensor on the
		chip; for multiple temps. start with 'temp1'.
		Temp1 is generally the sensor inside the chip itself,
		generally reported as "motherboard temperature".
		Temp2 and temp3 are generally sensors external to the chip
		itself, for example the thermal diode inside the CPU or a
		termistor nearby. The second value is preferably a hysteresis
		value, reported as a absolute temperature, NOT a delta from
		the max value.
		First two values are read/write and third is read only.

Could be rewritten to say:

Entry		Function
-----		--------
temp_max[1-3]	Temperature max value.
		Fixed point value in form XXXXX and should be divided by
		100 to get degrees Celsius.
		Read/Write value.

temp_min[1-3]	Temperature min or hysteresis value.
		Fixed point value in form XXXXX and should be divided by
		100 to get degrees Celsius.  This is preferably a
		hysteresis value, reported as a absolute temperature, NOT
		a delta from the max value.
		Read/Write value.

temp_input[1-3]	Temperature input value.
		Read only value.

		If there are multiple temperature sensors, temp_*1 is
		generally the sensor inside the chip itself, generally
		reported as "motherboard temperature".  temp_*2 and
		temp_*3 are generally sensors external to the chip
		itself, for example the thermal diode inside the CPU or a
		thermistor nearby.

That would give us one value per file, use no floating point in the
kernel (fake or not) and generally make things a whole lot more orderly.
Also, if a sensor does not have a max value (for example, I don't really
know if this is true), instead of having to fake a value, it can just
not create the file.  Then userspace can easily detect this is not
supported, and is not a placeholder value.

Does that sound reasonable?

thanks,

greg k-h


  reply	other threads:[~2003-03-26 22:42 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-25  8:53 i2c driver changes for 2.5.66; adding w83781d support Martin Schlemmer
2003-03-25 17:56 ` Greg KH
2003-03-26 19:04   ` w83781d i2c driver updated for 2.5.66 (without sysfs support) Martin Schlemmer
2003-03-26 19:40     ` Jan Dittmer
2003-03-26 19:54       ` Martin Schlemmer
2003-03-26 20:26       ` Greg KH
2003-03-26 20:43         ` Christoph Hellwig
2003-03-26 21:23           ` Greg KH
2003-03-26 22:26         ` Mark Studebaker
2003-03-26 22:52           ` Greg KH [this message]
2003-03-27 10:46             ` lm sensors sysfs file structure Jan Dittmer
2003-03-27 10:50               ` Martin Schlemmer
2003-03-27 12:27                 ` Jan Dittmer
2003-03-27 12:33                   ` Martin Schlemmer
2003-03-27 13:05                     ` Jan Dittmer
2003-03-27 13:31                       ` Jean Delvare
2003-03-27 17:16                         ` Mark M. Hoffman
2003-03-27 17:25               ` Greg KH
2003-03-27 18:06                 ` Jan Dittmer
2003-03-27 18:13                   ` Greg KH
2003-03-30 19:23                 ` Pavel Machek
2003-04-01  6:44                   ` Greg KH
2003-04-01 20:22                     ` Pavel Machek
2003-04-01 23:27                     ` Dave Jones
2003-04-03  0:28                       ` Greg KH
2003-04-03 10:49                         ` Dave Jones
2003-04-03 18:43                           ` Dominik Brodowski
2003-03-27 18:40             ` Jan Dittmer
2003-03-27 18:52               ` Greg KH
2003-03-27 18:17                 ` Patrick Mochel
2003-03-27 18:57                 ` Jan Dittmer
2003-03-27 19:15                 ` Martin Schlemmer
2003-03-27 19:25                   ` Greg KH
2003-03-27 19:42             ` Greg KH
2003-03-27 20:32               ` Jan Dittmer
2003-03-27 21:53                 ` Greg KH
2003-03-27 22:23                   ` Mark M. Hoffman
2003-03-28  6:05                   ` Martin Schlemmer
2003-03-28 18:34             ` Pavel Machek
2003-03-26 20:29     ` w83781d i2c driver updated for 2.5.66 (without sysfs support) Greg KH
2003-03-26 23:34       ` Martin Schlemmer
2003-03-26 23:46         ` Greg KH
2003-03-30 12:47           ` [PATCH-2.5] w83781d i2c driver updated for 2.5.66-bk4 (with sysfs support, empty tree) Martin Schlemmer
2003-04-02 22:22             ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2003-03-27 23:00 lm sensors sysfs file structure Albert Cahalan
2003-03-27 23:10 ` Greg KH
2003-03-28  7:21   ` Martin Schlemmer
2003-03-28  7:40     ` Greg KH
2003-04-03 21:19 Grover, Andrew
2003-04-14 15:16 ` Patrick Mochel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030326225234.GA27436@kroah.com \
    --to=greg@kroah.com \
    --cc=azarah@gentoo.org \
    --cc=j.dittmer@portrix.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@brodo.de \
    --cc=mds@paradyne.com \
    --cc=sensors@Stimpy.netroedge.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox