diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-02-20 11:19:28 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-02-21 08:58:45 +0100 |
commit | 22d747e264d7dacebaaa0d2759e6aace78355f8c (patch) | |
tree | 10f15f91cbdef040057edb6bf9bf62db9c686c53 /include/linux/mtd/mtd.h | |
parent | 19f8f1166d925277ac463cdceac2ced39ed5602e (diff) | |
download | barebox-22d747e264d7dacebaaa0d2759e6aace78355f8c.tar.gz barebox-22d747e264d7dacebaaa0d2759e6aace78355f8c.tar.xz |
mtd: nand: do not write empty pages
Do not write pages which only contain 0xff. UBI expects pages which
seem empty to be writable. This got lost with:
| commit 3139c3e9a61e70846be8c4f95bb9cffd4465d88a
| Author: Sascha Hauer <s.hauer@pengutronix.de>
| Date: Thu Nov 29 11:16:40 2012 +0100
|
| mtd core: call driver write function with complete buffer
|
| mtd->write is supposed to loop around pages internally, no need
| to do this in mtd_write. This fixes a huge write performance drop
| with the m25p80 driver when it was converted to a mtd driver recently.
| Since mtd->writesize is 1 for this driver mtd_write ended up doing
| single byte writes on the flash.
Introduce mtd_all_ff as a global function since UBI currently has its own
implementation.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/linux/mtd/mtd.h')
-rw-r--r-- | include/linux/mtd/mtd.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index cb8b3bcaef..bd059baf81 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -253,6 +253,8 @@ static inline void mtd_erase_callback(struct erase_info *instr) int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs); +int mtd_all_ff(const void *buf, unsigned int len); + /* * Debugging macro and defines */ |