• Anatolij Gustschin's avatar
    mtd: add writebufsize field to mtd_info struct · 0e4ca7e5
    Anatolij Gustschin authored
    This field will be used to indicate the write buffer size
    of the MTD device. UBI will set it's minimal I/O unit size
    (min_io_size) to the indicated write buffer size. By this
    change we intend to fix failed recovery of UBIFS partitions
    we currently observe on NOR flash when mounting the partition
    after unclean unmount.
    
    Currently the min_io_size is set to mtd->writesize (which is 1
    byte for NOR flash). But flash programming is often done from
    prepared write buffer containing multiple bytes and is performed
    in one programming operation which could be interrupted by a power
    cut or a system reset causing corrupted (partially written) areas
    in a flash sector. Knowing the size of potentially corrupted areas
    UBIFS scanning and recovery algorithms are able to perform
    successful recovery.
    
    In case of NOR flash minimal I/O size must be equal to the
    maximal size of the write buffer used by embedded flash
    programming algorithm. In case of NAND flash mtd->writebufsize
    should be equivalent to mtd->writesize.
    
    The subsequent patches will add mtd->writebufsize initialization
    where needed.
    Signed-off-by: default avatarAnatolij Gustschin <agust@denx.de>
    Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
    Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
    0e4ca7e5
mtd.h 12.1 KB