Skip to contentSkip to conversation

2.4.2-ac18 fix for Alpha machines

PATCH Matti Aarnio 2 participants 2 messages Mar 12, 2001

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

The linkage of vmlinux fails with lacking code for bust_spinlocks(), thus I cloned the i386 one as is -- which apparently is not really processor specific...

alpha/mm/fault.c renamed from alpha/mm/fault.c~ +36 -0
@@ -231,3 +231,39 @@
 	}
 #endif
 }
+
+extern spinlock_t timerlist_lock;
+
+/*
+ * Unlock any spinlocks which will prevent us from getting the
+ * message out (timerlist_lock is acquired through the
+ * console unblank code)
+ */
+void bust_spinlocks(int yes)
+{
+	spin_lock_init(&timerlist_lock);
+	if (yes) {
+		oops_in_progress = 1;
+#ifdef CONFIG_SMP
+		global_irq_lock = 0;	/* Many serial drivers do __global_cli() */
+#endif
+	} else {
+		int loglevel_save = console_loglevel;
+		unblank_screen();
+		oops_in_progress = 0;
+		/*
+		 * OK, the message is on the console.  Now we call printk()
+		 * without oops_in_progress set so that printk will give klogd
+		 * a poke.  Hold onto your hats...
+		 */
+		console_loglevel = 15;		/* NMI oopser may have shut the console up */
+		printk(" ");
+		console_loglevel = loglevel_save;
+	}
+}
+
+void do_BUG(const char *file, int line)
+{
+	bust_spinlocks(1);
+	printk("kernel BUG at %s:%d!\n", file, line);
+}
#1 lore raw
Quoted 16 lines · Matti Aarnio

The linkage of vmlinux fails with lacking code for bust_spinlocks(), thus I cloned the i386 one as is -- which apparently is not really processor specific...

alpha/mm/fault.c Sun Mar 11 14:46:39 2001 renamed from alpha/mm/fault.c~ Sun Mar 11 11:49:23 2001 +5 -0
@@ -231,3 +231,39 @@
        }
 #endif
 }
+
+extern spinlock_t timerlist_lock;
+
+/*
+ * Unlock any spinlocks which will prevent us from getting the

alpha/mm/fault.c Sun Mar 11 14:46:39 2001 line 248

Quoted 10 lines
alpha/mm/fault.c Sun Mar 11 14:46:39 2001 renamed from alpha/mm/fault.c~ Sun Mar 11 11:49:23 2001 +10 -0
+ * message out (timerlist_lock is acquired through the
+ * console unblank code)
+ */
+void bust_spinlocks(int yes)
+{
+       spin_lock_init(&timerlist_lock);
+       if (yes) {
+               oops_in_progress = 1;
+#ifdef CONFIG_SMP
+               global_irq_lock = 0;    /* Many serial drivers do __global_cli() */

can you say untested-on-smp :)
global_irq_lock is a spinlock.

alpha/mm/fault.c Sun Mar 11 14:46:39 2001 line 252

Quoted 4 lines
alpha/mm/fault.c Sun Mar 11 14:46:39 2001 renamed from alpha/mm/fault.c~ Sun Mar 11 11:49:23 2001 +4 -0
+#endif
+       } else {
+               int loglevel_save = console_loglevel;
+               unblank_screen();

need to include vt_kern.h for unblank_screen proto

alpha/mm/fault.c Sun Mar 11 14:46:39 2001 line 257

Quoted 5 lines
alpha/mm/fault.c Sun Mar 11 14:46:39 2001 renamed from alpha/mm/fault.c~ Sun Mar 11 11:49:23 2001 +5 -0
+void do_BUG(const char *file, int line)
+{
+       bust_spinlocks(1);
+       printk("kernel BUG at %s:%d!\n", file, line);
+}

hmm, is this necessary? The patch I sent to Alan is missing this.

Don't forget to CC Richard Henderson, the Alpha maintainer, on patches... Attached are the two patches I sent to Alan and Richard earlier today. The first is my version of the bust_spinlock fix. The second is an unrelated fix which was needed for our build, and may be helpful to some seeing "get_wchan_stack" warnings or errors.

Signature · 3 lines
Jeff Garzik       | May you have warm words on a cold evening,
Building 1024     | a full mooon on a dark night,
MandrakeSoft      | and a smooth road all the way to your door.
arch/alpha/mm/fault.c renamed from arch/alpha/mm/fault.c.orig +27 -0
@@ -24,9 +24,36 @@
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/interrupt.h>
+#include <linux/vt_kern.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
+
+extern spinlock_t timerlist_lock;
+void bust_spinlocks(int yes)
+{
+        spin_lock_init(&timerlist_lock);
+        if (yes) {
+                oops_in_progress = 1;
+#ifdef CONFIG_SMP
+		spin_lock_init(&global_irq_lock);    /* Many serial drivers do __global_cli() */
+#endif
+        } else {
+                int loglevel_save = console_loglevel;
+                unblank_screen();
+                oops_in_progress = 0;
+                /*
+                 * OK, the message is on the console.  Now we call printk()
+                 * without oops_in_progress set so that printk will give klogd
+                 * a poke.  Hold onto your hats...
+                 */
+                console_loglevel = 15;          /* NMI oopser may have shut the console up */
+                printk(" ");
+                console_loglevel = loglevel_save;
+        }
+}
+
+
 
 extern void die_if_kernel(char *,struct pt_regs *,long, unsigned long *);
 
fs/proc/array.c renamed from fs/proc/array.c.orig +2 -0
@@ -271,6 +271,7 @@
 extern int get_wchan_stack(struct task_struct *p, unsigned long *stack, int max);
 inline char *task_stack(struct task_struct *p, char *buffer)
 {
+#ifdef CONFIG_X86
 	unsigned long stack[64];
 	int i;
 	int cnt = get_wchan_stack(p, stack, 64);
@@ -278,6 +279,7 @@
 		buffer += sprintf(buffer, "Stack[%d]: %lx\n",
 				  i, stack[i]);
 	}
+#endif
 	return buffer;
 }