From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: [Resend][PATCH 0/3] ACPI / PM: Patches missing from linux-acpi-2.6/test Date: Wed, 15 Dec 2010 23:20:09 +0100 Message-ID: <201012152320.09384.rjw@sisk.pl> References: <201012112339.53105.rjw@sisk.pl> <201012142124.37270.rjw@sisk.pl> <1292379455.3983.129.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: Received: from ogre.sisk.pl ([217.79.144.158]:59297 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753419Ab0LOWVA (ORCPT ); Wed, 15 Dec 2010 17:21:00 -0500 In-Reply-To: <1292379455.3983.129.camel@localhost.localdomain> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: ykzhao Cc: Len Brown , ACPI Devel Maling List , Linux-pm mailing list , Matthew Garrett On Wednesday, December 15, 2010, ykzhao wrote: > On Wed, 2010-12-15 at 04:24 +0800, Rafael J. Wysocki wrote: > > On Tuesday, December 14, 2010, ykzhao wrote: > > > On Tue, 2010-12-14 at 05:25 +0800, Rafael J. Wysocki wrote: > > > > On Monday, December 13, 2010, ykzhao wrote: > > > > > On Sun, 2010-12-12 at 06:39 +0800, Rafael J. Wysocki wrote: ... > > > > The force_power_state was _only_ a workaround for the case when > > acpi_bus_set_power() called acpi_bus_get_power() and apparently received > > a wrong value from it on some systems (two of them had been identified, one was > > blacklisted in the end). However, after my changes acpi_bus_set_power() > > doesn't call acpi_bus_get_power() (or any equivalent) any more, so this > > workaround isn't necessary any more either. > > The flag of force_power_state will force it to do the transition of > power state even when the target state is already the same as the > current power state. Without this flag, it will skip the power > transition if the two states are consistent. This is useful under the > following cases: (The FAN device is used as an example) > 1. The initial state is reported as D0 state (But we don't know > whether the FAN device is really turned on) > 2. If we expect to turn on the corresponding FAN device for the > first time(put it into D0 state), it will skip the power transition as > the check of "state == device->power.state". In such case it will be > better that the power transition is forced in order to assure that the > FAN device is turned on by calling the _PSC/_ON object. Before my changes the force_power_state device flag was used only by the fan driver in two places: in acpi_fan_add() (ie. during fan initialization) and in acpi_fan_resume(). In both cases it was used to make acpi_bus_set_power() accept the state read by acpi_bus_get_power(). In both cases acpi_bus_update_power() can be used to obtain _exactly_ the same result, so the flag is not necessary any more. Thanks, Rafael