Skip to contentSkip to conversation

ramoops: make it possible to change mem_type param.

PATCH Superseded Wang Long 2 participants 3 messages Mar 27, 2015 – Mar 31, 2015 Pstore filesystem

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Wang Long

author
#0 lore raw

PATCH 1/1 ramoops: make it possible to change mem_type param.

If we set ramoops.mem_type=1 in command line, the current code can not change mem_type to 1, because it is assigned to 0 in function ramoops_register_dummy.

This patch make it possible to change mem_type parameter in command line.

---
 fs/pstore/ram.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/pstore/ram.c +2 -2
index 44a549b..65e0532 100644
@@ -65,7 +65,7 @@ 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;
+static unsigned int mem_type = 0;
 module_param(mem_type, uint, 0600);
 MODULE_PARM_DESC(mem_type,
 		"set to 1 to try to use unbuffered memory (default 0)");
@@ -608,7 +608,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->mem_type = mem_type;
 	dummy_data->record_size = record_size;
 	dummy_data->console_size = ramoops_console_size;
 	dummy_data->ftrace_size = ramoops_ftrace_size;
Signature · 1 line
1.8.3.4
Acked-by on v1 1/1
#1 lore raw
Quoted 18 lines · Wang Long

If we set ramoops.mem_type=1 in command line, the current code can not change mem_type to 1, because it is assigned to 0 in function ramoops_register_dummy.

This patch make it possible to change mem_type parameter in command line.

---
 fs/pstore/ram.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/pstore/ram.c +0 -0
index 44a549b..65e0532 100644

fs/pstore/ram.c module_param(mem_size, ulong, 0400); · line 71

Quoted 8 lines
fs/pstore/ram.c +1 -1
@@ -65,7 +65,7 @@ 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;
+static unsigned int mem_type = 0;
 module_param(mem_type, uint, 0600);
 MODULE_PARM_DESC(mem_type,
 		"set to 1 to try to use unbuffered memory (default 0)");

The BSS gets cleared during init so no need to initialize the mem_type separately here and you can drop the change above AFAIK.

fs/pstore/ram.c static void ramoops_register_dummy(void) · line 614

Quoted 9 lines
fs/pstore/ram.c +1 -1
@@ -608,7 +608,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->mem_type = mem_type;
 	dummy_data->record_size = record_size;
 	dummy_data->console_size = ramoops_console_size;
 	dummy_data->ftrace_size = ramoops_ftrace_size;

For this change sounds like a bug. Sorry I was not able to test that with the hardware I have here. Good thing you have been able to verify it with your hardware. If you drop the first part and repost, please also feel free to add:

#2 lore raw
Quoted 22 lines · Tony Lindgren
Quoted 21 lines · Wang Long

If we set ramoops.mem_type=1 in command line, the current code can not change mem_type to 1, because it is assigned to 0 in function ramoops_register_dummy.

This patch make it possible to change mem_type parameter in command line.

---
 fs/pstore/ram.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/pstore/ram.c +0 -0
index 44a549b..65e0532 100644
@@ -65,7 +65,7 @@ module_param(mem_size, ulong, 0400);
 MODULE_PARM_DESC(mem_size,
 		"size of reserved RAM used to store oops/panic logs");
 
Quoted 9 lines

fs/pstore/ram.c module_param(mem_size, ulong, 0400); · line 71

Quoted 5 lines
fs/pstore/ram.c +1 -1
-static unsigned int mem_type;
+static unsigned int mem_type = 0;
 module_param(mem_type, uint, 0600);
 MODULE_PARM_DESC(mem_type,
 		"set to 1 to try to use unbuffered memory (default 0)");

The BSS gets cleared during init so no need to initialize the mem_type separately here and you can drop the change above AFAIK.

OK, thanks.
i will drop this change.

Quoted 19 lines

fs/pstore/ram.c static void ramoops_register_dummy(void) · line 614

Quoted 9 lines
fs/pstore/ram.c +1 -1
@@ -608,7 +608,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->mem_type = mem_type;
 	dummy_data->record_size = record_size;
 	dummy_data->console_size = ramoops_console_size;
 	dummy_data->ftrace_size = ramoops_ftrace_size;

For this change sounds like a bug. Sorry I was not able to test that with the hardware I have here. Good thing you have been able to verify it with your hardware. If you drop the first part and repost, please also feel free to add:

.