On Wed, May 16, 2012 at 5:43 AM, Anton Vorontsov anton.vorontsov@linaro.org wrote:
This is a first step for adding ECC support for pstore RAM backend: we will use the persistent_ram routines, kindly provided by Google.
Basically, persistent_ram is a set of helper routines to deal with the [optionally] ECC-protected persistent ram regions.
...
+static int persistent_ram_init_ecc(struct persistent_ram_zone *prz,
- size_t buffer_size)
+{
- int numerr;
- struct persistent_ram_buffer *buffer = prz->buffer;
- int ecc_blocks;
- if (!prz->ecc)
- return 0;
- prz->ecc_block_size = 128;
- prz->ecc_size = 16;
I realize you are just moving code here, but 16 ecc bytes for per 128 bytes of data can only correct 8 bad bytes, which is not always sufficient. At some point this will need to be made configurable again.