[Skiboot] [PATCH v2 0/5] libflash/blocklevel erase features
Cyril Bur
cyril.bur at au1.ibm.com
Wed Apr 19 14:11:38 AEST 2017
Hello,
Currently libflash/blocklevel erase functionality checks to see if the
erase region is aligned to the erase mask of the backend. If the
condition isn't met blocklevel will refuse to allow the erase, this is
by design as backends provide no sanity guarantee here - although most
will likely just fail as well.
Until recently this hasn't been a problem as backends have always
supplied 4K erase blocks and the FFS structures which are most
commonly modified are 4k aligned.
Recently BMC kernel MTD backends have been exposing 64K erase blocks
which had not gone well with the 4K aligned FFS partitions. This has
resulted in pflash being unable to flash specific partitions or the
gard tool being unable to clear records. Various bugs have been filed
on the matter - some which I can't link and most which I don't even
have access to myself.
Introducing blocklevel_smart_erase(), essentially just deals with with
the rmw problem of having to erase more than what will be written. The
great news is that this series comes with tests!
Version 2 adds patch 1/5. As I stated in my response to v1 - Sam was
hitting a problem with this series not working. It turns out the
series is fine but it exposed the fact that the 64bit erase ioctl
was never tested on AMI kernels - it simply doesn't exist.
This series will likely conflict with my ECC fixes - I'll happily
rebase whichever way Stewart/Mikey want to take these.
Cyril Bur (5):
libflash/file: Only use 64bit MTD erase ioctl() when needed
libflash/blocklevel: Add blocklevel_smart_erase()
libflash: Add tests for blocklevel_smart_erase()
external/gard: Use blocklevel_smart_erase()
external/pflash: Use blocklevel_smart_erase()
external/gard/gard.c | 2 +-
external/pflash/pflash.c | 31 +----
libflash/blocklevel.c | 134 +++++++++++++++++++++-
libflash/blocklevel.h | 10 +-
libflash/file.c | 35 +++++-
libflash/test/test-blocklevel.c | 245 +++++++++++++++++++++++++++++++++++++++-
6 files changed, 416 insertions(+), 41 deletions(-)
--
2.12.2
More information about the Skiboot
mailing list