[PATCH] ppc/fadump: invoke kmsg_dump in fadump panic path

From: Shivang Upadhyay

Date: Tue Apr 07 2026 - 01:46:34 EST


fadump is registered in panic_notifier_list and gets triggered
before kmsg_dump_desc() in the panic path. As a result,
kmsg_dumpers (e.g. pstore) are not executed.

Invoke kmsg_dump_desc() from the fadump handler to ensure
kmsg_dumpers are called during panic.

Cc: Hari Bathini <hbathini@xxxxxxxxxxxxx>
Cc: Madhavan Srinivasan <maddy@xxxxxxxxxxxxx>
Cc: Mahesh Salgaonkar <mahesh@xxxxxxxxxxxxx>
Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
Cc: Ritesh Harjani (IBM) <ritesh.list@xxxxxxxxx>
Reported-by: Shirisha G <shirisha@xxxxxxxxxxxxx>
Suggested-by: Sourabh Jain <sourabhjain@xxxxxxxxxxxxx>
Signed-off-by: Shivang Upadhyay <shivangu@xxxxxxxxxxxxx>
---
arch/powerpc/kernel/setup-common.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index b1761909c23f..c329b071643d 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"

@@ -748,6 +749,8 @@ static int ppc_panic_fadump_handler(struct notifier_block *this,
* If firmware-assisted dump has been registered then trigger
* its callback and let the firmware handles everything else.
*/
+ kmsg_dump_desc(KMSG_DUMP_PANIC, (char *)ptr);
+
crash_fadump(NULL, ptr);

return NOTIFY_DONE;
--
2.53.0