From bernard@blackham.com.au Sat Jul 23 05:46:47 2005
Return-Path: <vpopmail@laptop.nigel.suspend2.net>
Received: from laptop.nigel.suspend2.net ([unix socket]) (authenticated
	user=nigel bits=0) by laptop.nigel.suspend2.net (Cyrus
	v2.1.16-Mandrake-RPM-2.1.16-5mdk) with LMTP; Sat, 23 Jul 2005 05:46:47 +1000
X-Sieve: CMU Sieve 2.2
Received: (qmail 4575 invoked by uid 89); 22 Jul 2005 19:46:46 -0000
Received: from unknown (HELO localhost) (127.0.0.1) by 0 with SMTP; 22 Jul
	2005 19:46:46 -0000
Delivered-To: ncunningham:linuxmail.org@linuxmail.org
Received: from pop24.pr.outblaze.com [205.158.62.125] by localhost with
	IMAP (fetchmail-6.2.5) for nigel@cunningham.myip.net.au (single-drop); Sat,
	23 Jul 2005 05:46:46 +1000 (EST)
Received: (qmail 9534 invoked by uid 0); 22 Jul 2005 19:43:13 -0000
X-OB-Received: from unknown (192.168.9.137) by mta45-1.us4.outblaze.com; 22
	Jul 2005 19:43:13 -0000
Received: from usmail.cyclades.com (unknown [64.186.161.37]) by
	spf5-4.us4.outblaze.com (Postfix) with ESMTP id 4D291539CC for
	<ncunningham@linuxmail.org>; Fri, 22 Jul 2005 19:43:11 +0000 (GMT)
Received: from mail.cyclades.com ([64.186.161.6]) by usmail.cyclades.com
	(Lotus Domino Release 6.5.1) with ESMTP id 2005072211392248-136806 ; Fri,
	22 Jul 2005 11:39:22 -0700 
Received: from localhost (localhost [127.0.0.1]) by mail.cyclades.com
	(Postfix) with ESMTP id 9D725917E for <ncunningham@cyclades.com>; Fri, 22
	Jul 2005 11:39:22 -0700 (PDT)
