linux-mips
[Top] [All Lists]

[PATCH] MIPS: KDUMP: Fix to access non-sectioned memory

To: linux-mips <linux-mips@linux-mips.org>
Subject: [PATCH] MIPS: KDUMP: Fix to access non-sectioned memory
From: Prem Mallappa <prem.mallappa@gmail.com>
Date: Thu, 3 Oct 2013 13:16:55 +0530
Cc: Prem Mallappa <pmallappa@caviumnetworks.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Tdkwb3uIVq6013x36h1nyrylJsxIre3ZRcGlJSGI7y8=; b=Sllstv6x+fYImSqzIGCYQbKnlLbypkIrb4qE87K06jGhK8v+Ko152s9E5puX7EUN74 WXGH1NWsTjvvqFCIXPZS03sdZTO6GBAZpHdyxYkj3jnjmO1gzdtfsRQoWHtPHef4VrT9 nAs5MhYBQULrNvRZ2+jCnoAWYw4HySw+u3M3yRDhhnUhr12e19cwHHArut8lmlMKWyd2 J6IoforhmnHS7oFlUhpmlHljahf/rLV4D4xmFOBIy1ikBiXnfdKC7NXQk3G8T1kBpZOZ l/S/bBFp4EqyvCnj/vusNAPmCOJX8hac8L+yc+Sr79ZvzibpMzx9eXA5W/sc2l0NqUvJ DGsg==
In-reply-to: <1380786415-24956-1-git-send-email-pmallappa@caviumnetworks.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1380786415-24956-1-git-send-email-pmallappa@caviumnetworks.com>
Sender: linux-mips-bounce@linux-mips.org
When booted with initramfs, percpu crash_notes ends up in memory that is not 
accessible by crashkernel

Signed-off-by: Prem Mallappa <pmallappa@caviumnetworks.com>
---
 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


<Prev in Thread] Current Thread [Next in Thread>