lkml.org 
[lkml]   [2014]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] i8k: Autodetect maximal fan speed and fan RPM multiplier
On 12/21/2014 01:13 AM, Pali Rohár wrote:
> On Saturday 20 December 2014 19:38:32 Guenter Roeck wrote:
>>> + if (fan_mult <= 0) {
>>
>> Wonder what to do in the < 0 case. It might be better to make
>> the variable and the module parameter an unsigned int to
>> cover that case, since a negative multiplier doesn't really
>> make sense. Same for fan_max.
>>
>
> In some other kernel modules negative value means autodetect. I
> think we can do that too.
>
But 0 already implies autodetect, so that would be redundant.

>>> + /*
>>> + * Autodetect fan multiplier for each fan based on
>>> nominal rpm + * First set default fan multiplier for each
>>> fan + * And if it reports rpm value too high then set
>>> multiplier to 1 + *
>>> + * Try also setting multiplier from current rpm, but
> this
>>> will + * work only in case when fan is not turned off. It
>>> is better + * then nothing for machines which does not
>>> support nominal rpm + * SMM function.
>>> + */
>>> + for (fan = 0; fan < ARRAY_SIZE(i8k_fan_mult); ++fan) {
>>> + i8k_fan_mult[fan] = I8K_FAN_DEFAULT_MULT;
>>> + if (i8k_get_fan_speed(fan) > I8K_FAN_MAX_RPM) {
>>> + i8k_fan_mult[fan] = 1;
>>> + continue;
>>> + }
>>
>> What if i8k_get_fan_speed(fan) returns an error ? Doesn't that
>> imply that the fan does not exist, and that you would not
>> need the second loop in the first place ?
>>
>
> See my other email "[PATCH] i8k: Add support for fan labels". DOS
> binary check for fan presence by another function. I bet it is
> because fan could have same problem as temperature sensors. If
> fan is on GPU and GPU is turned off reading fan rpm will fail.
> But my laptop (with GPU which can be turned on/off) does not have
> GPU fan so this is just my assumption.
>
Good point.

Guenter



\
 
 \ /
  Last update: 2014-12-21 13:01    [W:0.111 / U:0.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site