From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S265353AbUAMTg4 (ORCPT ); Tue, 13 Jan 2004 14:36:56 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S265461AbUAMTg4 (ORCPT ); Tue, 13 Jan 2004 14:36:56 -0500 Received: from gprs214-177.eurotel.cz ([160.218.214.177]:6273 "EHLO amd.ucw.cz") by vger.kernel.org with ESMTP id S265353AbUAMTfR (ORCPT ); Tue, 13 Jan 2004 14:35:17 -0500 Date: Tue, 13 Jan 2004 14:18:06 +0100 From: Pavel Machek To: m.andreolini@tiscali.it Cc: linux-kernel@vger.kernel.org Subject: Re: problems with suspend-to-disk (ACPI), 2.6.1-rc2 Message-ID: <20040113131806.GA343@elf.ucw.cz> References: <3FE5F1110001ED59@mail-4.tiscali.it> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3FE5F1110001ED59@mail-4.tiscali.it> X-Warning: Reading this can be dangerous to your mental health. User-Agent: Mutt/1.5.4i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Hi! > I encountered a problem while resuming from a suspend-to-disk. I'm using > the > 2.6.1-rc2 kernel, running on an Athlon XP 2000. > >From a bash shell, I type: SiS900 driver needs to be fixed. Or perhaps... try following patch. > echo 4 > /proc/acpi/sleep > > and the system seems to suspend fine. When resuming, the bash seems to get > killed and I get the following output from dmesg (running from another shell): > > > Stopping tasks: =====================| > Freeing memory: ....................| > hdc: start_power_step(step: 0) > hdc: completing PM request, suspend > hda: start_power_step(step: 0) > hda: completing PM request, suspend > resume= option should be used to set suspend device/critical section: Counting > pages to copy[nosave c035b000] (pages needed: 5362+512=5874 free: 174839) > Alloc pagedir > [nosave c035b000]<4>Freeing prev allocated pagedir > bad: scheduling while atomic! > Call Trace: > [] schedule+0x586/0x590 > [] __mod_timer+0xfc/0x170 > [] schedule_timeout+0x63/0xc0 > [] process_timeout+0x0/0x10 > [] pci_set_power_state+0xeb/0x190 > [] sis900_resume+0x63/0x130 [sis900] > [] pci_device_resume+0x26/0x30 %patch Index: linux/Documentation/power/swsusp.txt =================================================================== --- linux.orig/Documentation/power/swsusp.txt 2004-01-09 20:19:41.000000000 +0100 +++ linux/Documentation/power/swsusp.txt 2004-01-09 20:33:05.000000000 +0100 @@ -17,13 +17,30 @@ You need to append resume=/dev/your_swap_partition to kernel command line. Then you suspend by echo 4 > /proc/acpi/sleep. -[Notice. Rest docs is pretty outdated (see date!) It should be safe to -use swsusp on ext3/reiserfs these days.] +Pavel's unreliable guide to swsusp mess +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +There are currently two versions of swap suspend in the kernel, the old +"Pavel's" version in kernel/power/swsusp.c and the new "Patrick's" +version in kernel/power/pmdisk.c. They provide the same functionality; +the old version looks ugly but was tested, while the new version looks +nicer but did not receive so much testing. echo 4 > /proc/acpi/sleep +calls the old version, echo disk > /sys/power/state calls the new one. + +[In the future, when the new version is stable enough, two things can +happen: + +* the new version is moved into swsusp.c, and swsusp is renamed to swap + suspend (Pavel prefers this) + +* pmdisk is kept as is and swsusp.c is removed from the kernel] + Article about goals and implementation of Software Suspend for Linux +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Author: Gábor Kuti -Last revised: 2002-04-08 +Last revised: 2003-10-20 by Pavel Machek Idea and goals to achieve @@ -36,84 +53,23 @@ interrupt our programs so processes that are calculating something for a long time shouldn't need to be written interruptible. -On desk machines the power saving function isn't as important as it is in -laptops but we really may benefit from the second one. Nowadays the number of -desk machines supporting suspend function in their APM is going up but there -are (and there will still be for a long time) machines that don't even support -APM of any kind. On the other hand it is reported that using APM's suspend -some irqs (e.g. ATA disk irq) is lost and it is annoying for the user until -the Linux kernel resets the device. - -So I started thinking about implementing Software Suspend which doesn't need -any APM support and - since it uses pretty near only high-level routines - is -supposed to be architecture independent code. - Using the code -The code is experimental right now - testers, extra eyes are welcome. To -compile this support into the kernel, you need CONFIG_EXPERIMENTAL, -and then CONFIG_SOFTWARE_SUSPEND in menu General Setup to be enabled. It -cannot be used as a module and I don't think it will ever be needed. - -You have two ways to use this code. The first one is if you've compiled in -sysrq support then you may press Sysrq-D to request suspend. The other way -is with a patched SysVinit (my patch is against 2.76 and available at my -home page). You might call 'swsusp' or 'shutdown -z