Skip to contentSkip to conversation

RFC PATCH Trivial: Query :- is sysfs vrm supposed to be read/write?

PATCH Grant Coady 2 participants 3 messages May 19, 2005 I2C

lore
Share & tools
lore
#0 lore raw

Hi there,

I've looped this loop a couple times and something doesn't fit, go on with something else then want to finalise this little thing.

Reported read-only VID depends on VRM, also marked read-only.

Doesn't seem right to me, where does VRM type value come from? If it is a driver constant, okay.
If it is outside the driver, where do I get it from?
If it is a documentation mistake, someone please let me know, this just an extra irritant I forget to resolve every couple days :)

Cheers,
Grant.

Documentation/i2c/sysfs-interface renamed from Documentation/i2c/sysfs-interface.orig +1 -1
@@ -110,7 +110,7 @@
 		Not always correct.
 
 vrm		Voltage Regulator Module version number. 
-		Read only.
+		Read/Write
 		Two digit number, first is major version, second is
 		minor version.
 		Affects the way the driver calculates the CPU core reference
#1 lore raw

RFC PATCH Trivial: Query :- is sysfs vrm supposed to be

Hi Grant,

Quoted 1 line

Reported read-only VID depends on VRM, also marked read-only.

This is a documentation error, vrm is actually read/write (but read below).

Quoted 5 lines

Doesn't seem right to me, where does VRM type value come from? If it is a driver constant, okay.
If it is outside the driver, where do I get it from?
If it is a documentation mistake, someone please let me know, this just an extra irritant I forget to resolve every couple days :)

VRM depends on the CPU and can be set from two different sources:
1* User-space, by writing to the vrm sysfs file.
2* Kernel-space, determined automatically from the CPU brand and model.

In older versions of the driver, VRM version was hardcoded into the driver and couldn't be changed. We added a way to change VRM later, when we found that some hardware monitoring chips could be used with different CPU modules, which were using different VRM versions.

Until recently, only the first method was implemented (the user had to manually change the VRM version in /etc/sensors.conf if the arbitrary default set in each driver wasn't correct). But since VRM can be deduced from the CPU brand and model, Rudolf Marek implemented a detection function (see i2c/i2c-sensor-vid.c), which is now used (or should be) by all drivers. This means that the default VRM should now be OK for everyone, and should never need to be changed in /etc/sensors.conf. We could even switch the vrm sysfs file to read-only or even delete it altogether.

However, there are a couple cases where having the vrm file could help:
1* Debugging of the VRM version auto-detection.
2* New CPUs using an already implemented VRM version but not properly
detected.

3* Experimental stuff, like demo boards on parallel port, etc... which
might want to use a VRM version that it NOT the one of the host.

So, put in short, the vrm file is technically read/write, but should not need to be writen to by most users anymore.

Documentation/i2c/sysfs-interface line 116

Quoted 11 lines
Documentation/i2c/sysfs-interface renamed from Documentation/i2c/sysfs-interface.orig +1 -1
@@ -110,7 +110,7 @@
 		Not always correct.
 
 vrm		Voltage Regulator Module version number. 
-		Read only.
+		Read/Write
 		Two digit number, first is major version, second is
 		minor version.
 		Affects the way the driver calculates the CPU core reference

Patch is correct, please send it to Greg KH with explanation and Signed-Off-By line.

Thanks,

Signature · 1 line
Jean Delvare
#2 lore raw

RFC PATCH Trivial: Query :- is sysfs vrm supposed to be

In reply to Grant Coady
Quoted 4 lines · you

Patch is correct, please send it to Greg KH with explanation and Signed-Off-By line.

Needs much more than one word, is anybody working on documentation in the lm_sensors <-> sysfs interface area?

Or is running around the source tree code in circles like a chook with its head cut off part of the entrance fee? :o)

Cheers,
Grant.