diff options
| author | Shivang Upadhyay <shivangu@linux.ibm.com> | 2026-04-12 14:30:57 +0300 |
|---|---|---|
| committer | Madhavan Srinivasan <maddy@linux.ibm.com> | 2026-06-02 08:54:32 +0300 |
| commit | 6ed8332639853b77329594a241eb99fc36d591a2 (patch) | |
| tree | 70551e263ff2c191650db9ab5c594b6876937324 | |
| parent | 0521dbbc5710aca3b3d189747781761732289623 (diff) | |
| download | linux-6ed8332639853b77329594a241eb99fc36d591a2.tar.xz | |
ppc/fadump: invoke kmsg_dump in fadump panic path
fadump is registered in panic_notifier_list and gets triggered before
kmsg_dump_desc() in the panic path. As a result, kmsg_dumpers such as
pstore are not executed during fadump crashes.
This is problematic because pstore provides a critical fallback mechanism
for crash analysis. When fadump fails to successfully reboot the system
or capture a dump, pstore logs may be the only available information from
the crashed kernel. Without invoking kmsg_dump_desc() in the fadump path,
we lose this valuable diagnostic data.
Invoke kmsg_dump_desc() from the fadump panic handler, but only when
fadump is actually registered (checked via should_fadump_crash()). This
ensures kmsg_dumpers are called without duplicating the call that occurs
later in panic() when fadump is not active.
The call is placed before crash_fadump() to ensure logs are captured
before the system attempts to trigger the firmware-assisted dump.
Reported-by: Shirisha G <shirisha@linux.ibm.com>
Suggested-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com>
Tested-by: Shirisha G <shirisha@linux.ibm.com>
Reviewed-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>
Reviewed-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260412113057.46090-1-shivangu@linux.ibm.com
| -rw-r--r-- | arch/powerpc/kernel/setup-common.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index aecabe9cf139..67c545f61f0d 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -68,6 +68,7 @@ #include <asm/kasan.h> #include <asm/mce.h> #include <asm/systemcfg.h> +#include <linux/kmsg_dump.h> #include "setup.h" @@ -742,6 +743,13 @@ static int ppc_panic_fadump_handler(struct notifier_block *this, hard_irq_disable(); /* + * Invoke kmsg_dump (e.g., pstore) before crash_fadump() as fadump + * runs before panic()'s kmsg_dump_desc() call. + */ + if (should_fadump_crash()) + kmsg_dump_desc(KMSG_DUMP_PANIC, (char *)ptr); + + /* * If firmware-assisted dump has been registered then trigger * its callback and let the firmware handles everything else. */ |
