sysfs support in lm_sensors
Quoted 6 lines · Greg KH
Quoted 5 lines · Martin Schlemmer
This should have a working w83781d driver updated for 2.5.66-bk4. Currently sysfs support is working, and are according to the spec (sensors-sysfs) in the 'lm sensors sysfs file structure' thread. Thus I used 'temp_input[1-3]', as there was not final decision on having them temp_input[0-2] as well, for example.
Hey...
Just thinking, about this some more.
Can you still use sysctl() against sysfs values, or is that also deprecated? Could a sysctl call return the value and magnitude where the proc/sysfs interface did a decimal point conversion of the value?
What are your thoughts on creating *directories* for each sensor and putting the multiple values associated with that sensor in the sub-directory.
Thus, instead of in0, in0_max (or in_max0), etc. we would have in0/current, in0/max, in0/min, in0/offset.
My thoughts are
* This keeps the directory size a little more compact
* Common helper functions used to create the subdirectory contents
* Organization of the entries match the libsensors "related" field.
* Different parameters (min vs current) could have different scaling
* Filename wildcards and entry sorting are better.
I think floating point is the best solution to the fractional values that lm_sensors deals in. These values aren't integers. And we can try and standardize on milli-volts and milli-degC, but for many sensors, that's unnecessary and wastes range, and what about the values that *are* integers. How do you distinguish between them and these scaled values? The decimal point solves this and releases the requirement that all values be expressed in milli-somethings.
Further, if we restrict ourselves to scaling magnitudes that are greater than or equal to 1, I think the conversions in and out of lm_sensors to sysfs could be made simpler. But much of the code in i2c_*real is dealing with the multiple values that can be found. With sysfs, we're only allowed one value so these conversion functions would be much simpler.
:v)
Signature · 4 lines
Philip Pokorny, Senior Engineer Tel: 415-358-2635 Fax: 415-358-2646 Toll Free: 888-PENGUIN PENGUIN COMPUTING, INC. www.penguincomputing.com
Quoted 4 lines · Philip Pokorny
Can you still use
sysctl()against sysfs values, or is that also deprecated? Could a sysctl call return the value and magnitude where the proc/sysfs interface did a decimal point conversion of the value?
No, sysctl does not work on sysfs files, sorry. But open() and read() works just fine :)
Quoted 3 lines
What are your thoughts on creating *directories* for each sensor and putting the multiple values associated with that sensor in the sub-directory.
That would be a good idea, however the driver core does not provide a way (or at least an easy way) to support subdirectories at this time.
A number of people have asked for it in the past, so if anyone wants to code up such a patch, I'm sure it would be welcome.
Quoted 7 lines
I think floating point is the best solution to the fractional values that
lm_sensorsdeals in. These values aren't integers. And we can try and standardize on milli-volts and milli-degC, but for many sensors, that's unnecessary and wastes range, and what about the values that *are* integers. How do you distinguish between them and these scaled values? The decimal point solves this and releases the requirement that all values be expressed in milli-somethings.
What values in the document I posted are fractional values? I've also agreed to standardize on milli-volts and milli-degC, as other parts of the kernel also use those values.
And what "scaled values"? The documentation states what the value and units are for every type of file in sysfs for the i2c chips drivers.
Quoted 5 lines
Further, if we restrict ourselves to scaling magnitudes that are greater than or equal to 1, I think the conversions in and out of
lm_sensorsto sysfs could be made simpler. But much of the code in i2c_*real is dealing with the multiple values that can be found. With sysfs, we're only allowed one value so these conversion functions would be much simpler.
Again, using integer values removes all of the conversion problems from the kernel.
thanks,
greg k-h
Quoted 6 lines · Mark D. Studebaker
Greg,
Thank you very much for starting from my /proc document and for posting the sensors-sysfs document for comments.
Do you have an updated version to send out?
I see you posted it on 3/27 but got a lot of comments after that. I would like to comment but seems like I should start from the latest.
The latest is in the 2.5.67 kernel tree. I'd be glad to take comments and preferably patches based on that one.
thanks,
greg k-h
Greg,
Thank you very much for starting from my /proc document and for posting the sensors-sysfs document for comments.
Do you have an updated version to send out?
I see you posted it on 3/27 but got a lot of comments after that. I would like to comment but seems like I should start from the latest. thanks
mds
Quoted 49 lines · Philip Pokorny
Quoted 7 lines · Greg KH
Quoted 5 lines · Martin Schlemmer
This should have a working w83781d driver updated for 2.5.66-bk4. Currently sysfs support is working, and are according to the spec (sensors-sysfs) in the 'lm sensors sysfs file structure' thread. Thus I used 'temp_input[1-3]', as there was not final decision on having them temp_input[0-2] as well, for example.
Hey...
Just thinking, about this some more.
Can you still use
sysctl()against sysfs values, or is that also deprecated? Could a sysctl call return the value and magnitude where the proc/sysfs interface did a decimal point conversion of the value?What are your thoughts on creating *directories* for each sensor and putting the multiple values associated with that sensor in the sub-directory.
Thus, instead of in0,
in0_max(orin_max0), etc. we would have in0/current, in0/max, in0/min, in0/offset.My thoughts are
* This keeps the directory size a little more compact
* Common helper functions used to create the subdirectory contents
* Organization of the entries match the libsensors "related" field.
* Different parameters (min vs current) could have different scaling
* Filename wildcards and entry sorting are better.I think floating point is the best solution to the fractional values that
lm_sensorsdeals in. These values aren't integers. And we can try and standardize on milli-volts and milli-degC, but for many sensors, that's unnecessary and wastes range, and what about the values that *are* integers. How do you distinguish between them and these scaled values? The decimal point solves this and releases the requirement that all values be expressed in milli-somethings.Further, if we restrict ourselves to scaling magnitudes that are greater than or equal to 1, I think the conversions in and out of
lm_sensorsto sysfs could be made simpler. But much of the code in i2c_*real is dealing with the multiple values that can be found. With sysfs, we're only allowed one value so these conversion functions would be much simpler.:v)