summaryrefslogtreecommitdiff
path: root/drivers/mtd/chips/cfi_cmdset_0020.c
diff options
context:
space:
mode:
authorAnatolij Gustschin <agust@denx.de>2011-02-10 18:01:46 +0300
committerDavid Woodhouse <David.Woodhouse@intel.com>2011-03-11 17:22:46 +0300
commit13ce77f46c79a3839e4c2ff9722c9416c165f498 (patch)
treedb584a38edc5478ffdd6326afbffddf7f9158dd5 /drivers/mtd/chips/cfi_cmdset_0020.c
parentd8f90b2c9d521500bcd4a1ecdcdb283bfdd2186f (diff)
downloadlinux-13ce77f46c79a3839e4c2ff9722c9416c165f498.tar.xz
mtd: cfi: fix writebufsize initialization
When initializing mtd->writebufsize, we must take into account possible flash chip interleaving. Wrong writebufsize initialization caused UBIFS recovery issues resulting in unmountable UBIFS file system on NOR flash partitions. Signed-off-by: Anatolij Gustschin <agust@denx.de> Acked-by: Guillaume LECERF <glecerf@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/chips/cfi_cmdset_0020.c')
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0020.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c
index c04b7658abe9..ed56ad3884fb 100644
--- a/drivers/mtd/chips/cfi_cmdset_0020.c
+++ b/drivers/mtd/chips/cfi_cmdset_0020.c
@@ -238,7 +238,7 @@ static struct mtd_info *cfi_staa_setup(struct map_info *map)
mtd->resume = cfi_staa_resume;
mtd->flags = MTD_CAP_NORFLASH & ~MTD_BIT_WRITEABLE;
mtd->writesize = 8; /* FIXME: Should be 0 for STMicro flashes w/out ECC */
- mtd->writebufsize = 1 << cfi->cfiq->MaxBufWriteSize;
+ mtd->writebufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
map->fldrv = &cfi_staa_chipdrv;
__module_get(THIS_MODULE);
mtd->name = map->name;