Skip to contentSkip to conversation

Fix typo in arch/i386/power/cpu.c

PATCH In review Zachary Amsden 2 participants 2 messages May 22, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix typo in arch/i386/power/cpu.c

Fix a typo which caused us to corrupt CR2 (not likely a problem) and fail to restore CR0 (potentially a problem on APM systems, since TS/EM bits might be lost) after suspend.

Fix a typo in suspend code noticed by Artur Zaprzala. I'm unsure if this actually causes a bug in practice, since the ACPI wakeup code also restores CR0, and the APM code returns to protected mode, but the fix is obviously much better.

arch/i386/power/cpu.c +1 -1
Index: linux-2.6.17-rc/arch/i386/power/cpu.c
===================================================================
@@ -92,7 +92,7 @@ void __restore_processor_state(struct sa
 	write_cr4(ctxt->cr4);
 	write_cr3(ctxt->cr3);
 	write_cr2(ctxt->cr2);
-	write_cr2(ctxt->cr0);
+	write_cr0(ctxt->cr0);
 
 	/*
 	 * now restore the descriptor tables to their proper values
#1 lore raw
Quoted 10 lines · Zachary Amsden

Fix a typo which caused us to corrupt CR2 (not likely a problem) and fail to restore CR0 (potentially a problem on APM systems, since TS/EM bits might be lost) after suspend.

Fix a typo in suspend code noticed by Artur Zaprzala. I'm unsure if this actually causes a bug in practice, since the ACPI wakeup code also restores CR0, and the APM code returns to protected mode, but the fix is obviously much better.

I believe it is already queued in -mm tree. If you actually know know a system it breaks (or if it breaks vmware), we have very good reason to push it now.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html