debug: improve ftrace_ramoops for io trace [1/1]
authorHanjie Lin <hanjie.lin@amlogic.com>
Sat, 12 Oct 2019 07:39:46 +0000 (15:39 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Mon, 21 Oct 2019 07:48:17 +0000 (00:48 -0700)
PD#SWPL-6028

Problem:
optimize

Solution:
 - restore memtype setting method to default.
   depends on dts unbuffered attr,
   default 0 means pgprot_writecombine and 1 means pgprot_noncached.
 - always enable ramoop_io_en.
 - fix ioremap_page_range() print mistake.

Verify:

Change-Id: Ib4383d1f5ff8310cfe4f5f732413e0d517d557b5
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
fs/pstore/ram.c
lib/ioremap.c

index c2d8f06..4c1d59e 100644 (file)
@@ -602,9 +602,6 @@ static int ramoops_probe(struct platform_device *pdev)
        cxt->size = pdata->mem_size;
        cxt->phys_addr = pdata->mem_address;
        cxt->memtype = pdata->mem_type;
-#ifdef CONFIG_AMLOGIC_DEBUG_FTRACE_PSTORE
-       cxt->memtype |= (!!ramoops_io_en);
-#endif
        cxt->record_size = pdata->record_size;
        cxt->console_size = pdata->console_size;
        cxt->ftrace_size = pdata->ftrace_size;
@@ -684,7 +681,7 @@ static int ramoops_probe(struct platform_device *pdev)
 #ifdef CONFIG_AMLOGIC_DEBUG_FTRACE_PSTORE
        if (ramoops_ftrace_size) {
                cxt->fprz->flags |= (PRZ_FLAG_NO_LOCK | PRZ_FLAG_BIG_LOCK);
-               ramoops_ftrace_en = !persistent_ram_old_size(cxt->fprz);
+               ramoops_ftrace_en = 1;
        }
        pr_info("ramoops_io_en:%d %d old:0x%lx ftrace_size:0x%lx",
                ramoops_io_en, ramoops_ftrace_en,
index 0e192bb..56980cf 100644 (file)
@@ -146,6 +146,9 @@ int ioremap_page_range(unsigned long addr,
        unsigned long start;
        unsigned long next;
        int err;
+#ifdef CONFIG_AMLOGIC_DEBUG_FTRACE_PSTORE
+       phys_addr_t phys_addr_save = phys_addr;
+#endif
 
        BUG_ON(addr >= end);
 
@@ -163,7 +166,7 @@ int ioremap_page_range(unsigned long addr,
 #ifdef CONFIG_AMLOGIC_DEBUG_FTRACE_PSTORE
        if (need_dump_iomap() && !is_normal_memory(prot))
                pr_err("io__map <va:0x%08lx-0x%08lx> pa:0x%lx,port:0x%lx\n",
-                      start, end, (unsigned long)phys_addr,
+                      start, end, (unsigned long)phys_addr_save,
                       (unsigned long)pgprot_val(prot));
 #endif
        return err;