diff mbox series

[1/4] powerpc/perf/core-book3s: Avoid loading platform pmu driver during dump kernel

Message ID 20250216171226.432906-1-maddy@linux.ibm.com (mailing list archive)
State Superseded
Headers show
Series [1/4] powerpc/perf/core-book3s: Avoid loading platform pmu driver during dump kernel | expand

Commit Message

Madhavan Srinivasan Feb. 16, 2025, 5:12 p.m. UTC
Platform pmu driver may not be used in the dump kernel.
Avoid loading it.

Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
---
 arch/powerpc/perf/core-book3s.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 2b79171ee185..9a009dff63b3 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -22,6 +22,8 @@ 
 
 #ifdef CONFIG_PPC64
 #include "internal.h"
+#include <asm/fadump.h>
+#include <asm/kexec.h>
 #endif
 
 #define BHRB_MAX_ENTRIES	32
@@ -2571,6 +2573,12 @@  static int __init init_ppc64_pmu(void)
 		return 0;
 	}
 
+	/*
+	 * If the dump kernel is active, skip loading these drivers
+	 */
+	if (is_kdump_kernel() || is_fadump_active())
+		return 0;
+
 	/* run through all the pmu drivers one at a time */
 	if (!init_power5_pmu())
 		return 0;