diff options
author | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2012-08-24 13:29:23 +0200 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2012-08-24 13:29:23 +0200 |
commit | 2999454457840452d2610d457ba2b7ef1b775c90 (patch) | |
tree | b986438bc0d6954e8714840d99482f61c6fc2762 /drivers/mtd/devices | |
parent | 4dec0ae6f55768ba0acef97ff2c67f7d5d4663fe (diff) |
mtd: tegra: initialize writebufsize
Using UBI on tegra can give messages like:
root@colibri-t20:~# ubiattach -m 0
[ 115.218710] UBI: attaching mtd0 to ubi0
[ 115.229108] UBI error: io_init: bad write buffer size 0 for 4096 min. I/O unit
ubiattach: error!: cannot attach mtd0
error 22 (Invalid argument)
The writebufsize concept was introduce by commit
"0e4ca7e mtd: add writebufsize field to mtd_info struct" and it represents
the maximum amount of data the device writes to the media at a time. This is
an important parameter for UBIFS which is used during recovery and which
basically defines how big a corruption caused by a power cut can be.
Set writebufsize to the flash page size because it is the maximum amount of
data it writes at a time.
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r-- | drivers/mtd/devices/tegra_nand.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/devices/tegra_nand.c b/drivers/mtd/devices/tegra_nand.c index f8656ed6683c..92cd70f2fd46 100644 --- a/drivers/mtd/devices/tegra_nand.c +++ b/drivers/mtd/devices/tegra_nand.c @@ -1492,7 +1492,7 @@ static int tegra_nand_scan(struct mtd_info *mtd, int maxchips) /* page_size */ tmp = dev_parms & 0x3; - mtd->writesize = 1024 << tmp; + mtd->writesize = mtd->writebufsize = 1024 << tmp; info->chip.column_mask = mtd->writesize - 1; if (mtd->writesize > 4096) { |