Second auto pwm interface proposal
Hi all,
After reviewing the adm1031 and it87 drivers auto pwm interface implementations, I think that the auto pwm interface that was debated a few weeks ago could be reworked a bit.
My main motivation is that I believe that these chips (and this is probably true for others with the same function as well) offer complex possibilities most people don't care about. When first designing the auto pwm interface, I had in mind that it should cover everything the chips could do. This resulted in a complex interface with (too) many files.
Now I believe that the interface could be simplified to reflect the users needs instead. There are two different things that the user can
configure: the trip points (pwm value, temperature value couples) and the fan channel/temperature channel matching. Both areas could be simplified.
Temperature channel selection
-----------------------------
The interface was designed so that more than one channel can be associated with one given fan. I proposed that because the ADM1031 can do that. Question is: does the user need this? I doubt it.
The drawback of the current interface is that you never know which values are supported by the chip. Reading from the files is fine, it reflects the current state in a standard way. But writing is not, which makes the interface bad IMHO.
Can't we just support one channel per fan? 0 would still mean disabled, 1-N for the channel number. This is easier to understand for the user, and I'd expect it to be enough for almost all users.
Trip points
-----------
The idea of defining trip points came from the IT87xx hardware implementation. The ADM1031 has a completely different approach. Let's have some ASCII art :)
This is the ADM1031 model:
PWM
^
100%| __________
| ,'
| ,'
| ,'
| ,'
| ,'
| ,'
min | ____ ,'
| | |
| | |
0%|___________|____|
|
|----------------------------------------->temperature
^ ^ ^
off min max(Toff = Tmin - 5, this is an hysteresis so that fan doesn't start/stop repeatedly it T is too near from Tmin)
All in all there are only three values that have to be defined: Tmin, Tmax and PWMmin. The chip computes the fan speed between Tmin and Tmax as a weigthed average between PWMmin and 100%.
Now, this is the IT87xx model:
PWM
^
100%| ______
| |
high| ____|
| |
med | _____|
| |
| |
low | ___________|
| | |
| | |
0%|___________|____|
|
|----------------------------------------->temperature ^ ^ ^ ^ ^
off low medium high full
Here, there are predefined PWM values and the chip sticks to these, there is no averaging done. A total of 8 values have to be set.
I wonder if this is really necessary to expose these eight registers to the user. I think that all the user wants to be able to configure is:
* Temperature at which the fan starts spinning, associated PWM, and associated hysteresis temperature.
* Critical temperature, at which the fan must run at full speed. All in all it corresponds to what the ADM1031 has.
Thus, I would propose that we do the same for the it87 driver. Values for non-exposed registers would be computed automatically using weighted averaging.
Does it sound OK, or is the fine grained trip points selection considered useful and shouldn't be dropped?
Comments welcome.
Thanks.
Signature · 2 lines
Jean Delvare http://khali.linux-fr.org/
Hi Jean:
* Jean Delvare <[email protected]> [2004-05-22 14:25:46 +0200]:
<big snip>
Quoted 6 lines
I wonder if this is really necessary to expose these eight registers to the user. I think that all the user wants to be able to configure is:
* Temperature at which the fan starts spinning, associated PWM, and associated hysteresis temperature.
* Critical temperature, at which the fan must run at full speed. All in all it corresponds to what the ADM1031 has.
The w83627thf "thermal cruise" mode doesn't quite fit this model. It only knows these parameters:
1. target temp
2. tolerance (+/-)
3. minimum PWM (optional)
It's difficult to tell, but there is apparently no direct linear relationship between temp and PWM. Instead, it starts to ramp up the PWM when the temp is > target + tolerance... it starts to ramp down the PWM when the temp is < target - tolerance (stopping at the minimum PWM instead of 0 if that option is enabled.)
Again, the characteristics of the PWM ramp-[up,down] are not clear from the datasheet. Perhaps it's some kind of PID controller, but if so there's no way to tune it.
So, if you wanted to force that square peg into the round hole... The difference of start temp and crit temp gets divided by 2 to set the tolerance. The target temp is then start temp + tolerance.
That still leaves no good way to set the H/W min PWM unless you add another parameter. I do think this is a useful enough feature to warrant it.
Quoted 6 lines
Thus, I would propose that we do the same for the it87 driver. Values for non-exposed registers would be computed automatically using weighted averaging.
Does it sound OK, or is the fine grained trip points selection considered useful and shouldn't be dropped?
Well, I haven't answered this question at all... just reporting what a third type of H/W looks like. Maybe these things are dissimilar enough that a standard interface just isn't desirable?
Regards,
Signature · 2 lines
Mark M. Hoffman [email protected]
Quoted 7 lines · Jean Delvare
Temperature channel selection
-----------------------------The interface was designed so that more than one channel can be associated with one given fan. I proposed that because the ADM1031 can do that. Question is: does the user need this? I doubt it.
Quoted 11 lines
The drawback of the current interface is that you never know which values are supported by the chip. Reading from the files is fine, it reflects the current state in a standard way. But writing is not, which makes the interface bad IMHO.
Can't we just support one channel per fan? 0 would still mean disabled, 1-N for the channel number. This is easier to understand for the user, and I'd expect it to be enough for almost all users.
Simplification is good. I'd support that...
Unfortunately, I've got a situation where I *need* to be able to use the "greater of two channels" mode of the lm85 where multiple channels are selected. In this case the system is a dual CPU system and the fan control/PWM in question controls *both* CPU fans.
I'd be OK if we grandfather the existing LM85 interface, or some up with some other way to poke the chip specific controls.
Perhaps the simplified stuff is left to user space and libsensors rather than implemented in the kernel driver itself?
:v)
At Khali's urging I'm finally joining the debate.
First of all let me say that I reviewed the discussion about the ADM1030 from mid-April and found a lot to read but didn't find a precise 'proposal'. Maybe I didn't look hard enough.
Or is the submitted ADM1031 driver the current proposal?
But anyway, on the second proposal below, I like the idea of
keeping things relatively simple, if possible.
Let's start with something that will work across all the chips
we support (does somebody have the definitive list of smart-fan chips... this would be helpful in reviewing proposals... is it adm1026, 1031, lm85, it87, w83627hf?).
Any standardization will inevitably leave out some chip-specific capabilities. That's what standardization does. But that's what we have to do. Let's do it, then we can think about what optional extensions would be required to support additional features.
We do want to survey the field but we should look at the design decisions companies are making and see if a consensus is forming on the way the smart fan feature is being implemented in hardware. We should favor recent devices such as adm1031 over older ones such as it87, and market leaders (Nat'l, ADI) over the others.
This leads me to agree w/ Khali below about targeting the 1031 way of doing things and molding it87 to fit rather than vice versa.
On whether we should strongly favor the existing implementations we have in it87 and lm85, I don't think so. When those drivers were under development, we purposely
let things go their own way, as we didn't have a standard and wanted to
see what developed and see was best. Now we have a 3rd in adm1031.
The plan has always been to come up with a standard and then change all the drivers to match.
Can somebody do a brief sysfs-interface (and/or proc-interface) document addition proposal so we can all see clearly what the propsal is. Please include summary of how existing interfaces (fan_min, fan_pwm, fan_pwm_enable) would change when a chip is in auto-mode. Please identify what's required and what's optional; if optional, which driver is it for.
mds
Quoted 111 lines · Jean Delvare
Hi all,
After reviewing the adm1031 and it87 drivers auto pwm interface implementations, I think that the auto pwm interface that was debated a few weeks ago could be reworked a bit.
My main motivation is that I believe that these chips (and this is probably true for others with the same function as well) offer complex possibilities most people don't care about. When first designing the auto pwm interface, I had in mind that it should cover everything the chips could do. This resulted in a complex interface with (too) many files.
Now I believe that the interface could be simplified to reflect the users needs instead. There are two different things that the user can
configure: the trip points (pwm value, temperature value couples) and the fan channel/temperature channel matching. Both areas could be simplified.Temperature channel selection
-----------------------------The interface was designed so that more than one channel can be associated with one given fan. I proposed that because the ADM1031 can do that. Question is: does the user need this? I doubt it.
The drawback of the current interface is that you never know which values are supported by the chip. Reading from the files is fine, it reflects the current state in a standard way. But writing is not, which makes the interface bad IMHO.
Can't we just support one channel per fan? 0 would still mean disabled, 1-N for the channel number. This is easier to understand for the user, and I'd expect it to be enough for almost all users.
Trip points
-----------The idea of defining trip points came from the IT87xx hardware implementation. The ADM1031 has a completely different approach. Let's have some ASCII art :)
This is the ADM1031 model:
PWM ^ 100%| __________ | ,' | ,' | ,' | ,' | ,' | ,' min | ____ ,' | | | | | | 0%|___________|____| | |----------------------------------------->temperature ^ ^ ^ off min max(Toff = Tmin - 5, this is an hysteresis so that fan doesn't start/stop repeatedly it T is too near from Tmin)
All in all there are only three values that have to be defined: Tmin, Tmax and PWMmin. The chip computes the fan speed between Tmin and Tmax as a weigthed average between PWMmin and 100%.
Now, this is the IT87xx model:
PWM ^ 100%| ______ | | high| ____| | | med | _____| | | | | low | ___________| | | | | | | 0%|___________|____| | |----------------------------------------->temperature^ ^ ^ ^ ^
off low medium high fullHere, there are predefined PWM values and the chip sticks to these, there is no averaging done. A total of 8 values have to be set.
I wonder if this is really necessary to expose these eight registers to the user. I think that all the user wants to be able to configure is:
* Temperature at which the fan starts spinning, associated PWM, and associated hysteresis temperature.
* Critical temperature, at which the fan must run at full speed. All in all it corresponds to what the ADM1031 has.Thus, I would propose that we do the same for the it87 driver. Values for non-exposed registers would be computed automatically using weighted averaging.
Does it sound OK, or is the fine grained trip points selection considered useful and shouldn't be dropped?
Comments welcome.
Thanks.