Loading Documentation/admin-guide/ramoops.rst +4 −2 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ Ramoops oops/panic logger Sergiu Iordache <sergiu@chromium.org> Updated: 17 November 2011 Updated: 10 July 2020 Introduction ------------ Loading @@ -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 Loading fs/pstore/ram.c +2 −1 Original line number Diff line number Diff line Loading @@ -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"); Loading fs/pstore/ram_core.c +6 −1 Original line number Diff line number Diff line Loading @@ -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) Loading Loading @@ -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); Loading Loading
Documentation/admin-guide/ramoops.rst +4 −2 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ Ramoops oops/panic logger Sergiu Iordache <sergiu@chromium.org> Updated: 17 November 2011 Updated: 10 July 2020 Introduction ------------ Loading @@ -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 Loading
fs/pstore/ram.c +2 −1 Original line number Diff line number Diff line Loading @@ -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"); Loading
fs/pstore/ram_core.c +6 −1 Original line number Diff line number Diff line Loading @@ -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) Loading Loading @@ -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); Loading