diff options
author | Cyril Bur <cyril.bur@au1.ibm.com> | 2016-07-26 13:49:33 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-10-11 14:42:23 +1100 |
commit | a452b83cd9eac584073fa19eb76e133de913ef52 (patch) | |
tree | a139c62b3069019f0847f267093a7d622d68d6ac /libflash/libffs.c | |
parent | 5093ea33209a8b72ca43f1b1eac08629f060a634 (diff) | |
download | skiboot-a452b83cd9eac584073fa19eb76e133de913ef52.zip skiboot-a452b83cd9eac584073fa19eb76e133de913ef52.tar.gz skiboot-a452b83cd9eac584073fa19eb76e133de913ef52.tar.bz2 |
libflash/blocklevel: Allow double ecc protecting a region
Currently the policy for calling ECC protecting a range at the
blocklevel layer is that the requested region be completely
unprotected otherwise the call will return an error. It turns out that
duplicate calls to ffs_init() with true as the last parameter (for the
same blocklevel structure) will cause duplicate attempts to
ecc_protect() ranges.
Change the policy within blocklevel to allow duplicate protecting.
In fact the new policy almost guarantees no failure (baring something
odd like malloc() failing). It will detect that the range is currently
already fully protected and do nothing, detect that part of the range
is or is not and extend the existing range or detect that a range fits
perfectly between two ranges in which case it will merge the ranges.
Also adjust tests to match the new policy.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libflash/libffs.c')
-rw-r--r-- | libflash/libffs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libflash/libffs.c b/libflash/libffs.c index 8b1c2a7..0fda97d 100644 --- a/libflash/libffs.c +++ b/libflash/libffs.c @@ -196,7 +196,7 @@ int ffs_init(uint32_t offset, uint32_t max_size, struct blocklevel_device *bl, if (ecc) { rc = blocklevel_ecc_protect(bl, start, total_size); if (rc) { - FL_ERR("Failed to blocklevel_ecc_protect(0x%08x, 0x%08x)\n", + FL_ERR("FFS: Failed to blocklevel_ecc_protect(0x%08x, 0x%08x)\n", start, total_size); goto out; } |