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

From: Anton Blanchard
Date: Wed Aug 31 2011 - 00:23:54 EST



> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/