UBI: use mtd->writebufsize to set minimal I/O unit size
authorAnatolij Gustschin <agust@denx.de>
Thu, 16 Dec 2010 22:42:19 +0000 (23:42 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 6 Jan 2011 15:36:00 +0000 (15:36 +0000)
commita121f643993474548fe98144514c50dd4f3dbe76
tree184d54ebdbd62977ed4d672058293638fe2e0b2a
parent7fa33ac0a7e24a1b8bd71be5c47a17423c62fbda
UBI: use mtd->writebufsize to set minimal I/O unit size

Previously we used mtd->writesize field to set UBI's minimal
I/O unit size. This sometimes caused UBIFS recovery issues
when mounting an uncleanly unmounted UBIFS partition on NOR
flash since mtd->writesize is 1 byte for NOR flash. The
MTD CFI driver however often performs writing multiple
bytes in one programming operation using the chip's write
buffer. We have to use the size of this write buffer as
a minimal I/O unit size for UBI on NOR flash to fix the
observed UBIFS recovery issues.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/ubi/build.c