From ncunningham@cyclades.com  Mon May 30 14:09:39 2005
Return-Path: <ncunningham@cyclades.com>
X-Original-To: suspend2-announce@lists.suspend2.net
Delivered-To: suspend2-announce@lists.suspend2.net
Received: from asclepius.uwa.edu.au (asclepius3.uwa.edu.au [130.95.128.60])
	by coolstore.ucc.gu.uwa.edu.au (Postfix) with ESMTP id 74578319A7
	for <suspend2-announce@lists.suspend2.net>;
	Mon, 30 May 2005 14:09:39 +1000 (EST)
Received: from asclepius.kas (localhost.localdomain [127.0.0.1])
	by asclepius.uwa.edu.au (Postfix) with SMTP id E46F01835FB
	for <suspend2-announce@lists.suspend2.net>;
	Mon, 30 May 2005 12:06:09 +0800 (WST)
Received: from asclepius (localhost.localdomain [127.0.0.1])
	by asclepius.prekas (Postfix) with SMTP id C2C411835F1
	for <suspend2-announce@lists.suspend2.net>;
	Mon, 30 May 2005 12:06:09 +0800 (WST)
X-UWA-Client-IP: 203.143.238.98 (EXTERNAL)
Received-SPF: none (asclepius: domain of ncunningham@cyclades.com does not
	designate permitted sender hosts)
Received: from cunningham.myip.net.au (b3162.static.pacific.net.au
	[203.143.238.98])
	by asclepius.input (Postfix) with ESMTP id EF97E1835FB
	for <suspend2-announce@lists.suspend2.net>;
	Mon, 30 May 2005 12:06:03 +0800 (WST)
Received: (qmail 12005 invoked by uid 89); 30 May 2005 04:07:19 -0000
Received: from unknown (HELO ?127.0.0.1?) (127.0.0.1)
	by 0 with SMTP; 30 May 2005 04:07:19 -0000
From: Nigel Cunningham <ncunningham@cyclades.com>
To: Suspend2-Announce <suspend2-announce@lists.suspend2.net>
Content-Type: multipart/mixed; boundary="=-X2KTC7PfXR2TRcuQRL7H"
Organization: Cycades
Message-Id: <1117426039.12243.70.camel@localhost>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.6-1mdk 
Date: Mon, 30 May 2005 14:07:19 +1000
X-SpamTest-Info: Profile: Formal (239/050529)
X-SpamTest-Info: Profile: Detect Hard [UCS 290904]
X-SpamTest-Info: Profile: SysLog
X-SpamTest-Info: Profile: Marking Spam - Subject (UCS) [02-08-04]
X-SpamTest-Status: Not detected
X-SpamTest-Version: SMTP-Filter Version 2.0.0 [0125], KAS/Release
X-Mailman-Approved-At: Mon, 30 May 2005 14:10:32 +1000
Subject: [Suspend2-announce] Test patch 2.1.8.11 for 2.6.12-rc5.
X-BeenThere: suspend2-announce@lists.suspend2.net
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: suspend2-devel@lists.suspend2.net,
 ncunningham@cyclades.com
List-Id: "Suspend2.net announcements" <suspend2-announce.lists.suspend2.net>
List-Unsubscribe: <http://lists.suspend2.net/mailman/listinfo/suspend2-announce>, 
	<mailto:suspend2-announce-request@lists.suspend2.net?subject=unsubscribe>
List-Archive: <http://lists.suspend2.net/lurker/list/suspend2-announce.html>
List-Post: <mailto:suspend2-announce@lists.suspend2.net>
List-Help: <mailto:suspend2-announce-request@lists.suspend2.net?subject=help>
List-Subscribe: <http://lists.suspend2.net/mailman/listinfo/suspend2-announce>, 
	<mailto:suspend2-announce-request@lists.suspend2.net?subject=subscribe>
X-List-Received-Date: Mon, 30 May 2005 04:09:40 -0000


--=-X2KTC7PfXR2TRcuQRL7H
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi all.

I didn't fix SMP support with the .10 patchset. Here is an additional
patch to address that issue. I still have the issue with ReiserFS to
deal with; I'll seek to finish that tonight.

Regards,

Nigel

