lkml.org 
[lkml]   [2009]   [Jun]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Request driver inclusion - acer aspire one fan control
Hi,

On Thu, Jun 18, 2009 at 02:45:41PM +0200, Borislav Petkov wrote:
> ok, this starts to look quite a bit overengineered for no reason. First,
> acerhdf_revert_to_bios_mode() sets the fan to auto. Then, you've added
> a thermal_zone_device_update() call in there which does set the fan to
> auto indirectly _again_. And we end up with _three_ variables which
> represent only _one_ state. Here's what it should do:
>
> suspend:
> - set fan to auto
>
> resume:
> - the thermal layer figures out what to do based on the 'kernelmode' and
> current temperature.
>
> That's it, everything else is too much.

No, I'd say it's not as easy as that.
If you want to discover any weird state changes behind your back (and we
want that, that driver should be _safe_), then we need to record the current fan state
as set by us.

But that then means that during interruption of normal operation
(suspend), we need to temporarily stop this checking.

IOW, we need some more variable(s) to indicate:
OPERATION_SUSPENDED (set by .suspend)
OPERATION_ABOUT_TO_CONTINUE (set by .resume)
OPERATING

In state OPERATION_ABOUT_TO_CONTINUE the thermal layer function
would know that they shouldn't check fan state consistency, would
refresh fan state to the current state and then set it to OPERATING.

Or some such (would need further analysis).

Andreas Mohr


\
 
 \ /
  Last update: 2009-06-18 15:27    [W:0.103 / U:1.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site