summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2019-03-15 10:14:52 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-03-18 09:43:35 +0100
commitdc89bfe90223c12028d1f2c35d55564b7f46a326 (patch)
tree02331c958294f85fa30550a7ca58e4ba29a9413f
parentaf85a0f8864e5888406bb13c3e3f99c5770959ca (diff)
downloadbarebox-dc89bfe90223c12028d1f2c35d55564b7f46a326.tar.gz
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 <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--fs/pstore/ram.c2
-rw-r--r--fs/pstore/ram_core.c6
2 files changed, 2 insertions, 6 deletions
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 3daec0d..734d0c3 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 0f7003f..06be47c 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)