Merge tag 'v4.9.209' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux...
[platform/kernel/linux-amlogic.git] / fs / pstore / ram.c
index a73959e..bbdc43a 100644 (file)
@@ -561,6 +561,12 @@ static int ramoops_parse_dt(struct platform_device *pdev,
        return 0;
 }
 
+void notrace ramoops_console_write_buf(const char *buf, size_t size)
+{
+       struct ramoops_context *cxt = &oops_cxt;
+       persistent_ram_write(cxt->cprz, buf, size);
+}
+
 static int ramoops_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
@@ -626,7 +632,6 @@ static int ramoops_probe(struct platform_device *pdev)
                               cxt->console_size, 0);
        if (err)
                goto fail_init_cprz;
-
        err = ramoops_init_prz(dev, cxt, &cxt->fprz, &paddr, cxt->ftrace_size,
                               LINUX_VERSION_CODE);
        if (err)
@@ -684,6 +689,17 @@ static int ramoops_probe(struct platform_device *pdev)
                cxt->size, (unsigned long long)cxt->phys_addr,
                cxt->ecc_info.ecc_size, cxt->ecc_info.block_size);
 
+#ifdef CONFIG_AMLOGIC_DEBUG_FTRACE_PSTORE
+       if (ramoops_ftrace_size) {
+               cxt->fprz->flags |= (PRZ_FLAG_NO_LOCK | PRZ_FLAG_BIG_LOCK);
+               ramoops_ftrace_en = 1;
+       }
+       pr_info("ramoops_io_en:%d %d old:0x%lx ftrace_size:0x%lx",
+               ramoops_io_en, ramoops_ftrace_en,
+               cxt->fprz ? (unsigned long)persistent_ram_old_size(cxt->fprz)
+               : 0, ramoops_ftrace_size);
+#endif
+
        return 0;
 
 fail_buf: