summaryrefslogtreecommitdiff
path: root/fs/pstore
diff options
context:
space:
mode:
authorAnton Vorontsov <anton.vorontsov@linaro.org>2012-05-17 00:15:34 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-17 08:51:59 -0700
commit39eb7e9791866973dbb7a3a6d2061d70356c7d90 (patch)
treebfd4e74f43031fa0ae05636c215a3a60a7f5ae23 /fs/pstore
parent896fc1f0c4c6c19b270734f274be67cb0e8a24af (diff)
pstore/ram: Add ECC support
This is now straightforward: just introduce a module parameter and pass the needed value to persistent_ram_new(). Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Acked-by: Marco Stornelli <marco.stornelli@gmail.com> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/pstore')
-rw-r--r--fs/pstore/ram.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 62b13eda4691..9123cce28c1e 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -56,12 +56,18 @@ module_param(dump_oops, int, 0600);
MODULE_PARM_DESC(dump_oops,
"set to 1 to dump oopses, 0 to only dump panics (default 1)");
+static int ramoops_ecc;
+module_param_named(ecc, ramoops_ecc, int, 0600);
+MODULE_PARM_DESC(ramoops_ecc,
+ "set to 1 to enable ECC support");
+
struct ramoops_context {
struct persistent_ram_zone **przs;
phys_addr_t phys_addr;
unsigned long size;
size_t record_size;
int dump_oops;
+ bool ecc;
unsigned int count;
unsigned int max_count;
unsigned int read_count;
@@ -236,6 +242,7 @@ static int __init ramoops_probe(struct platform_device *pdev)
cxt->phys_addr = pdata->mem_address;
cxt->record_size = pdata->record_size;
cxt->dump_oops = pdata->dump_oops;
+ cxt->ecc = pdata->ecc;
cxt->przs = kzalloc(sizeof(*cxt->przs) * cxt->max_count, GFP_KERNEL);
if (!cxt->przs) {
@@ -248,7 +255,7 @@ static int __init ramoops_probe(struct platform_device *pdev)
size_t sz = cxt->record_size;
phys_addr_t start = cxt->phys_addr + sz * i;
- cxt->przs[i] = persistent_ram_new(start, sz, 0);
+ cxt->przs[i] = persistent_ram_new(start, sz, cxt->ecc);
if (IS_ERR(cxt->przs[i])) {
err = PTR_ERR(cxt->przs[i]);
dev_err(dev, "failed to request mem region (0x%zx@0x%llx): %d\n",
@@ -281,9 +288,10 @@ static int __init ramoops_probe(struct platform_device *pdev)
record_size = pdata->record_size;
dump_oops = pdata->dump_oops;
- pr_info("attached 0x%lx@0x%llx (%ux0x%zx)\n",
+ pr_info("attached 0x%lx@0x%llx (%ux0x%zx), ecc: %s\n",
cxt->size, (unsigned long long)cxt->phys_addr,
- cxt->max_count, cxt->record_size);
+ cxt->max_count, cxt->record_size,
+ ramoops_ecc ? "on" : "off");
return 0;
@@ -347,6 +355,7 @@ static int __init ramoops_init(void)
dummy_data->mem_address = mem_address;
dummy_data->record_size = record_size;
dummy_data->dump_oops = dump_oops;
+ dummy_data->ecc = ramoops_ecc;
dummy = platform_create_bundle(&ramoops_driver, ramoops_probe,
NULL, 0, dummy_data,
sizeof(struct ramoops_platform_data));