--=-X2KTC7PfXR2TRcuQRL7H
Content-Disposition: attachment; filename=956-smp-modifications.patch
Content-Type: text/x-patch; name=956-smp-modifications.patch;
	charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

diff -ruNp 956-smp-modifications.patch-old/arch/i386/power/smp.c 956-smp-modifications.patch-new/arch/i386/power/smp.c
--- 956-smp-modifications.patch-old/arch/i386/power/smp.c	2005-05-30 14:01:17.000000000 +1000
+++ 956-smp-modifications.patch-new/arch/i386/power/smp.c	2005-05-30 10:32:47.000000000 +1000
@@ -1,12 +1,27 @@
-#ifdef CONFIG_SMP
-#error SMP is set.
-
 #include <linux/init.h>
 #include <linux/suspend.h>
-#include <asm/desc.h>
-#include <asm/i387.h>
-#include <asm/tlbflush.h>
+#include <linux/suspend-smp.h>
+#include <asm/suspend2.h>
+//#include <asm/desc.h>
+//#include <asm/i387.h>
+//#include <asm/tlbflush.h>
+#include <asm/atomic.h>
+
+#if defined(CONFIG_SUSPEND2)
+extern atomic_t suspend_cpu_counter __nosavedata;
+volatile unsigned char * my_saved_context __nosavedata;
+volatile static unsigned long c_loops_per_jiffy_ref[NR_CPUS] __nosavedata;
+#endif
+
+struct suspend2_saved_context suspend2_saved_context;	/* temporary storage */
+static struct suspend2_saved_context suspend2_saved_contexts[NR_CPUS];
+
+#if defined(CONFIG_SUSPEND2) || defined(CONFIG_SMP)
+volatile unsigned char * my_saved_context __nosavedata;
+cpumask_t saved_affinity[NR_IRQS];
+#endif
 
+#ifdef CONFIG_SMP
 /*
  * Save and restore processor state for secondary processors.
  * IRQs (and therefore preemption) are already disabled 
@@ -40,7 +55,7 @@ void __smp_suspend_lowlevel(void * data)
 	       	my_saved_context = (unsigned char *) (suspend2_saved_contexts + _smp_processor_id());
 		for (loop = sizeof(struct suspend2_saved_context); loop--; loop)
 			*(((unsigned char *) &suspend2_saved_context) + loop - 1) = *(my_saved_context + loop - 1);
-		restore_processor_context();
+		suspend2_restore_processor_context();
 		cpu_clear(_smp_processor_id(), per_cpu(cpu_tlbstate, _smp_processor_id()).active_mm->cpu_vm_mask);
 		load_cr3(swapper_pg_dir);
 		wbinvd();
@@ -62,7 +77,7 @@ void __smp_suspend_lowlevel(void * data)
 			cpu_relax();
 			barrier();
 		}
-		save_processor_context();
+		suspend2_save_processor_context();
 		my_saved_context = (unsigned char *) (suspend2_saved_contexts + _smp_processor_id());
 		for (loop = sizeof(struct suspend2_saved_context); loop--; loop)
 			*(my_saved_context + loop - 1) = *(((unsigned char *) &suspend2_saved_context) + loop - 1);
diff -ruNp 956-smp-modifications.patch-old/include/asm-i386/suspend2.h 956-smp-modifications.patch-new/include/asm-i386/suspend2.h
--- 956-smp-modifications.patch-old/include/asm-i386/suspend2.h	2005-05-30 14:01:17.000000000 +1000
+++ 956-smp-modifications.patch-new/include/asm-i386/suspend2.h	2005-05-30 10:34:37.000000000 +1000
@@ -7,12 +7,11 @@
   */
 #include <linux/init.h>
 #include <linux/suspend.h>
+#include <linux/suspend-smp.h>
+#include <linux/irq.h>
 #include <asm/desc.h>
 #include <asm/i387.h>
 #include <asm/tlbflush.h>
-
-extern char __nosavedata swsusp_pg_dir[PAGE_SIZE]
-                  __attribute__ ((aligned (PAGE_SIZE)));
 #include <asm/processor.h>
 #undef inline
 #define inline	__inline__ __attribute__((always_inline))
