Merge linux-3.10.67 into dev-kernel-3.10
[linux-3.10.git] / fs / pstore / ram.c
index ad6737b..cf5da2a 100644 (file)
@@ -66,6 +66,11 @@ module_param(mem_size, ulong, 0400);
 MODULE_PARM_DESC(mem_size,
                "size of reserved RAM used to store oops/panic logs");
 
+static unsigned int mem_type;
+module_param(mem_type, uint, 0600);
+MODULE_PARM_DESC(mem_type,
+               "set to 1 to try to use unbuffered memory (default 0)");
+
 static int dump_oops = 1;
 module_param(dump_oops, int, 0600);
 MODULE_PARM_DESC(dump_oops,
@@ -85,6 +90,7 @@ struct ramoops_context {
        struct persistent_ram_zone *rprz;
        phys_addr_t phys_addr;
        unsigned long size;
+       unsigned int memtype;
        size_t record_size;
        size_t console_size;
        size_t ftrace_size;
@@ -379,7 +385,8 @@ static int ramoops_init_przs(struct device *dev, struct ramoops_context *cxt,
                size_t sz = cxt->record_size;
 
                cxt->przs[i] = persistent_ram_new(*paddr, sz, 0,
-                                                 &cxt->ecc_info);
+                                                 &cxt->ecc_info,
+                                                 cxt->memtype);
                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",
@@ -413,7 +420,7 @@ static int ramoops_init_prz(struct device *dev, struct ramoops_context *cxt,
                return -ENOMEM;
        }
 
-       *prz = persistent_ram_new(*paddr, sz, sig, &cxt->ecc_info);
+       *prz = persistent_ram_new(*paddr, sz, sig, &cxt->ecc_info, cxt->memtype);
        if (IS_ERR(*prz)) {
                int err = PTR_ERR(*prz);
 
@@ -484,6 +491,7 @@ static int ramoops_probe(struct platform_device *pdev)
 
        cxt->size = pdata->mem_size;
        cxt->phys_addr = pdata->mem_address;
+       cxt->memtype = pdata->mem_type;
        cxt->record_size = pdata->record_size;
        cxt->console_size = pdata->console_size;
        cxt->ftrace_size = pdata->ftrace_size;
@@ -626,6 +634,7 @@ static void ramoops_register_dummy(void)
 
        dummy_data->mem_size = mem_size;
        dummy_data->mem_address = mem_address;
+       dummy_data->mem_type = 0;
        dummy_data->record_size = record_size;
        dummy_data->console_size = ramoops_console_size;
        dummy_data->ftrace_size = ramoops_ftrace_size;