aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/fadump.c
diff options
context:
space:
mode:
authorHari Bathini <hbathini@linux.ibm.com>2019-09-11 20:21:16 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2019-09-14 00:04:43 +1000
commit2790d01d1e1d22735d848eec55668f7d44417e22 (patch)
treef759721874ffceb66fcf964994107f6005751e59 /arch/powerpc/kernel/fadump.c
parentpowerpc/fadump: register kernel metadata address with opal (diff)
downloadlinux-dev-2790d01d1e1d22735d848eec55668f7d44417e22.tar.xz
linux-dev-2790d01d1e1d22735d848eec55668f7d44417e22.zip
powerpc/fadump: reset metadata address during clean up
During kexec boot, metadata address needs to be reset to avoid running into errors interpreting stale metadata address, in case the kexec'ed kernel crashes before metadata address could be setup again. Signed-off-by: Hari Bathini <hbathini@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/156821346629.5656.10783321582005237813.stgit@hbathini.in.ibm.com
Diffstat (limited to 'arch/powerpc/kernel/fadump.c')
-rw-r--r--arch/powerpc/kernel/fadump.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 7e7056382d98..aab9b4db0363 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -965,6 +965,9 @@ static int register_fadump(void)
void fadump_cleanup(void)
{
+ if (!fw_dump.fadump_supported)
+ return;
+
/* Invalidate the registration only if dump is active. */
if (fw_dump.dump_active) {
pr_debug("Invalidating firmware-assisted dump registration\n");
@@ -974,6 +977,9 @@ void fadump_cleanup(void)
fw_dump.ops->fadump_unregister(&fw_dump);
free_crash_memory_ranges();
}
+
+ if (fw_dump.ops->fadump_cleanup)
+ fw_dump.ops->fadump_cleanup(&fw_dump);
}
static void fadump_free_reserved_memory(unsigned long start_pfn,