pstore/ram: Add ramoops support for the Flattened Device Tree.
Subsystems (3)
PATCH v6 1/1 pstore/ram: Add ramoops support for the Flattened Device Tree.
When called with a non-zero of_node, fill out a new ramoops_platform_data with data from the specified Flattened Device Tree node. Update ramoops documentation with the new FDT interface. Update devicetree/binding documentation with pstore/ramoops.txt.
---
I did not see any tree activity since I sent PATCH v5 on 6/26. So I cleaned up the code a bit and added support for the new console and ftrace logs as well.
bryan.
.../devicetree/bindings/pstore/ramoops.txt | 30 ++++++++++++ Documentation/ramoops.txt | 7 ++- fs/pstore/ram.c | 47 ++++++++++++++++++++ 3 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/pstore/ramoops.txt
Documentation/devicetree/bindings/pstore/ramoops.txt new file +30 -0
@@ -0,0 +1,30 @@ +Ramoops oops/panic/console logger + +Required properties: +- compatible: Must be "ramoops". +- reg: Specifies the base physical address and size of preserved memory. + +Optional properties: +- record-size: Specifies the size of each record in preserved memory. +- console-size: Specifies the size of the console log. +- ftrace-size: Specifies the size of the ftrace log. +- ecc-size: Specifies the size of each record's ECC buffer. +- dump-oops: Specifies to dump oops in addition to panics. + +Example: + +ramoops { + compatible = "ramoops"; + reg = <0x41f00000 0x00100000>; + record-size = <0x00020000>; + ftrace-size = <0x00020000>; + dump-oops; +}; +The "reg = <0x41f00000 0x00100000>" line specifies a preserved memory +size of 1MB at physical address 0x41f00000. +The "record-size = <0x00020000>" line specifies a record size of 128KB. +The "ftrace-size = <0x00020000>" line specifies an ftrace log size of 128KB. +The optional "dump-oops" line tells ramoops to dump oopses as well as panics. +At least one of record, console, or ftrace size must be specified. +In this example, 128KB is allocated to the ftrace log, and 896KB +(1024KB - 128KB) is allocated to oops and panic records.
Documentation/ramoops.txt +5 -2
@@ -3,7 +3,7 @@ Ramoops oops/panic logger Sergiu Iordache <[email protected]> -Updated: 17 November 2011 +Updated: 5 June 2012 0. Introduction
@@ -37,7 +37,7 @@ corrupt, but usually it is restorable. 2. Setting the parameters -Setting the ramoops parameters can be done in 2 different manners: +Setting the ramoops parameters can be done in 3 different manners: 1. Use the module parameters (which have the names of the variables described as before). For quick debugging, you can also reserve parts of memory during boot
@@ -84,6 +84,9 @@ very early in the architecture code, e.g.: memblock_reserve(ramoops_data.mem_address, ramoops_data.mem_size); + 3. Use the Flattened Device Tree to set the platform data. + This is described in devicetree/bindings/pstore/ramoops.txt. + 3. Dump format The data dump begins with a header, currently defined as "====" followed by a
fs/pstore/ram.c +47 -0
71 lines not on this page · raw message
Signature · 1 line
1.7.7.3
Quoted 4 lines · Bryan Freed
When called with a non-zero
of_node, fill out a newramoops_platform_datawith data from the specified Flattened Device Tree node. Update ramoops documentation with the new FDT interface. Update devicetree/binding documentation withpstore/ramoops.txt.
Thanks for your work, Bryan! There were a few issues, I fixed them myself but I need your confirmation if you're OK w/ all the changes.
First of, the Signed-off-by tag is missing, but I see it in v5. I also see that v5 had an Ack from Kees Cook, you did not preserve it, but generally it's a good idea to do so (if vX -> v(X+1) changes aren't drastic).
[...]
Quoted 6 lines
+Optional properties:
+- record-size: Specifies the size of each record in preserved memory. +- console-size: Specifies the size of the console log. +- ftrace-size: Specifies the size of the ftrace log. +- ecc-size: Specifies the size of each record's ECC buffer. +- dump-oops: Specifies to dump oops in addition to panics.
Personally, I don't see how this fits into device tree. It doesn't describe hardware, instead it's more a configuration stuff, which usually we try to not put into the device tree.
It would be better to have a sane defaults in ramoops, instead of introducing more "virtual" stuff in the device tree. That is, feel free to change defaults if they seem to be not enough for most your setups.
The only property that I see which is truly hardware-specific is ecc-size. E.g. if we're pretty sure that a specific hw does not need ecc, it's OK to avoid it. And some hw setups might require bigger ECC sizes, so it's OK to have it in the device-tree.
Quoted 2 lines
static struct
ramoops_platform_data*__initof_ramoops_platform_data(struct device *dev)
You call this function from __devinit section, so using __init is an error.
WARNING: fs/pstore/ramoops.o(.devinit.text+0x37): Section mismatch in reference from the function ramoops_probe() to the function .init.text:of_ramoops_platform_data() The function __devinit ramoops_probe() references
I changed this to __devnit.
[...]
Review
Quoted 2 lines
(quoted diff) +2
-0+ pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (pdata == NULL)
I wonder why people prefer to not write !pdata, which is more natural when reading the code.. :-)
[...]
Review
Quoted 2 lines
(quoted diff) +2
-0+#else +#define of_ramoops_platform_data(dev) NULL
Using static inline would be better, i.e. type-safe.
Quoted 1 line
+ .of_match_table =
of_match_ptr(ramoops_of_match),
This fails to build:
fs/pstore/ram.c: At top level:fs/pstore/ram.c:540:22: error: ‘ramoops_of_match’ undeclared here (not in a function)
For some reason you lost ramoops_of_match hunk from the v5.
So I made these changes on top of your patch (note, there's more text at the end of the email):
- - - -
Documentation/devicetree/bindings/pstore/ramoops.txt +1 -14
@@ -1,30 +1,17 @@ -Ramoops oops/panic/console logger +Ramoops oops/panic/console/trace logger Required properties: - compatible: Must be "ramoops". - reg: Specifies the base physical address and size of preserved memory. Optional properties: -- record-size: Specifies the size of each record in preserved memory. -- console-size: Specifies the size of the console log. -- ftrace-size: Specifies the size of the ftrace log. - ecc-size: Specifies the size of each record's ECC buffer. -- dump-oops: Specifies to dump oops in addition to panics. Example: ramoops { compatible = "ramoops"; reg = <0x41f00000 0x00100000>; - record-size = <0x00020000>; - ftrace-size = <0x00020000>; - dump-oops; }; The "reg = <0x41f00000 0x00100000>" line specifies a preserved memory size of 1MB at physical address 0x41f00000. -The "record-size = <0x00020000>" line specifies a record size of 128KB. -The "ftrace-size = <0x00020000>" line specifies an ftrace log size of 128KB. -The optional "dump-oops" line tells ramoops to dump oopses as well as panics. -At least one of record, console, or ftrace size must be specified. -In this example, 128KB is allocated to the ftrace log, and 896KB -(1024KB - 128KB) is allocated to oops and panic records.
Documentation/ramoops.txt +1 -1
@@ -3,7 +3,7 @@ Ramoops oops/panic logger Sergiu Iordache <[email protected]> -Updated: 5 June 2012 +Updated: 7 September 2012 0. Introduction
fs/pstore/ram.c +21 -12
@@ -25,6 +25,7 @@#include <linux/kernel.h> #include <linux/err.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/version.h> #include <linux/pstore.h> #include <linux/time.h>
@@ -34,6 +35,7 @@#include <linux/slab.h> #include <linux/compiler.h> #include <linux/pstore_ram.h> +#include <linux/of.h> #include <linux/of_address.h> #define RAMOOPS_KERNMSG_HDR "===="
@@ -354,7 +356,8 @@ static int ramoops_init_prz(struct device *dev, struct ramoops_context *cxt, }#ifdef CONFIG_OF -static struct ramoops_platform_data *__init + +static struct ramoops_platform_data *__devinit of_ramoops_platform_data (struct device *dev) {struct device_node *node = dev->of_node;
@@ -364,30 +367,36 @@ of_ramoops_platform_data(struct device *dev)u32 val; pdata =devm_kzalloc (dev,sizeof (*pdata),GFP_KERNEL ); -if (pdata ==NULL ) +if (!pdata)return NULL ; addrp =of_get_address (node,0 , &size,NULL ); -if (addrp ==NULL ) +if (!addrp)return NULL ; + pdata->mem_address =of_translate_address (node, addrp); pdata->mem_size = size; -if (!of_property_read_u32 (node,"record-size" , &val)) - pdata->record_size = val; -if (!of_property_read_u32 (node,"console-size" , &val)) - pdata->console_size = val; -if (!of_property_read_u32 (node,"ftrace-size" , &val)) - pdata->ftrace_size = val; + pdata->record_size = record_size; + pdata->console_size = ramoops_console_size; + pdata->ftrace_size = ramoops_ftrace_size; + pdata->dump_oops = dump_oops; +if (!of_property_read_u32 (node,"ecc-size" , &val)) pdata->ecc_size = val; -if (of_get_property (node,"dump-oops" ,NULL )) - pdata->dump_oops =1 ; return pdata; } + +static const struct of_device_id ramoops_of_match[] = { + { .compatible ="ramoops" , }, + { }, +}; +MODULE_DEVICE_TABLE (of, ramoops_of_match); +#else -#define of_ramoops_platform_data (dev) NULL +static inline struct ramoops_platform_data * +of_ramoops_platform_data (struct device *dev) {return NULL ; }#endif static int __devinit ramoops_probe (struct platform_device *pdev)
- - - -
So, the resulting patch is down below. But I have not pushed it out yet, I'm waiting for your sign off. If you're OK with the changes, please reply with
'Signed-off-by: Bryan Freed <[email protected]>'
Thanks!
- - - -
From: Bryan Freed <[email protected]>
Subject: pstore/ram: Add ramoops support for the Flattened Device Tree
When called with a non-zero of_node, fill out a new ramoops_platform_data with data from the specified Flattened Device Tree node. Update ramoops documentation with the new FDT interface. Update devicetree/binding documentation with pstore/ramoops.txt.
--- .../devicetree/bindings/pstore/ramoops.txt | 17 +++++++ Documentation/ramoops.txt | 7 ++- fs/pstore/ram.c | 56 ++++++++++++++++++++++ 3 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/pstore/ramoops.txt
Documentation/devicetree/bindings/pstore/ramoops.txt new file +17 -0
@@ -0,0 +1,17 @@ +Ramoops oops/panic/console/trace logger + +Required properties: +- compatible: Must be "ramoops". +- reg: Specifies the base physical address and size of preserved memory. + +Optional properties: +- ecc-size: Specifies the size of each record's ECC buffer. + +Example: + +ramoops { + compatible = "ramoops"; + reg = <0x41f00000 0x00100000>; +}; +The "reg = <0x41f00000 0x00100000>" line specifies a preserved memory +size of 1MB at physical address 0x41f00000.
Documentation/ramoops.txt +5 -2
@@ -3,7 +3,7 @@ Ramoops oops/panic logger Sergiu Iordache <[email protected]> -Updated: 17 November 2011 +Updated: 7 September 2012 0. Introduction
@@ -37,7 +37,7 @@ corrupt, but usually it is restorable. 2. Setting the parameters -Setting the ramoops parameters can be done in 2 different manners: +Setting the ramoops parameters can be done in 3 different manners: 1. Use the module parameters (which have the names of the variables described as before). For quick debugging, you can also reserve parts of memory during boot
@@ -84,6 +84,9 @@ very early in the architecture code, e.g.: memblock_reserve(ramoops_data.mem_address, ramoops_data.mem_size); + 3. Use the Flattened Device Tree to set the platform data. + This is described in devicetree/bindings/pstore/ramoops.txt. + 3. Dump format The data dump begins with a header, currently defined as "====" followed by a
fs/pstore/ram.c +56 -0
86 lines not on this page · raw message
Signature · 6 lines
1.7.11.5 _______________________________________________ devicetree-discuss mailing list [email protected] https://lists.ozlabs.org/listinfo/devicetree-discuss
Il 08/09/2012 07:29, Anton Vorontsov ha scritto:
Quoted 46 lines · Bryan Freed
Quoted 4 lines
When called with a non-zero
of_node, fill out a newramoops_platform_datawith data from the specified Flattened Device Tree node. Update ramoops documentation with the new FDT interface. Update devicetree/binding documentation withpstore/ramoops.txt.Thanks for your work, Bryan! There were a few issues, I fixed them myself but I need your confirmation if you're OK w/ all the changes.
First of, the Signed-off-by tag is missing, but I see it in v5. I also see that v5 had an Ack from Kees Cook, you did not preserve it, but generally it's a good idea to do so (if vX -> v(X+1) changes aren't drastic).
[...]
Quoted 6 lines
+Optional properties:
+- record-size: Specifies the size of each record in preserved memory. +- console-size: Specifies the size of the console log. +- ftrace-size: Specifies the size of the ftrace log. +- ecc-size: Specifies the size of each record's ECC buffer. +- dump-oops: Specifies to dump oops in addition to panics.Personally, I don't see how this fits into device tree. It doesn't describe hardware, instead it's more a configuration stuff, which usually we try to not put into the device tree.
It would be better to have a sane defaults in ramoops, instead of introducing more "virtual" stuff in the device tree. That is, feel free to change defaults if they seem to be not enough for most your setups.
The only property that I see which is truly hardware-specific is ecc-size. E.g. if we're pretty sure that a specific hw does not need ecc, it's OK to avoid it. And some hw setups might require bigger ECC sizes, so it's OK to have it in the device-tree.
Quoted 2 lines
static struct
ramoops_platform_data*__initof_ramoops_platform_data(struct device *dev)You call this function from
__devinitsection, so using__initis an error.WARNING: fs/pstore/ramoops.o(.devinit.text+0x37): Section mismatch in reference from the function
ramoops_probe()to the function .init.text:of_ramoops_platform_data() The function__devinitramoops_probe()references
Quoted 9 lines
I changed this to
__devnit.[...]
Review
Quoted 2 lines
(quoted diff) +2
-0+ pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (pdata == NULL)I wonder why people prefer to not write !pdata, which is more natural when reading the code.. :-)
I think it's the same for sizeof, it's much more readable sizeof(struct ramoops_platform_data).
Marco
On Sat, Sep 08, 2012 at 09:23:40AM +0200, Marco Stornelli wrote: [...]
Quoted 8 lines
Quoted 5 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (pdata == NULL)I wonder why people prefer to not write !pdata, which is more natural when reading the code.. :-)
I think it's the same for sizeof, it's much more readable
sizeof(struct ramoops_platform_data).
Well, sizeof(struct...) is against Linux coding style. And there are good reasons for this rule, it's all in the CodingStyle file. Thus, it's not about personal preferences. But speaking of personal preferences, I don't find sizeof(struct...) more readable. :-)
Thanks!
Anton.
Il 08/09/2012 10:06, Anton Vorontsov ha scritto:
Quoted 10 lines
On Sat, Sep 08, 2012 at 09:23:40AM +0200, Marco Stornelli wrote: [...]
Quoted 8 lines
Quoted 5 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (pdata == NULL)I wonder why people prefer to not write !pdata, which is more natural when reading the code.. :-)
I think it's the same for sizeof, it's much more readable
sizeof(struct ramoops_platform_data).
Quoted 8 lines
Well, sizeof(struct...) is against Linux coding style. And there are good reasons for this rule, it's all in the CodingStyle file. Thus, it's not about personal preferences. But speaking of personal preferences, I don't find sizeof(struct...) more readable. :-)
Thanks!
Anton.
Yes, I know, but indeed it's only a personal preference as the check ==NULL instead of !pdata. :)
Marco
Quoted 9 lines · Anton Vorontsov
Quoted 4 lines · Bryan Freed
When called with a non-zero
of_node, fill out a newramoops_platform_datawith data from the specified Flattened Device Tree node. Update ramoops documentation with the new FDT interface. Update devicetree/binding documentation withpstore/ramoops.txt.Thanks for your work, Bryan! There were a few issues, I fixed them myself but I need your confirmation if you're OK w/ all the changes.
[...]
Quoted 4 lines
So, the resulting patch is down below. But I have not pushed
it out yet, I'm waiting for your sign off. If you're OK with the changes, please reply with
'Signed-off-by: Bryan Freed <[email protected]>'
Bryan, have you had a chance to look into this?
Thanks,
Anton.
Quoted 10 lines · Anton Vorontsov
Quoted 9 lines · Anton Vorontsov
Quoted 4 lines · Bryan Freed
When called with a non-zero
of_node, fill out a newramoops_platform_datawith data from the specified Flattened Device Tree node. Update ramoops documentation with the new FDT interface. Update devicetree/binding documentation withpstore/ramoops.txt.Thanks for your work, Bryan! There were a few issues, I fixed them myself but I need your confirmation if you're OK w/ all the changes.
Quoted 7 lines
[...]
Quoted 4 lines
So, the resulting patch is down below. But I have not pushed it out yet, I'm waiting for your sign off. If you're OK with the changes, please reply with
'Signed-off-by: Bryan Freed <[email protected]>'Bryan, have you had a chance to look into this?
Whatever happened to this? Olof was also looking at doing a binding back in Jan 2012:
http://www.mail-archive.com/[email protected]/msg09905.html
Rob
Quoted 17 lines · Rob Herring
Quoted 16 lines · Anton Vorontsov
Quoted 9 lines · Anton Vorontsov
Quoted 4 lines · Bryan Freed
When called with a non-zero
of_node, fill out a newramoops_platform_datawith data from the specified Flattened Device Tree node. Update ramoops documentation with the new FDT interface. Update devicetree/binding documentation withpstore/ramoops.txt.Thanks for your work, Bryan! There were a few issues, I fixed them myself but I need your confirmation if you're OK w/ all the changes.
[...]
Quoted 4 lines
So, the resulting patch is down below. But I have not pushed it out yet, I'm waiting for your sign off. If you're OK with the changes, please reply with
'Signed-off-by: Bryan Freed <[email protected]>'
Quoted 6 lines
Quoted 1 line
Bryan, have you had a chance to look into this?
Whatever happened to this? Olof was also looking at doing a binding back in Jan 2012:
I don't know. Bryan's patch looked good, I'd happily apply it. But I still need Bryan's Signed-off-by tag. :-/ Or, somebody needs to sign off on his behalf (anyone from Chromium project?). Or redo the patch.
Thanks,
Anton
Sorry for dropping the ball on this one, Anton.
Thank you for your feedback and modifications in the code. I gotta ask, however, why do you completely remove key ramoops fields like record_size and ftrace_size?
Quoted 9 lines
From your 9/7/2012 comments (again, sorry for the delay in getting back to you):
Personally, I don't see how this fits into device tree. It doesn't describe hardware, instead it's more a configuration stuff, which usually we try to not put into the device tree.It would be better to have a sane defaults in ramoops, instead of introducing more "virtual" stuff in the device tree. That is, feel free to change defaults if they seem to be not enough for most your setups.
So there are only two alternatives I can see to set these fields.
1. Pass kernel command line parameters, or
2. Modify the defaults in ram.c.
Neither of these alternatives is particularly clean to me. The first is shunned to avoid clutter on the command line.
And the second requires us to maintain our own version of ram.c or push our defaults on the rest of the community.
We (ok, maybe just 'I') prefer to keep our device specific values in the device tree, even though it is not strictly defining hardware in the system.
What do you think of at least keeping the record_size, console_size and ftrace_size fields as optional in the ramoops device tree specification?
And as a more general question, why should we try not to put configuration in the device tree? It seems like a great (and portable) place to put this stuff.
It certainly seems better to have it there than hardwired in the kernel or tacked onto the kernel command line.
Thanks,
bryan.
Quoted 32 lines · Anton Vorontsov
Quoted 17 lines · Rob Herring
Quoted 16 lines · Anton Vorontsov
Quoted 9 lines · Anton Vorontsov
Quoted 4 lines · Bryan Freed
When called with a non-zero
of_node, fill out a newramoops_platform_datawith data from the specified Flattened Device Tree node. Update ramoops documentation with the new FDT interface. Update devicetree/binding documentation withpstore/ramoops.txt.Thanks for your work, Bryan! There were a few issues, I fixed them myself but I need your confirmation if you're OK w/ all the changes.
[...]
Quoted 4 lines
So, the resulting patch is down below. But I have not pushed it out yet, I'm waiting for your sign off. If you're OK with the changes, please reply with
'Signed-off-by: Bryan Freed <[email protected]>'Quoted 6 lines
Quoted 1 line
Bryan, have you had a chance to look into this?
Whatever happened to this? Olof was also looking at doing a binding back in Jan 2012:
I don't know. Bryan's patch looked good, I'd happily apply it. But I still need Bryan's Signed-off-by tag. :-/ Or, somebody needs to sign off on his behalf (anyone from Chromium project?). Or redo the patch.
Thanks,
Anton
Quoted 32 lines · Bryan Freed
Sorry for dropping the ball on this one, Anton.
Thank you for your feedback and modifications in the code. I gotta ask, however, why do you completely remove key ramoops fields like
record_sizeandftrace_size?From your 9/7/2012 comments (again, sorry for the delay in getting back to you):
Quoted 8 lines
Personally, I don't see how this fits into device tree. It doesn't describe hardware, instead it's more a configuration stuff, which usually we try to not put into the device tree.
It would be better to have a sane defaults in ramoops, instead of introducing more "virtual" stuff in the device tree. That is, feel free to change defaults if they seem to be not enough for most your setups.
So there are only two alternatives I can see to set these fields.
1. Pass kernel command line parameters, or
2. Modify the defaults inram.c.Neither of these alternatives is particularly clean to me. The first is shunned to avoid clutter on the command line.
And the second requires us to maintain our own version ofram.cor push our defaults on the rest of the community.We (ok, maybe just 'I') prefer to keep our device specific values in the device tree, even though it is not strictly defining hardware in the system.
What do you think of at least keeping therecord_size,console_sizeandftrace_sizefields as optional in the ramoops device tree specification?
Quoted 5 lines
And as a more general question, why should we try not to put configuration in the device tree? It seems like a great (and portable) place to put this stuff.
It certainly seems better to have it there than hardwired in the kernel or tacked onto the kernel command line.
You have to account for the fact that you may not be able to update the dtb which may be part of firmware. I can imagine you might want to change some of the sizes frequently based on what you are doing and trying to capture. So even if you put in the DT, you need some easy way to override the settings. This could always be fixed-up by the bootloader which is what is done for things we don't expect the firmware to know like initrd address/size and kernel command line. This is why the prior discussion I mentioned below suggested putting all this in the /chosen node.
Rob
Quoted 38 lines
Thanks,
bryan.
Quoted 32 lines · Anton Vorontsov
Quoted 17 lines · Rob Herring
Quoted 16 lines · Anton Vorontsov
Quoted 9 lines · Anton Vorontsov
Quoted 4 lines · Bryan Freed
When called with a non-zero
of_node, fill out a newramoops_platform_datawith data from the specified Flattened Device Tree node. Update ramoops documentation with the new FDT interface. Update devicetree/binding documentation withpstore/ramoops.txt.Thanks for your work, Bryan! There were a few issues, I fixed them myself but I need your confirmation if you're OK w/ all the changes.
[...]
Quoted 4 lines
So, the resulting patch is down below. But I have not pushed it out yet, I'm waiting for your sign off. If you're OK with the changes, please reply with
'Signed-off-by: Bryan Freed <[email protected]>'Quoted 6 lines
Quoted 1 line
Bryan, have you had a chance to look into this?
Whatever happened to this? Olof was also looking at doing a binding back in Jan 2012:
I don't know. Bryan's patch looked good, I'd happily apply it. But I still need Bryan's Signed-off-by tag. :-/ Or, somebody needs to sign off on his behalf (anyone from Chromium project?). Or redo the patch.
Thanks,
Anton
On Mon, Apr 08, 2013 at 12:54:01PM -0700, Bryan Freed wrote:
[...]
Quoted 5 lines
And as a more general question, why should we try not to put configuration in the device tree? It seems like a great (and portable) place to put this stuff.
It certainly seems better to have it there than hardwired in the kernel or tacked onto the kernel command line.
But then we have two in-kernel APIs to pass kernel parameters? So we'll have to maintain two ways of passing the options for each driver. That is hardly a good solution.
If you would like to see a convenient way to pass kernel/module options via the device tree, I would suggest implementing something like this:
chosen {
kernel-options {
linux,pstore.record-size = 123;
linux,foo = "bar";
};
};And then let the kernel translate all these to module_param_*().
I am still not sure about placing the options along with devices layout, but if we go this route, then that is also viable:
pstore-node {
linux,pstore.record-size = 123;
};And translate "linux,*" this to module_param_*().
How does that sound?
Thanks,
Anton
[thread necromancy, if you don't have the thread locally, it's here:
https://patchwork.kernel.org/patch/1426261/]
We still need to solve this, and John pinged me about it today. Where does this stand?
-Kees
Quoted 37 lines · Anton Vorontsov
On Mon, Apr 08, 2013 at 12:54:01PM -0700, Bryan Freed wrote:
[...]Quoted 5 lines
And as a more general question, why should we try not to put configuration in the device tree? It seems like a great (and portable) place to put this stuff.
It certainly seems better to have it there than hardwired in the kernel or tacked onto the kernel command line.But then we have two in-kernel APIs to pass kernel parameters? So we'll have to maintain two ways of passing the options for each driver. That is hardly a good solution.
If you would like to see a convenient way to pass kernel/module options via the device tree, I would suggest implementing something like this:
chosen { kernel-options { linux,pstore.record-size = 123; linux,foo = "bar"; }; };And then let the kernel translate all these to module_param_*().
I am still not sure about placing the options along with devices layout, but if we go this route, then that is also viable:
pstore-node { linux,pstore.record-size = 123; };And translate "linux,*" this to module_param_*().
How does that sound?
Thanks,
Anton
Signature · 2 lines
Kees Cook Chrome OS & Brillo Security
[fixing devicetree mailing list]
Quoted 53 lines · Kees Cook
[thread necromancy, if you don't have the thread locally, it's here:
https://patchwork.kernel.org/patch/1426261/]We still need to solve this, and John pinged me about it today. Where does this stand?
-Kees
Quoted 31 lines · Anton Vorontsov
On Mon, Apr 08, 2013 at 12:54:01PM -0700, Bryan Freed wrote:
[...]Quoted 5 lines
And as a more general question, why should we try not to put configuration in the device tree? It seems like a great (and portable) place to put this stuff.
It certainly seems better to have it there than hardwired in the kernel or tacked onto the kernel command line.But then we have two in-kernel APIs to pass kernel parameters? So we'll have to maintain two ways of passing the options for each driver. That is hardly a good solution.
If you would like to see a convenient way to pass kernel/module options via the device tree, I would suggest implementing something like this:
chosen { kernel-options { linux,pstore.record-size = 123; linux,foo = "bar"; }; };And then let the kernel translate all these to module_param_*().
I am still not sure about placing the options along with devices layout, but if we go this route, then that is also viable:
pstore-node { linux,pstore.record-size = 123; };Quoted 6 lines
And translate "linux,*" this to module_param_*().
How does that sound?
Thanks,
Anton--
Kees Cook
Chrome OS & Brillo Security
Signature · 6 lines
Kees Cook Chrome OS & Brillo Security -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
+Greg H
Quoted 8 lines · Kees Cook
[fixing devicetree mailing list]
Quoted 5 lines · Kees Cook
[thread necromancy, if you don't have the thread locally, it's here:
https://patchwork.kernel.org/patch/1426261/]We still need to solve this, and John pinged me about it today. Where does this stand?
Wrong thread here as the latest version is "[PATCH v2] pstore-ram: add Device Tree bindings" recently posted by Greg H (and reviewed by you). I am mostly happy with it and only had a minor comment remaining. I was expecting to see a v3.
Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html