Skip to contentSkip to conversation

fix aperture vs. suspend problem

PATCH Pavel Machek 5 participants 7 messages Mar 13, 2008 – Mar 21, 2008 x86

lore
Share & tools
lore
#0 lore raw

aperture_64.c takes a piece of memory and makes it into iommu window... but such window may not be saved by swsusp -- that leads to oops during suspend.

arch/x86/kernel/aperture_64.c +2 -0
index 608152a..88747f3 100644
@@ -18,6 +18,7 @@ #include <linux/pci_ids.h>
 #include <linux/pci.h>
 #include <linux/bitops.h>
 #include <linux/ioport.h>
+#include <linux/suspend.h>
 #include <asm/e820.h>
 #include <asm/io.h>
 #include <asm/gart.h>
@@ -76,6 +77,7 @@ static u32 __init allocate_aperture(void
 	printk(KERN_INFO "Mapping aperture over %d KB of RAM @ %lx\n",
 			aper_size >> 10, __pa(p));
 	insert_aperture_resource((u32)__pa(p), aper_size);
+	register_nosave_region((u32)__pa(p) >> PAGE_SHIFT, (u32)__pa(p+aper_size) >> PAGE_SHIFT);
 
 	return (u32)__pa(p);
 }
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#1 lore raw
Quoted 6 lines · Pavel Machek

aperture_64.c takes a piece of memory and makes it into iommu window... but such window may not be saved by swsusp -- that leads to oops during suspend.

Quoted 21 lines
arch/x86/kernel/aperture_64.c +2 -0
index 608152a..88747f3 100644
@@ -18,6 +18,7 @@ #include <linux/pci_ids.h>
 #include <linux/pci.h>
 #include <linux/bitops.h>
 #include <linux/ioport.h>
+#include <linux/suspend.h>
 #include <asm/e820.h>
 #include <asm/io.h>
 #include <asm/gart.h>
@@ -76,6 +77,7 @@ static u32 __init allocate_aperture(void
 	printk(KERN_INFO "Mapping aperture over %d KB of RAM @ %lx\n",
 			aper_size >> 10, __pa(p));
 	insert_aperture_resource((u32)__pa(p), aper_size);
+	register_nosave_region((u32)__pa(p) >> PAGE_SHIFT, (u32)__pa(p+aper_size) >> PAGE_SHIFT);
 
 	return (u32)__pa(p);
 }
#2 lore raw
In reply to Pavel Machek
Quoted 21 lines · On Thu, 13 Mar 2008 11:05:31 +0100 Pavel Machek <[email protected]> wrote:

aperture_64.c takes a piece of memory and makes it into iommu window... but such window may not be saved by swsusp -- that leads to oops during suspend.

arch/x86/kernel/aperture_64.c +1 -0
index 608152a..88747f3 100644
@@ -18,6 +18,7 @@ #include <linux/pci_ids.h>
 #include <linux/pci.h>
 #include <linux/bitops.h>
 #include <linux/ioport.h>
+#include <linux/suspend.h>
 #include <asm/e820.h>
 #include <asm/io.h>
 #include <asm/gart.h>

