When booted with initramfs, percpu crash_notes ends up in memory that is not accessible by crashkernel Signed-off-by: Prem Mallappa <pmallappa@xxxxxxxxxxxxxxxxxx> --- arch/mips/kernel/crash_dump.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/mips/kernel/crash_dump.c b/arch/mips/kernel/crash_dump.c index 3be9e7b..f9886437 100644 --- a/arch/mips/kernel/crash_dump.c +++ b/arch/mips/kernel/crash_dump.c @@ -3,6 +3,8 @@ #include <linux/crash_dump.h> #include <asm/uaccess.h> #include <linux/slab.h> +#include <linux/errno.h> +#include <linux/io.h> static int __init parse_savemaxmem(char *p) { @@ -13,7 +15,6 @@ static int __init parse_savemaxmem(char *p) } __setup("savemaxmem=", parse_savemaxmem); - static void *kdump_buf_page; /** @@ -41,19 +42,20 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, if (!csize) return 0; - vaddr = kmap_atomic_pfn(pfn); + vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE); if (!userbuf) { memcpy(buf, (vaddr + offset), csize); - kunmap_atomic(vaddr); + iounmap(vaddr); } else { if (!kdump_buf_page) { pr_warning("Kdump: Kdump buffer page not allocated\n"); return -EFAULT; } + copy_page(kdump_buf_page, vaddr); - kunmap_atomic(vaddr); + iounmap(vaddr); if (copy_to_user(buf, (kdump_buf_page + offset), csize)) return -EFAULT; } -- 1.8.4