Skip to contentSkip to conversation

disable preemption on running show all regs.

PATCH In review Steven Rostedt 2 participants 3 messages Jun 19, 2007 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 disable preemption on running show all regs.

The show all regs sysrq uses the nmi function to do it. But this function expects preemption to be off, or funny things happen.

drivers/char/sysrq.c +2 -0
Index: linux-2.6.21-rt9/drivers/char/sysrq.c
===================================================================
@@ -213,7 +213,9 @@ static struct sysrq_key_op sysrq_showreg
 
 static void sysrq_handle_showallregs(int key, struct tty_struct *tty)
 {
+        preempt_disable();
 	nmi_show_all_regs();
+        preempt_enable();
 }
 
 static struct sysrq_key_op sysrq_showallregs_op = {
#1 lore raw
Quoted 10 lines · Steven Rostedt

The show all regs sysrq uses the nmi function to do it. But this function expects preemption to be off, or funny things happen.

Index: linux-2.6.21-rt9/drivers/char/sysrq.c
===================================================================

drivers/char/sysrq.c static struct sysrq_key_op sysrq_showreg · line 219

Quoted 7 lines
drivers/char/sysrq.c +2 -0
@@ -213,7 +213,9 @@ static struct sysrq_key_op sysrq_showreg
 
 static void sysrq_handle_showallregs(int key, struct tty_struct *tty)
 {
+        preempt_disable();
 	nmi_show_all_regs();
+        preempt_enable();
 }

Looks like you have a whitespace issue here.. Should be tabs, not spaces.

Daniel

#2 lore raw
Quoted 2 lines · Daniel Walker

Looks like you have a whitespace issue here.. Should be tabs, not spaces.

Bah, there's a "/* -*- linux-c -*- " at the top of that file that's messing up with my emacs!

Is this better :-p

drivers/char/sysrq.c +2 -0
Index: linux-2.6.21.5-rt15/drivers/char/sysrq.c
===================================================================
@@ -213,7 +213,9 @@ static struct sysrq_key_op sysrq_showreg
 
 static void sysrq_handle_showallregs(int key, struct tty_struct *tty)
 {
+	preempt_disable();
 	nmi_show_all_regs();
+	preempt_enable();
 }
 
 static struct sysrq_key_op sysrq_showallregs_op = {