[prev in list] [next in list] [prev in thread] [next in thread] 

List:       swsusp-devel
Subject:    Re: [Swsusp-devel] oops with rc3B and nvidia-5328 module active
From:       Nigel Cunningham <ncunningham () clear ! net ! nz>
Date:       2003-12-28 9:06:49
[Download RAW message or body]

That might be a different issue. 3B has a mistake on my part (using
memcpy before we've restored the processor context) that seems to have
only bitten in a few cases. Yours sounds like one. Please try adding the
attached patch. Make sure you keep it, because it will also be included
in the next 'proper' patch.

Regards,

Nigel

--- ../original/include/asm-i386/suspend.h	2003-12-27 20:10:36.000000000 +1300
+++ include/asm-i386/suspend.h	2003-12-27 11:15:10.000000000 +1300
@@ -253,7 +253,7 @@
 void do_swsusp_lowlevel(int resume)
 {
 	int this_cpu = smp_processor_id();
-	struct saved_context * my_saved_context = &saved_contexts[smp_processor_id()];
+	char * my_saved_context = (char *) &saved_contexts[smp_processor_id()];
 	unsigned long flags;
 	
 	if (!resume) {
@@ -339,7 +339,8 @@
 			check_shift_keys(0, ""); /* Keyboard interactivity */
 		}
 		spin_lock_irqsave(&saved_context_lock, flags);
-		memcpy(&saved_context, my_saved_context, sizeof(struct saved_context));
+		for (loop = sizeof(struct saved_context); loop--; loop)
+			*(((char *) &saved_context) + loop - 1) = *(my_saved_context + loop - 1);
 		restore_processor_context();
 		spin_unlock_irqrestore(&saved_context_lock, flags);
 		printk("Processor %d context restored, returning.\n", this_cpu);
@@ -408,7 +409,8 @@
 	}
 	
 	/* No locking needed here - other processors are waiting for me */
-	memcpy(&saved_context, my_saved_context, sizeof(struct saved_context));
+	for (loop = sizeof(struct saved_context); loop--; loop)
+		*(((char *) &saved_context) + loop - 1) = *(my_saved_context + loop - 1);
 	restore_processor_context();
 	
 /* Ahah, we now run with our old stack, and with registers copied from

-- 
My work on Software Suspend is graciously brought to you by
LinuxFund.org.



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
swsusp-devel mailing list
swsusp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swsusp-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic