[RFC PATCH 05/10] fadump: Convert firmware-assisted cpu state dump data into elf notes.

Anton Blanchard anton at samba.org
Wed Aug 31 14:23:48 EST 2011


> diff --git a/kernel/panic.c b/kernel/panic.c
> index 6923167..1965b50 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -49,6 +49,15 @@ static long no_blink(int state)
>  long (*panic_blink)(int state);
>  EXPORT_SYMBOL(panic_blink);
>  
> +#ifdef CONFIG_FA_DUMP
> +/*
> + * provide an empty default implementation here -- architecture
> + * code may override this
> + */
> +void __attribute__ ((weak)) crash_fadump(struct pt_regs *regs, const char *str)
> +{}
> +#endif
> +
>  /**
>   *	panic - halt the system
>   *	@fmt: The text string to print
> @@ -81,6 +90,13 @@ NORET_TYPE void panic(const char * fmt, ...)
>  	dump_stack();
>  #endif
>  
> +#ifdef CONFIG_FA_DUMP
> +	/*
> +	 * If firmware-assisted dump has been registered then trigger
> +	 * firmware-assisted dump and let firmware handle everything else.
> +	 */
> +	crash_fadump(NULL, buf);
> +#endif
>  	/*
>  	 * If we have crashed and we have a crash kernel loaded let it handle
>  	 * everything else.

Firmware assisted dump is an IBM POWER Systems specific feature and it
shouldn't leak into a common file like this. Isn't there an existing
hook we can catch like the panic notifier?

Anton


More information about the Linuxppc-dev mailing list