Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98f70edf authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "pstore: Add support to cached pages"

parents 32eeccd0 29e4936d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ Ramoops oops/panic logger

Sergiu Iordache <sergiu@chromium.org>

Updated: 17 November 2011
Updated: 10 July 2020

Introduction
------------
@@ -29,7 +29,9 @@ mapping to pgprot_writecombine. Setting ``mem_type=1`` attempts to use
``pgprot_noncached``, which only works on some platforms. This is because pstore
depends on atomic operations. At least on ARM, pgprot_noncached causes the
memory to be mapped strongly ordered, and atomic operations on strongly ordered
memory are implementation defined, and won't work on many ARMs such as omaps.
memory are implementation defined, and won't work on many ARMs such as omaps. Setting
``mem_type=2`` attempts to treat the memory region as normal memory, which enables
full cache on it. This can improve the performance.

The memory area is divided into ``record_size`` chunks (also rounded down to
power of two) and each oops/panic writes a ``record_size`` chunk of
+2 −1
Original line number Diff line number Diff line
@@ -686,6 +686,7 @@ static int ramoops_parse_dt(struct platform_device *pdev,

	pdata->mem_size = resource_size(res);
	pdata->mem_address = res->start;
	if (of_property_read_u32(of_node, "mem-type", &pdata->mem_type))
		pdata->mem_type = of_property_read_bool(of_node, "unbuffered");
	pdata->dump_oops = !of_property_read_bool(of_node, "no-dump-oops");

+6 −1
Original line number Diff line number Diff line
@@ -37,6 +37,9 @@ struct persistent_ram_buffer {
	uint8_t     data[0];
};

#define MEM_TYPE_WCOMBINE	0
#define MEM_TYPE_NONCACHED	1
#define MEM_TYPE_NORMAL		2
#define PERSISTENT_RAM_SIG (0x43474244) /* DBGC */

static inline size_t buffer_size(struct persistent_ram_zone *prz)
@@ -411,8 +414,10 @@ static void *persistent_ram_vmap(phys_addr_t start, size_t size,
	page_start = start - offset_in_page(start);
	page_count = DIV_ROUND_UP(size + offset_in_page(start), PAGE_SIZE);

	if (memtype)
	if (memtype == MEM_TYPE_NONCACHED)
		prot = pgprot_noncached(PAGE_KERNEL);
	else if (memtype == MEM_TYPE_NORMAL)
		prot = PAGE_KERNEL;
	else
		prot = pgprot_writecombine(PAGE_KERNEL);