diff mbox series

[13/18] powernv/fadump: Skip processing /proc/vmcore when only OPAL core exists

Message ID 155077061221.21014.11783818311210876747.stgit@hbathini.in.ibm.com (mailing list archive)
State Superseded
Headers show
Series Add FADump support on PowerNV platform | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success next/apply_patch Successfully applied
snowpatch_ozlabs/checkpatch success total: 0 errors, 0 warnings, 0 checks, 18 lines checked

Commit Message

Hari Bathini Feb. 21, 2019, 5:36 p.m. UTC
If OPAL crashes when the kernel is not registered for FADump, F/W still
exports OPAL core through result-table DT node. Make sure '/proc/vmcore'
processing is skipped as only data relevant to OPAL core is exported in
such scenario.

Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
---
 arch/powerpc/platforms/powernv/opal-fadump.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/arch/powerpc/platforms/powernv/opal-fadump.c b/arch/powerpc/platforms/powernv/opal-fadump.c
index 2b36b5f..36077bd 100644
--- a/arch/powerpc/platforms/powernv/opal-fadump.c
+++ b/arch/powerpc/platforms/powernv/opal-fadump.c
@@ -108,6 +108,18 @@  static void update_fadump_config(struct fw_dump *fadump_conf,
 					be64_to_cpu(fdm->section[i].dest_size);
 			}
 		}
+
+		/*
+		 * If dump is active and no kernel memory region is found in
+		 * result-table, it means OPAL crashed on system with MPIPL
+		 * support and the kernel was not registered for FADump at the
+		 * time of crash. Skip processing /proc/vmcore in that case.
+		 */
+		if (j == 0) {
+			fadump_conf->dump_active = 0;
+			return;
+		}
+
 		fadump_conf->rmr_regions_cnt = j;
 		pr_debug("Real memory regions count: %lu\n",
 			 fadump_conf->rmr_regions_cnt);