summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/fadump.c
diff options
context:
space:
mode:
authorHari Bathini <hbathini@linux.ibm.com>2018-09-14 19:36:02 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2018-09-19 22:08:12 +1000
commit0823c68b054bca9dc321adea829af5cf36afb30b (patch)
treebe5af0713d0289ed80e18df711ad34fb1786bc8b /arch/powerpc/kernel/fadump.c
parent74422e2b19391e0bb9f11b0ab4522bbf7f93c4ba (diff)
downloadlwn-0823c68b054bca9dc321adea829af5cf36afb30b.tar.gz
lwn-0823c68b054bca9dc321adea829af5cf36afb30b.zip
powerpc/fadump: re-register firmware-assisted dump if already registered
Firmware-Assisted Dump (FADump) needs to be registered again after any memory hot add/remove operation to update the crash memory ranges. But currently, the kernel returns '-EEXIST' if we try to register without uregistering it first. This could expose the system to racing issues while unregistering and registering FADump from userspace during udev events. Spare the userspace of this and let it be taken care of in the kernel space for a simpler interface. Since this change, running 'echo 1 > /sys/kernel/fadump_registered' would result in re-regisering (unregistering and registering) FADump, if it was already registered. Signed-off-by: Hari Bathini <hbathini@linux.ibm.com> Acked-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/fadump.c')
-rw-r--r--arch/powerpc/kernel/fadump.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index a711d22339ea..761b28b1427d 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -1444,8 +1444,8 @@ static ssize_t fadump_register_store(struct kobject *kobj,
break;
case 1:
if (fw_dump.dump_registered == 1) {
- ret = -EEXIST;
- goto unlock_out;
+ /* Un-register Firmware-assisted dump */
+ fadump_unregister_dump(&fdm);
}
/* Register Firmware-assisted dump */
ret = register_fadump();