@@ -28,33 +27,10 @@ extern void mtrr_restore_finish(void);
 #define mtrr_restore_finish() do { } while(0)
 #endif
 		  
-/* image of the saved processor states */
-struct suspend2_saved_context {
-	u32 eax, ebx, ecx, edx;
-	u32 esp, ebp, esi, edi;
-	u16 es, fs, gs, ss;
-	u32 cr0, cr2, cr3, cr4;
-	u16 gdt_pad;
-	u16 gdt_limit;
-	u32 gdt_base;
-	u16 idt_pad;
-	u16 idt_limit;
-	u32 idt_base;
-	u16 ldt;
-	u16 tss;
-	u32 tr;
-	u32 safety;
-	u32 return_address;
-	u32 eflags;
-} __attribute__((packed));
-
-#ifdef CONFIG_SMP
-static struct suspend2_saved_context suspend2_saved_contexts[NR_CPUS];
-#else
+#ifndef CONFIG_SMP
 #undef cpu_clear
 #define cpu_clear(a, b) do { } while(0)
 #endif
-static struct suspend2_saved_context suspend2_saved_context;	/* temporary storage */
 
 /*
  * save_processor_context
@@ -235,9 +211,13 @@ static inline void restore_processor_con
 	do_fpu_end();
 }
 
+static inline void suspend2_restore_processor_context(void)
+{
+	restore_processor_context();
+}
+
 #if defined(CONFIG_SUSPEND2) || defined(CONFIG_SMP)
 extern atomic_t suspend_cpu_counter __nosavedata;
-volatile unsigned char * my_saved_context __nosavedata;
 volatile static unsigned long c_loops_per_jiffy_ref[NR_CPUS] __nosavedata;
 #endif
 
@@ -271,7 +251,7 @@ extern void suspend_apic_reload_state(vo
 
 extern irq_desc_t irq_desc[];
 extern cpumask_t irq_affinity[];
-cpumask_t saved_affinity[NR_IRQS];
+extern cpumask_t saved_affinity[NR_IRQS];
 
 /*
  * Routine to save the old irq affinities and change affinities of all irqs to
@@ -411,11 +391,6 @@ static inline void suspend2_pre_copyback
 	
 }
 
-static inline void suspend2_restore_processor_context(void)
-{
-	restore_processor_context();
-}
-	
 static inline void suspend2_flush_caches(void)
 {
 	cpu_clear(_smp_processor_id(), per_cpu(cpu_tlbstate, _smp_processor_id()).active_mm->cpu_vm_mask);
diff -ruNp 956-smp-modifications.patch-old/include/linux/suspend2.h 956-smp-modifications.patch-new/include/linux/suspend2.h
--- 956-smp-modifications.patch-old/include/linux/suspend2.h	2005-05-30 14:01:17.000000000 +1000
+++ 956-smp-modifications.patch-new/include/linux/suspend2.h	2005-05-30 09:12:49.000000000 +1000
@@ -7,6 +7,9 @@
 /* arch/i386/mm/init.c */
 extern char __nosave_begin, __nosave_end;
 
+extern char __nosavedata swsusp_pg_dir[PAGE_SIZE]
+                  __attribute__ ((aligned (PAGE_SIZE)));
+
 /* kernel/power/process.c */
 
 /* fs/buffer.c */
