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 <hbath...@linux.ibm.com>
---
 arch/powerpc/platforms/powernv/opal-fadump.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/powerpc/platforms/powernv/opal-fadump.c 
b/arch/powerpc/platforms/powernv/opal-fadump.c
index 65db21a..f530df0 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);

Reply via email to