arch/x86/kernel/aperture_64.c static u32 __init allocate_aperture(void · line 83

Quoted 7 lines
arch/x86/kernel/aperture_64.c +1 -0
@@ -76,6 +77,7 @@ static u32 __init allocate_aperture(void
 	printk(KERN_INFO "Mapping aperture over %d KB of RAM @ %lx\n",
 			aper_size >> 10, __pa(p));
 	insert_aperture_resource((u32)__pa(p), aper_size);
+	register_nosave_region((u32)__pa(p) >> PAGE_SHIFT, (u32)__pa(p+aper_size) >> PAGE_SHIFT);
 
 	return (u32)__pa(p);
 }

This is also needed in 2.6.24, perhaps earlier?

#3 lore raw
Quoted 28 lines · Andrew Morton
Quoted 25 lines · On Thu, 13 Mar 2008 11:05:31 +0100 Pavel Machek <[email protected]> wrote:

aperture_64.c takes a piece of memory and makes it into iommu window... but such window may not be saved by swsusp -- that leads to oops during suspend.

arch/x86/kernel/aperture_64.c +2 -0
index 608152a..88747f3 100644
@@ -18,6 +18,7 @@ #include <linux/pci_ids.h>
 #include <linux/pci.h>
 #include <linux/bitops.h>
 #include <linux/ioport.h>
+#include <linux/suspend.h>
 #include <asm/e820.h>
 #include <asm/io.h>
 #include <asm/gart.h>
@@ -76,6 +77,7 @@ static u32 __init allocate_aperture(void
 	printk(KERN_INFO "Mapping aperture over %d KB of RAM @ %lx\n",
 			aper_size >> 10, __pa(p));
 	insert_aperture_resource((u32)__pa(p), aper_size);
+	register_nosave_region((u32)__pa(p) >> PAGE_SHIFT, (u32)__pa(p+aper_size) >> PAGE_SHIFT);
 
Quoted 5 lines

arch/x86/kernel/aperture_64.c static u32 __init allocate_aperture(void · line 83

Quoted 3 lines
arch/x86/kernel/aperture_64.c +0 -0
 	return (u32)__pa(p);
 }

This is also needed in 2.6.24, perhaps earlier?

It seems to only trigger on >3GB boxes, during swsusp. People are not normally suspending those big boxes. I do not think this is worth backporting.

Pavel

Signature · 3 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
pomozte zachranit klanovicky les:  http://www.ujezdskystrom.info/
#4 lore raw
Quoted 7 lines · Pavel Machek
Quoted 2 lines · Andrew Morton

[...]
This is also needed in 2.6.24, perhaps earlier?

It seems to only trigger on >3GB boxes, during swsusp. People are not normally suspending those big boxes. I do not think this is worth backporting.

Here vendors are starting to sell x86_64 laptops with 4GB ram in the *default* configuration --- so I think that yes, it should be backported, at least to 2.6.24 (which will be heavily shipped by distros this year, I suppose).

Romano

Signature · 8 lines
Sorry for the disclaimer --- ¡I cannot stop it!



--
La presente comunicación tiene carácter confidencial y es para el exclusivo uso del destinatario indicado en la misma. Si Ud. no es el destinatario indicado, le informamos que cualquier forma de distribución, reproducción o uso de esta comunicación y/o de la información contenida en la misma están estrictamente prohibidos por la ley. Si Ud. ha recibido esta comunicación por error, por favor, notifíquelo inmediatamente al remitente contestando a este mensaje y proceda a continuación a destruirlo. Gracias por su colaboración.

This communication contains confidential information. It is for the exclusive use of the intended addressee. If you are not the intended addressee, please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited by law. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy this message. Thank you for your cooperation. 
#5 lore raw
Quoted 7 lines · Romano Giannetti
Quoted 4 lines · Pavel Machek
Quoted 2 lines · Andrew Morton

[...]
This is also needed in 2.6.24, perhaps earlier?

Quoted 8 lines
Quoted 3 lines

It seems to only trigger on >3GB boxes, during swsusp. People are not normally suspending those big boxes. I do not think this is worth backporting.

Here vendors are starting to sell x86_64 laptops with 4GB ram in the *default* configuration --- so I think that yes, it should be backported, at least to 2.6.24 (which will be heavily shipped by distros this year, I suppose).

Ok, if you hit the problem, you can do the backport. Subject is wrong, it hits hibernation, not suspend (sorry), and I'm not yet sure if I fixed all the related problems. Testing welcome.
Pavel

Signature · 3 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
pomozte zachranit klanovicky les:  http://www.ujezdskystrom.info/
#6 lore raw
In reply to Pavel Machek
Quoted 3 lines · Pavel Machek

aperture_64.c takes a piece of memory and makes it into iommu window... but such window may not be saved by swsusp -- that leads to oops during suspend.

nice catch! applied.

Ingo