[patch 10/10] Make sure we only enable xmon once

Olof Johansson olof at lixom.net
Wed Mar 21 13:11:49 EST 2007


On Tue, Mar 20, 2007 at 08:38:20PM -0500, anton at samba.org wrote:
> Now we use notifier hooks we have to be careful not to enable xmon multiple
> times.
> 
> Signed-off-by: Anton Blanchard <anton at samba.org>
> ---
> 
> Index: linux-2.6/arch/powerpc/xmon/xmon.c
> ===================================================================
> --- linux-2.6.orig/arch/powerpc/xmon/xmon.c	2007-03-11 14:52:45.000000000 -0500
> +++ linux-2.6/arch/powerpc/xmon/xmon.c	2007-03-11 14:56:37.000000000 -0500
> @@ -2658,11 +2658,20 @@
>  	unregister_page_fault_notifier(&xmon_page_fault_nb);
>  }
>  
> +#ifdef CONFIG_XMON_DEFAULT
> +int __initdata xmon_on = 1;
> +#else
> +int __initdata xmon_on = 0;
> +#endif

This shouldn't be __initdata, should it? It's used at runtime below.

> +
>  #ifdef CONFIG_MAGIC_SYSRQ
>  static void sysrq_handle_xmon(int key, struct tty_struct *tty) 
>  {
>  	/* ensure xmon is enabled */
> -	xmon_enable();
> +	if (!xmon_on) {
> +		xmon_on = 1;
> +		xmon_enable();
> +	}
>  	xmon(get_irq_regs());
>  }
[...]



-Olof



More information about the Linuxppc-dev mailing list