2007-06-19 20:18:43

by Steven Rostedt

[permalink] [raw]
Subject: [PATCH RT] 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.

Signed-off-by: Steven Rostedt <[email protected]>

Index: linux-2.6.21-rt9/drivers/char/sysrq.c
===================================================================
--- linux-2.6.21-rt9.orig/drivers/char/sysrq.c
+++ 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 = {



2007-06-19 21:00:56

by Daniel Walker

[permalink] [raw]
Subject: Re: [PATCH RT] disable preemption on running show all regs.

On Tue, 2007-06-19 at 16:17 -0400, Steven Rostedt wrote:
> The show all regs sysrq uses the nmi function to do it. But this
> function expects preemption to be off, or funny things happen.
>
> Signed-off-by: Steven Rostedt <[email protected]>
>
> Index: linux-2.6.21-rt9/drivers/char/sysrq.c
> ===================================================================
> --- linux-2.6.21-rt9.orig/drivers/char/sysrq.c
> +++ 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();
> }

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

Daniel

2007-06-19 21:37:06

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH RT] disable preemption on running show all regs.

On Tue, 2007-06-19 at 13:57 -0700, Daniel Walker wrote:

> 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

Signed-off-by: Steven Rostedt <[email protected]>

Index: linux-2.6.21.5-rt15/drivers/char/sysrq.c
===================================================================
--- linux-2.6.21.5-rt15.orig/drivers/char/sysrq.c
+++ 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 = {