Fan control for PowerMac7_3 (#3)

Benjamin Herrenschmidt benh at kernel.crashing.org
Sun Oct 17 11:12:44 EST 2004


On Sun, 2004-10-17 at 10:53, Paul Mackerras wrote:
> H. Peter Anvin writes:
> 
> > It's the backside fan that oscillates; backside_fan_pwm varies between 
> > 30 and 100 in what is pretty much a squarewave.  See attached graph (and 
> > note how the other fans vary with workload.)
> 
> The sharp rises look like the code thinks it gets into an
> over-temperature situation and turns the fans on full blast.  It could
> be worth putting some printks in the overtemp code.

It was in practice a problem when i turned the min/max values into
variables, I set them unsigned. That caused that code to crap out:

        state->pwm += (s32)sum;
        if (state->pwm < backside_params.output_min)
                state->pwm = backside_params.output_min;
        if (state->pwm > backside_params.output_max)
                state->pwm = backside_params.output_max;

When "sum" was negative enough to cause state->pwm to drop below 0

Turning backside_params.* to signed fixed this issue (and possibly
others as the other factors are also used as signed fixed values into
the previous calculations).

Ben.
 




More information about the Linuxppc64-dev mailing list