Received: from mail.cyclades.com ([127.0.0.1]) by localhost (mail
	[127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08141-23 for
	<ncunningham@cyclades.com>; Fri, 22 Jul 2005 11:39:21 -0700 (PDT)
Received: from oracle.bridgewayconsulting.com.au
	(oracle.bridgewayconsulting.com.au [203.56.14.38]) by mail.cyclades.com
	(Postfix) with ESMTP id D00748BC0 for <ncunningham@cyclades.com>; Fri, 22
	Jul 2005 11:39:20 -0700 (PDT)
Received: from amidala (dsl-202-72-159-76.wa.westnet.com.au
	[202.72.159.76]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256
	bits)) (No client certificate requested) by
	oracle.bridgewayconsulting.com.au (Postfix) with ESMTP id BF3C62E8004 for
	<ncunningham@cyclades.com>; Sat, 23 Jul 2005 02:39:17 +0800 (WST)
Received: by amidala (Postfix, from userid 1000) id EEEB21549A5; Sat, 23
	Jul 2005 02:17:26 +0800 (WST)
Date: Sat, 23 Jul 2005 02:17:26 +0800
From: Bernard Blackham <bernard@blackham.com.au>
To: Nigel Cunningham <ncunningham@cyclades.com>
Subject: Re: New patchset.
Message-ID: <20050722181726.GA8014@blackham.com.au>
References: <1122010211.2367.1.camel@localhost>
Mime-Version: 1.0
In-Reply-To: <1122010211.2367.1.camel@localhost>
Organization: Dagobah Systems
User-Agent: Mutt/1.5.9i
X-Virus-Scanned: by amavisd-new at cyclades.com
X-MIMETrack: Itemize by SMTP Server on USMail/Cyclades(Release
	6.5.1|January 21, 2004) at 07/22/2005 11:39:22, Serialize by Router on
	USMail/Cyclades(Release 6.5.1|January 21, 2004) at 07/22/2005 12:43:12,
	Serialize complete at 07/22/2005 12:43:12
Content-Disposition: inline
Content-Type: text/plain; CHARSET=us-ascii
X-Evolution-Source: imap://nigel@127.0.0.1/
Content-Transfer-Encoding: 8bit

On Fri, Jul 22, 2005 at 03:30:11PM +1000, Nigel Cunningham wrote:
> There's a new patchset scp'd to suspend2.net.

Thanks! An assortment of compile fixes inlined.

I get some very strange behaviour with this. Admittedly it's the
first 2.6.13-rc kernel I've actually tried, but my machine will
frequently freeze up for a second or two for the duration of
suspending and resuming. Not just when doing disk I/O either - it
happens right from preparing the page directory. It's as if
interrupts are disabled and something spins for a while. Does
anything leap to mind?

On another interesting sidenote, I tried compiling suspend2ui_text
with dietlibc - now whenever a message is sent to the kernel in
response to a keystroke, the kernel dies quite horribly (recursive
panics forever with no useful stack traces, PIDs, or EIPs). I don't
know what dietlibc is smoking, but the kernel side of userui should
be more robust than that. More digging to be done...

Bernard.

Index: linux/kernel/power/disk.c
===================================================================
--- linux.orig/kernel/power/disk.c	2005-07-23 01:19:47.000000000 +0800
+++ linux/kernel/power/disk.c	2005-07-23 01:20:04.000000000 +0800
@@ -164,7 +164,7 @@
 static void unprepare_processes(void)
 {
 	platform_finish();
-	thaw_processes();
+	thaw_processes(FREEZER_ALL_THREADS);
 	enable_nonboot_cpus();
 	pm_restore_console();
 }
Index: linux/drivers/net/irda/vlsi_ir.c
===================================================================
--- linux.orig/drivers/net/irda/vlsi_ir.c	2005-07-23 01:19:47.000000000 +0800
+++ linux/drivers/net/irda/vlsi_ir.c	2005-07-23 01:20:04.000000000 +0800
@@ -1750,7 +1750,7 @@
 	vlsi_irda_dev_t *idev;
 	pci_power_t new_state;
 
-	if (state.event < PM_EVENT_FREEZE || state.event > EVENT_SUSPEND ) {
+	if (state.event < PM_EVENT_FREEZE || state.event > PM_EVENT_SUSPEND ) {
 		IRDA_ERROR("%s - %s: invalid pm state request: %u\n",
 			   __FUNCTION__, PCIDEV_NAME(pdev), state.event);
 		return 0;
Index: linux/drivers/net/wireless/airo.c
===================================================================
--- linux.orig/drivers/net/wireless/airo.c	2005-07-23 01:19:47.000000000 +0800
+++ linux/drivers/net/wireless/airo.c	2005-07-23 01:20:04.000000000 +0800
@@ -2232,7 +2232,7 @@
 	u32 *vals = stats_rid.vals;
 
 	clear_bit(JOB_STATS, &ai->flags);
-	if (ai->power) {
+	if (ai->power.event != PM_EVENT_ON) {
 		up(&ai->sem);
 		return;
 	}
@@ -2962,7 +2962,7 @@
 			break;
 		}
 
-		if (ai->power || test_bit(FLAG_FLASHING, &ai->flags)) {
+		if (ai->power.event != PM_EVENT_ON || test_bit(FLAG_FLASHING, &ai->flags)) {
 			up(&ai->sem);
 			continue;
 		}
@@ -5496,7 +5496,7 @@
 		return -EAGAIN;
 	disable_MAC(ai, 0);
 	netif_device_detach(dev);
-	ai->power = state.event;
+	ai->power.event = state.event;
 	cmd.cmd=HOSTSLEEP;
 	issuecommand(ai, &cmd, &rsp);
 
@@ -5515,7 +5515,7 @@
 	pci_restore_state(pdev);
 	pci_enable_wake(pdev, pci_choose_state(pdev, ai->power), 0);
 
-	if (ai->power > 1) {
+	if (ai->power.event > PM_EVENT_FREEZE) {
 		reset_card(dev, 0);
 		mpi_init_descriptors(ai);
 		setup_card(ai, dev->dev_addr, 0);
@@ -7117,7 +7117,7 @@
 	int rc = 0;
 	struct airo_info *ai = (struct airo_info *)dev->priv;
 
-	if (ai->power)
+	if (ai->power.event != PM_EVENT_ON)
 		return 0;
 
 	switch (cmd) {
@@ -7196,7 +7196,7 @@
 
 	/* Get stats out of the card */
 	clear_bit(JOB_WSTATS, &local->flags);
-	if (local->power) {
+	if (local->power.event != PM_EVENT_ON) {
 		up(&local->sem);
 		return;
 	}



