lkml.org 
[lkml]   [2014]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 1/2] i8k: Autodetect maximal fan speed and fan RPM multiplier
Date
On Saturday 20 December 2014 20:02:31 Guenter Roeck wrote:
> > + 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;
> > + }
>
> Another note: On one of my systems, reading the current fan
> speed literally halts the entire system for a second or two.
> Given this, is the above really necessary ? It might be
> better to just try to use the nominal fan speeds and only
> read the actual fan speed if that doesn't work.
>

Ok. I added fallback to i8k_get_fan_speed() only if function
i8k_get_fan_nominal_speed() failed.

> > + for (val = 0; val < 256; ++val) {
> > + ret = i8k_get_fan_nominal_speed(fan, val);
> > + if (ret > I8K_FAN_MAX_RPM) {
> > + i8k_fan_mult[fan] = 1;
> > + break;
> > + } else if (ret < 0) {
> > + break;
> > + }
> > + }
>
> I wonder if it would help to detect the maximum fan speed
> first. Once that is known, it should be possible to just read
> the nominal fan speed once, for the known maximum speed. With
> this, the 'val' loop here would be unnecessary.
>

Right, good point.

--
Pali Rohár
pali.rohar@gmail.com
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-12-21 10:41    [W:0.287 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site