From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: [linux-pm] [RFD] How to tell ACPI drivers what the target sleep state is (was: Re: [PATCH 1/2] acpi choose sleep state help) Date: Wed, 20 Jun 2007 16:36:41 +0200 Message-ID: <200706201636.41834.rjw@sisk.pl> References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: Received: from ogre.sisk.pl ([217.79.144.158]:47519 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751416AbXFTOaW (ORCPT ); Wed, 20 Jun 2007 10:30:22 -0400 In-Reply-To: Content-Disposition: inline Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Alan Stern Cc: Shaohua Li , linux acpi , pm list , dbrownell@users.sourceforge.net, Pavel Machek On Wednesday, 20 June 2007 16:08, Alan Stern wrote: > On Wed, 20 Jun 2007, Rafael J. Wysocki wrote: > > > > Not. Could pm_message_t have a member indicating the suspend state? > > > > Well, I thought about that, but I did't know what people on linux-pm would > > think about that. > > > > Alternatively, we could introduce a pm_target() global PM operation that will > > set the target sleep state for the entire system. > > > > I think we should discuss that on linux-pm before any decision is made. > > Pardon me for asking what may be a dumb question. Why does ACPI (or > anything else) need to know the target system state in order to decide > how a device should be suspended or whether wakeup should be enabled? The question isn't so dumb. ;-) For each device (handled by it) ACPI defines _SxD and _SxW methods returning the highest power (lowest number) D-state supported by the device in the (system-wide) state Sx and the lowest power (highest number) D-state in which the device can wake up the system being in the Sx sleep state, respectively. The target power state of the device should be determined on the basis of these values (along with the device's wake up setting) and they depend on the target system sleep state. Greetings, Rafael -- "Premature optimization is the root of all evil." - Donald Knuth