diff -ruNp 956-smp-modifications.patch-old/include/linux/suspend-smp.h 956-smp-modifications.patch-new/include/linux/suspend-smp.h
--- 956-smp-modifications.patch-old/include/linux/suspend-smp.h	1970-01-01 10:00:00.000000000 +1000
+++ 956-smp-modifications.patch-new/include/linux/suspend-smp.h	2005-05-30 09:55:56.000000000 +1000
@@ -0,0 +1,25 @@
+#ifndef SUSPEND_SMP_H
+#define SUSPEND_SMP_H
+
+/* image of the saved processor states */
+struct suspend2_saved_context {
+	u32 eax, ebx, ecx, edx;
+	u32 esp, ebp, esi, edi;
+	u16 es, fs, gs, ss;
+	u32 cr0, cr2, cr3, cr4;
+	u16 gdt_pad;
+	u16 gdt_limit;
+	u32 gdt_base;
+	u16 idt_pad;
+	u16 idt_limit;
+	u32 idt_base;
+	u16 ldt;
+	u16 tss;
+	u32 tr;
+	u32 safety;
+	u32 return_address;
+	u32 eflags;
+} __attribute__((packed));
+
+extern struct suspend2_saved_context suspend2_saved_context;	/* temporary storage */
+#endif
diff -ruNp 956-smp-modifications.patch-old/kernel/power/suspend2_core/atomic_copy.c 956-smp-modifications.patch-new/kernel/power/suspend2_core/atomic_copy.c
--- 956-smp-modifications.patch-old/kernel/power/suspend2_core/atomic_copy.c	2005-05-30 14:01:17.000000000 +1000
+++ 956-smp-modifications.patch-new/kernel/power/suspend2_core/atomic_copy.c	2005-05-30 09:12:49.000000000 +1000
@@ -34,6 +34,7 @@
 #include "driver_model.h"
 #include "ui.h"
 #include "plugins.h"
+#include "atomic_copy.h"
 
 volatile static int state1 __nosavedata = 0;
 volatile static int state2 __nosavedata = 0;
@@ -391,4 +392,3 @@ void suspend2_unmap_atomic_copy_pages(vo
 	}
 }
 #endif
-
diff -ruNp 956-smp-modifications.patch-old/kernel/power/suspend2_core/atomic_copy.h 956-smp-modifications.patch-new/kernel/power/suspend2_core/atomic_copy.h
--- 956-smp-modifications.patch-old/kernel/power/suspend2_core/atomic_copy.h	2005-05-30 14:01:17.000000000 +1000
+++ 956-smp-modifications.patch-new/kernel/power/suspend2_core/atomic_copy.h	2005-05-30 09:12:49.000000000 +1000
@@ -1,9 +1,2 @@
 extern inline void move_stack_to_nonconflicing_area(void);
-extern inline void suspend2_save_processor_context(void);
-extern inline void suspend2_restore_processor_context(int processor_id);
-extern inline void suspend2_pre_copyback(int processor_id);
-extern inline void suspend2_post_copyback(int processor_id);
-extern inline void suspend2_pre_copy(void);
-extern inline void suspend2_post_copy(void);
-
 extern int save_image_part1(void);
diff -ruNp 956-smp-modifications.patch-old/kernel/power/suspend2_core/prepare_image.c 956-smp-modifications.patch-new/kernel/power/suspend2_core/prepare_image.c
--- 956-smp-modifications.patch-old/kernel/power/suspend2_core/prepare_image.c	2005-05-30 14:01:17.000000000 +1000
+++ 956-smp-modifications.patch-new/kernel/power/suspend2_core/prepare_image.c	2005-05-30 09:12:49.000000000 +1000
@@ -325,7 +325,7 @@ static int update_image(void) 
 		expected_compression_ratio(),
 		MAIN_STORAGE_NEEDED(1));
 #endif
-	param_used = MAIN_STORAGE_NEEDED(1) + 100;
+	param_used = MAIN_STORAGE_NEEDED(1);
 	if ((result2 = active_writer->ops.writer.allocate_storage(param_used))) {
 		printk("Main storage: allocate_storage(%d) returned %d.\n", param_used, result2);
 		suspend_message(SUSPEND_EAT_MEMORY, SUSPEND_LOW, 1,
diff -ruNp 956-smp-modifications.patch-old/kernel/power/suspend2_core/version.h 956-smp-modifications.patch-new/kernel/power/suspend2_core/version.h
--- 956-smp-modifications.patch-old/kernel/power/suspend2_core/version.h	2005-05-30 14:01:17.000000000 +1000
+++ 956-smp-modifications.patch-new/kernel/power/suspend2_core/version.h	2005-05-30 13:45:12.000000000 +1000
@@ -1,4 +1,4 @@
-#define SUSPEND_CORE_VERSION "2.1.8.10"
+#define SUSPEND_CORE_VERSION "2.1.8.11"
 #ifndef KERNEL_POWER_SWSUSP_C
 #define name_suspend "Software Suspend " SUSPEND_CORE_VERSION ": "
 #endif

--=-X2KTC7PfXR2TRcuQRL7H--



