LKML Archive on
help / color / mirror / Atom feed
From: Henrique de Moraes Holschuh <>
Subject: Re: [ibm-acpi-devel] Fan level 7 after resume wit 2.6.28-rc3
Date: Thu, 6 Nov 2008 12:11:21 -0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <20081106003543.GA14766@x61>

On Thu, 06 Nov 2008, Tino Keitel wrote:
> On Wed, Nov 05, 2008 at 14:24:01 -0200, Henrique de Moraes Holschuh wrote:
> In fan_init(), fan_control_desired_level is set to 7, and never changed
> to anything else. It is not set in fan_suspend() because
> tp_features.fan_ctrl_status_undef is 0 (also set in fan_init()).

fan_suspend calls fan_get_status_safe(NULL).

fan_get_status_safe(NULL) will update fan_control_desired_level if it can
get the fan status without an error... unless it is set to AUTO or FULL
SPEED, and it is VERY likely to be set to AUTO.

So it is borked, indeed.  That explains why it is not being initialized to
something else than 7.  Weird that I didn't notice it here when testing,
must have confused it with the effects of the T43 firmware bug.

> I tried to write a correct patch, but I got lost in all that
> fan_control_desired_level, fan_control_initial_status and
> tp_features.fan_ctrl_status_undef stuff.

Ignore fan_ctrl_status_undef, it is a workaround for a firmware bug you
don't have (it is specific to the T43 ACPI DSDT).  Basically, you cannot
trust a fan_get_status() return of level 7 while fan_ctrl_status_undef is
active, it could be AUTO instead.

> My brain says that one would just read the current fan settings from
> the EC at initialization. Then, after resume, this setting is restored
> unconditionally, or at least if it differs from current_level. The

Never.  I will sooner remove the keep settings across suspend/resume than
touch the fan controller unconditionally.  The ACPI DSDT or the EC itself
may have changed the fan mode while we were sleeping, and for a good reason
(like a thermal emergency).

The fan must NEVER be slowed down by the fan_resume() method.  This pretty
much means it can only restore the fan to full-speed, auto or level 7 on a
new-style fan control like the one found on your thinkpad.  And that it
needs to query the state first, must do nothing if it cannot read the state,
and must set it to the higher of (saved, current) using this rule:

fulll-speed > 7 > AUTO.

> Correction: I just tested a bit further, and it doesn't work. If I set
> fan level to 3, suspend, resume, set fan level to auto, and
> resume/suspend again, fan level is restored to 3. This is because
> fan_control_desired_level isn't updated by fan_update_desired_level()

Fan level should NEVER be restored to 3, it should end up set to auto,
full-speed, or 7 when the box finishes resuming.  If it can be restored to
3, something is hideously broken.

Maybe something in the hwmon class is also trying to keep values across

Could you instrument fan_set_level() and check what levels it is being
called with, and when?

  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

  parent reply	other threads:[~2008-11-06 14:11 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-05  7:33 Tino Keitel
2008-11-05  7:47 ` [ibm-acpi-devel] " Tino Keitel
2008-11-05 12:26   ` Henrique de Moraes Holschuh
2008-11-05 13:02     ` Tino Keitel
2008-11-05 13:08     ` Tino Keitel
2008-11-05 16:24       ` Henrique de Moraes Holschuh
2008-11-06  0:35         ` Tino Keitel
2008-11-06  8:23           ` Tino Keitel
2008-11-06 14:21             ` Henrique de Moraes Holschuh
2008-11-08 22:45               ` Rafael J. Wysocki
2008-11-09 11:30                 ` Henrique de Moraes Holschuh
2008-11-09 12:54                   ` [GIT PATCH] thinkpad-acpi regression fix for 2.6.28-rc Henrique de Moraes Holschuh
2008-11-09 13:22                     ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
2008-11-09 12:54                   ` [PATCH] ACPI: thinkpad-acpi: fix fan sleep/resume path Henrique de Moraes Holschuh
2008-11-12  5:02                     ` Len Brown
2008-11-17  2:14                     ` Henrique de Moraes Holschuh
2008-11-17 14:26                       ` [ibm-acpi-devel] " Tino Keitel
2008-11-13  7:26                   ` [ibm-acpi-devel] Fan level 7 after resume wit 2.6.28-rc3 Pavel Machek
2008-11-06 14:11           ` Henrique de Moraes Holschuh [this message]
2008-11-06 15:22             ` Tino Keitel
2008-11-06 15:31               ` Henrique de Moraes Holschuh
2008-11-06 15:32             ` Tino Keitel
2008-11-06 21:15               ` Henrique de Moraes Holschuh
2008-11-05 13:45     ` Tino Keitel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \
    --subject='Re: [ibm-acpi-devel] Fan level 7 after resume wit 2.6.28-rc3' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).