Subject: DECstation crashes

From: Karsten Merker <[email-masked]>
Date: Fri, 9 Feb 2001 00:04:19 +0100

Hallo everyone,

I have been experimenting a bit to find out which changes cause the
kernel crashes on DECstations we experience in the last days. A checkout
from 2001-01-30 00:00 works fine, a checkout from 2001-02-02 00:00
crashes. Between these two dates is the large patch merging in the
changes from 2.4.0 -> 2.4.1, so it looks like the bug is somewhere in
there. Any ideas?

Do other Linux/MIPS-targets besides the DECstations show similar problems
(kernel crash due to NULL-pointer dereference in __free_pages_ok just
after mounting the rootfs) or is this a decstation-specific effect? The
problems happens both on R3k and R4k (tested on 5000/20 and 5000/150).

Greetings,
Karsten
-- 
#include <standard_disclaimer>
Nach Paragraph 28 Abs. 3 Bundesdatenschutzgesetz widerspreche ich der Nutzung
oder Uebermittlung meiner Daten fuer Werbezwecke oder fuer die Markt- oder
Meinungsforschung.

---

From: "Maciej W. Rozycki" <[email-masked]>
Date: Tue, 13 Feb 2001 15:42:34 +0100 (MET)

> problems happens both on R3k and R4k (tested on 5000/20 and 5000/150).

 The following patch should fix it.  Hmm, I wonder how it worked before at
all...  There is a related small fix for ARC included.  Ralf, please apply
these changes.

 Still 2.4.1 is rather unstable here -- it crashes silently under moderate
system activity after boot.  If nothing gets executed the system survives
for long.  A single `ls -la' is able to kill it if unfortunate enough,
though.  I'm still using 2.4.0-test12 taken on Jan 10, which is rock solid
apart from a single libtool script which kills it repeatedly always at the
same point (currently investigating it).

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email-masked], PGP key available        +

patch-mips-2.4.1-20010208-mem_map-43
diff -up --recursive --new-file linux-mips-2.4.1-20010208.macro/arch/mips/arc/memory.c linux-mips-2.4.1-20010208/arch/mips/arc/memory.c
--- linux-mips-2.4.1-20010208.macro/arch/mips/arc/memory.c	Wed Jan 17 05:25:58 2001
+++ linux-mips-2.4.1-20010208/arch/mips/arc/memory.c	Sun Feb 11 11:19:37 2001
@@ -145,7 +145,7 @@ prom_free_prom_memory (void)
 			      + boot_mem_map.map[i].size) {
 			ClearPageReserved(virt_to_page(__va(addr)));
 			set_page_count(virt_to_page(__va(addr)), 1);
-			free_page(__va(addr));
+			free_page((unsigned long)__va(addr));
 			addr += PAGE_SIZE;
 			freed += PAGE_SIZE;
 		}
diff -up --recursive --new-file linux-mips-2.4.1-20010208.macro/arch/mips/dec/prom/memory.c linux-mips-2.4.1-20010208/arch/mips/dec/prom/memory.c
--- linux-mips-2.4.1-20010208.macro/arch/mips/dec/prom/memory.c	Tue Dec 12 05:26:20 2000
+++ linux-mips-2.4.1-20010208/arch/mips/dec/prom/memory.c	Sun Feb 11 11:41:12 2001
@@ -108,10 +108,10 @@ void __init prom_meminit(unsigned int ma
 		rex_setup_memory_region();
 }
 
-void prom_free_prom_memory (void)
+void __init prom_free_prom_memory (void)
 {
 	unsigned long addr, end;
-	extern	char _ftext;
+	extern char _ftext;
 
 	/*
 	 * Free everything below the kernel itself but leave
@@ -126,16 +126,16 @@ void prom_free_prom_memory (void)
 	 * XXX: save this address for use in dec_lance.c?
 	 */
 	if (IOASIC)
-		end = PHYSADDR(&_ftext) - 0x00020000;
+		end = __pa(&_ftext) - 0x00020000;
 	else
 #endif
-		end = PHYSADDR(&_ftext);
+		end = __pa(&_ftext);
 
 	addr = PAGE_SIZE;
 	while (addr < end) {
-		ClearPageReserved(virt_to_page(addr));
-		set_page_count(virt_to_page(addr), 1);
-		free_page(addr);
+		ClearPageReserved(virt_to_page(__va(addr)));
+		set_page_count(virt_to_page(__va(addr)), 1);
+		free_page((unsigned long)__va(addr));
 		addr += PAGE_SIZE;
 	}