From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Subject: Re: [RFC][PATCH 1/3] Hibernation: Enter platform hibernation state in a consisten way (rev. 2) Date: Mon, 27 Aug 2007 14:25:22 +0200 Message-ID: <20070827122522.GA2894@elf.ucw.cz> References: <200708270149.52585.rjw@sisk.pl> <200708270151.33307.rjw@sisk.pl> <20070827082405.GE2060@elf.ucw.cz> <200708271431.12482.rjw@sisk.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from gprs189-60.eurotel.cz ([160.218.189.60]:53041 "EHLO amd.ucw.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756151AbXH0MZB (ORCPT ); Mon, 27 Aug 2007 08:25:01 -0400 Content-Disposition: inline In-Reply-To: <200708271431.12482.rjw@sisk.pl> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: "Rafael J. Wysocki" Cc: pm list , ACPI Devel Maling List , Alan Stern , Johannes Berg , Thomas Renninger Hi! > > > Make hibernation_platform_enter() execute the enter-a-sleep-state sequence > > > instead of the mixed shutdown-with-entering-S4 thing. > > > > > > Replace the shutting down of devices done by kernel_shutdown_prepare(), before > > > entering the ACPI S4 sleep state, with suspending them and the shutting down of > > > sysdevs with calling device_power_down(PMSG_SUSPEND) (just like before entering > > > S1 or S3, but the target state is now S4). Also, disable the nonboot CPUs > > > before entering the sleep state (S4), which generally always is a good idea. > > > > > > This is known to fix the "double disk spin down during hibernation" on some > > > machines, eg. HPC nx6325 (ref. http://lkml.org/lkml/2007/8/7/316 and the > > > following thread). It also generally causes the hibernation state (ACPI S4) to > > > be entered faster. > > > > > > Signed-off-by: Rafael J. Wysocki > > > --- > > > kernel/power/disk.c | 55 ++++++++++++++++++++++++++++++++++++++-------------- > > > 1 file changed, 41 insertions(+), 14 deletions(-) > > > > > > > > + local_irq_disable(); > > > + error = device_power_down(PMSG_SUSPEND); > > > + if (!error) { > > > + error = hibernation_ops->enter(); > > > + /* We should never get here */ > > > > Are you sure it is good idea to enable interrupts/power up devices > > when this happens? > > Hm. No, I'm not. > > > AFAICT image is already on disk an intact at this point, safe thing to do is > > while(1);... > > OK > > Like this? Yes, like this. ACK. Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html