From dc89bfe90223c12028d1f2c35d55564b7f46a326 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Fri, 15 Mar 2019 10:14:52 +0100 Subject: pstore: ramoops: allow zapping invalid buffers in read-only mode The FS_PSTORE_RAMOOPS_RO configuration option keeps barebox from zapping (clearing and fixing header ecc) all ramoops buffers on initialization. It also stops barebox from zapping invalid buffers. This causes issues when the console writing code tries to use the uninitialized, invalid console buffer. Therefore, allow barebox to zap invalid buffers, the kernel will do so anyway if it finds broken buffers during its initialization. Signed-off-by: Philipp Zabel Signed-off-by: Sascha Hauer --- fs/pstore/ram.c | 2 ++ fs/pstore/ram_core.c | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 3daec0d0d8..734d0c3c1d 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -401,7 +401,9 @@ static int ramoops_init_prz(const char *name, return err; } +#ifndef CONFIG_FS_PSTORE_RAMOOPS_RO persistent_ram_zap(*prz); +#endif /* CONFIG_FS_PSTORE_RAMOOPS_RO */ *paddr += sz; diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c index 0f7003f937..06be47ce53 100644 --- a/fs/pstore/ram_core.c +++ b/fs/pstore/ram_core.c @@ -330,18 +330,12 @@ void persistent_ram_free_old(struct persistent_ram_zone *prz) prz->old_log_size = 0; } -#ifdef CONFIG_FS_PSTORE_RAMOOPS_RO -void persistent_ram_zap(struct persistent_ram_zone *prz) -{ -} -#else void persistent_ram_zap(struct persistent_ram_zone *prz) { prz->buffer->start = 0; prz->buffer->size = 0; persistent_ram_update_header_ecc(prz); } -#endif /* CONFIG_PSTORE_RAMOOPS_RO */ static int persistent_ram_buffer_map(phys_addr_t start, phys_addr_t size, struct persistent_ram_zone *prz, int memtype) -- cgit v1.2.3