Skip to content

Commit 6ed8332

Browse files
Shivang Upadhyaymaddy-kerneldev
authored andcommitted
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
1 parent 0521dbb commit 6ed8332

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

arch/powerpc/kernel/setup-common.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
#include <asm/kasan.h>
6969
#include <asm/mce.h>
7070
#include <asm/systemcfg.h>
71+
#include <linux/kmsg_dump.h>
7172

7273
#include "setup.h"
7374

@@ -741,6 +742,13 @@ static int ppc_panic_fadump_handler(struct notifier_block *this,
741742
*/
742743
hard_irq_disable();
743744

745+
/*
746+
* Invoke kmsg_dump (e.g., pstore) before crash_fadump() as fadump
747+
* runs before panic()'s kmsg_dump_desc() call.
748+
*/
749+
if (should_fadump_crash())
750+
kmsg_dump_desc(KMSG_DUMP_PANIC, (char *)ptr);
751+
744752
/*
745753
* If firmware-assisted dump has been registered then trigger
746754
* its callback and let the firmware handles everything else.

0 commit comments

Comments
 (0)