[Skiboot] [PATCH] libflash/blocklevel: Allow double ecc protecting a region

Stewart Smith stewart at linux.vnet.ibm.com
Tue Jul 12 17:39:36 AEST 2016

Cyril Bur <cyril.bur at au1.ibm.com> writes:
> 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.
> Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
> ---
> Fixes issue exposed by Alistairs patch: 74ba834 ("flash: Use
> blocklevel to do ECC reads")

Thanks, 74ba834 reapplied and this patch also applied to master as of

Stewart Smith
OPAL Architect, IBM.

More information about the Skiboot mailing list