diff mbox

[4/6] pstore/ram: Add some more documentation and examples

Message ID 20120516125658.GD20475@lizard
State New
Headers show

Commit Message

Anton Vorontsov May 16, 2012, 12:56 p.m. UTC
Suggested-by: Shuah Khan <shuahkhan@gmail.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
---
 Documentation/ramoops.txt |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Shuah Khan May 16, 2012, 3:28 p.m. UTC | #1
Hi Anton,

Ignore my previous email. I am still getting caught up with your
patches.

On Wed, 2012-05-16 at 05:56 -0700, Anton Vorontsov wrote:
> Suggested-by: Shuah Khan <shuahkhan@gmail.com>
> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
> ---
>  Documentation/ramoops.txt |   15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/Documentation/ramoops.txt b/Documentation/ramoops.txt
> index 4ba7db2..138823b 100644
> --- a/Documentation/ramoops.txt
> +++ b/Documentation/ramoops.txt
> @@ -40,6 +40,12 @@ corrupt, but usually it is restorable.
>  Setting the ramoops parameters can be done in 2 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
> + and then use the reserved memory for ramoops. For example, assuming a machine
> + with > 128 MB of memory, the following kernel command line will tell the
> + kernel to use only the first 128 MB of memory, and place ECC-protected ramoops
> + region at 128 MB boundary:
> + "mem=128M ramoops.mem_address=0x8000000 ramoops.ecc=1"
>   2. Use a platform device and set the platform data. The parameters can then
>   be set through that platform data. An example of doing that is:

Thanks much. This is great information to have. Exactly the detail I was
asking for.

>  
> @@ -70,6 +76,15 @@ if (ret) {
>  	return ret;
>  }
>  
> +You can specify either RAM memory or peripheral devices' memory. However, when
> +specifying RAM, be sure to reserve the memory by issuing memblock_reserve()
> +very early in the architecture code, just before platform device registration,
> +e.g.:
> +
> +#include <linux/memblock.h>
> +
> +memblock_reserve(ramoops_data.mem_address, ramoops_data.mem_size);

Same here. :)

-- Shuah
> +
>  3. Dump format
>  
>  The data dump begins with a header, currently defined as "====" followed by a
Colin Cross May 16, 2012, 5:56 p.m. UTC | #2
On Wed, May 16, 2012 at 5:56 AM, Anton Vorontsov
<anton.vorontsov@linaro.org> wrote:
> Suggested-by: Shuah Khan <shuahkhan@gmail.com>
> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
> ---
>  Documentation/ramoops.txt |   15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/Documentation/ramoops.txt b/Documentation/ramoops.txt
> index 4ba7db2..138823b 100644
> --- a/Documentation/ramoops.txt
> +++ b/Documentation/ramoops.txt
> @@ -40,6 +40,12 @@ corrupt, but usually it is restorable.
>  Setting the ramoops parameters can be done in 2 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
> + and then use the reserved memory for ramoops. For example, assuming a machine
> + with > 128 MB of memory, the following kernel command line will tell the
> + kernel to use only the first 128 MB of memory, and place ECC-protected ramoops
> + region at 128 MB boundary:
> + "mem=128M ramoops.mem_address=0x8000000 ramoops.ecc=1"
>  2. Use a platform device and set the platform data. The parameters can then
>  be set through that platform data. An example of doing that is:
>
> @@ -70,6 +76,15 @@ if (ret) {
>        return ret;
>  }
>
> +You can specify either RAM memory or peripheral devices' memory. However, when
> +specifying RAM, be sure to reserve the memory by issuing memblock_reserve()
> +very early in the architecture code, just before platform device registration,

Just before platform device registration is way too late.  ARM
provides a machine reserve callback to allow board files to call
memblock_reserve inside arm_memblock_init() and before mm_init().

> +e.g.:
> +
> +#include <linux/memblock.h>
> +
> +memblock_reserve(ramoops_data.mem_address, ramoops_data.mem_size);
> +
>  3. Dump format
>
>  The data dump begins with a header, currently defined as "====" followed by a
> --
> 1.7.9.2
>
Anton Vorontsov May 16, 2012, 10:11 p.m. UTC | #3
On Wed, May 16, 2012 at 10:56:09AM -0700, Colin Cross wrote:
[...]
> > +You can specify either RAM memory or peripheral devices' memory. However, when
> > +specifying RAM, be sure to reserve the memory by issuing memblock_reserve()
> > +very early in the architecture code, just before platform device registration,
> 
> Just before platform device registration is way too late.  ARM
> provides a machine reserve callback to allow board files to call
> memblock_reserve inside arm_memblock_init() and before mm_init().

Yeah, and I guess that 'too late' is also true for all architectures,
the platform_device_register and friends are most probably unusable
before mm_init, and after that it's always too late.

So the word 'just' is misleading indeed, I'll remove it.

Thanks!
Colin Cross May 16, 2012, 10:25 p.m. UTC | #4
On Wed, May 16, 2012 at 3:11 PM, Anton Vorontsov <cbouatmailru@gmail.com> wrote:
> On Wed, May 16, 2012 at 10:56:09AM -0700, Colin Cross wrote:
> [...]
>> > +You can specify either RAM memory or peripheral devices' memory. However, when
>> > +specifying RAM, be sure to reserve the memory by issuing memblock_reserve()
>> > +very early in the architecture code, just before platform device registration,
>>
>> Just before platform device registration is way too late.  ARM
>> provides a machine reserve callback to allow board files to call
>> memblock_reserve inside arm_memblock_init() and before mm_init().
>
> Yeah, and I guess that 'too late' is also true for all architectures,
> the platform_device_register and friends are most probably unusable
> before mm_init, and after that it's always too late.
>
> So the word 'just' is misleading indeed, I'll remove it.

I think any reference to the time when platform devices are registered
is misleading.  There is a very specific point during arch init where
memblock_reserve is valid, and it is nowhere near platform device
registration.
diff mbox

Patch

diff --git a/Documentation/ramoops.txt b/Documentation/ramoops.txt
index 4ba7db2..138823b 100644
--- a/Documentation/ramoops.txt
+++ b/Documentation/ramoops.txt
@@ -40,6 +40,12 @@  corrupt, but usually it is restorable.
 Setting the ramoops parameters can be done in 2 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
+ and then use the reserved memory for ramoops. For example, assuming a machine
+ with > 128 MB of memory, the following kernel command line will tell the
+ kernel to use only the first 128 MB of memory, and place ECC-protected ramoops
+ region at 128 MB boundary:
+ "mem=128M ramoops.mem_address=0x8000000 ramoops.ecc=1"
  2. Use a platform device and set the platform data. The parameters can then
  be set through that platform data. An example of doing that is:
 
@@ -70,6 +76,15 @@  if (ret) {
 	return ret;
 }
 
+You can specify either RAM memory or peripheral devices' memory. However, when
+specifying RAM, be sure to reserve the memory by issuing memblock_reserve()
+very early in the architecture code, just before platform device registration,
+e.g.:
+
+#include <linux/memblock.h>
+
+memblock_reserve(ramoops_data.mem_address, ramoops_data.mem_size);
+
 3. Dump format
 
 The data dump begins with a header, currently defined as "====" followed by a