10 Jan, 2012
6 commits
-
Instead, use the new 'mtd_can_have_bb()', or just rely on 'mtd_block_markbad()'
return code, which will be -EOPNOTSUPP if bad blocks are not supported.Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse -
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse
11 Sep, 2011
2 commits
-
These modes are not necessarily for OOB only. Particularly, MTD_OOB_RAW
affected operations on in-band page data as well. To clarify these
options and to emphasize that their effect is applied per-operation, we
change the primary prefix to MTD_OPS_.Signed-off-by: Brian Norris
Signed-off-by: Artem Bityutskiy -
Use a helper to test if a mutex is held instead of a hack with
mutex_trylock().Signed-off-by: Alexey Khoroshilov
Signed-off-by: Artem Bityutskiy
31 Mar, 2011
1 commit
-
Fixes generated by 'codespell' and manually reviewed.
Signed-off-by: Lucas De Marchi
20 May, 2010
2 commits
-
Now that we do erases from GC and trigger the GC thread to do them
instead of using kupdated, this function is misnamed. It's only used
for triggering wbuf flush on NAND flash now. Rename it accordingly.Signed-off-by: Joakim Tjernlund
Signed-off-by: David Woodhouse -
This is now done in a GC pass; we don't need to trigger kupdated to do it.
Signed-off-by: David Woodhouse
03 Sep, 2009
1 commit
-
The function jffs2_nor_wbuf_flash_setup() doesn't allocate the verify buffer
if CONFIG_JFFS2_FS_WBUF_VERIFY is defined, so causing a kernel panic when
that macro is enabled and the verify function is called. Similarly the
jffs2_nor_wbuf_flash_cleanup() must free the buffer if
CONFIG_JFFS2_FS_WBUF_VERIFY is enabled.
The following patch fixes the problem.
The following patch applies to 2.6.30 kernel.Signed-off-by: Massimo Cirillo
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse
Cc: stable@kernel.org
18 Oct, 2008
1 commit
-
After choosing new c->nextblock, don't leave the wbuf offset field
occasionally pointing at the start of the next physical eraseblock.
This was causing a BUG() on NOR-ECC (Sibley) flash, where we start
writing after the cleanmarker.Among other this fix should cover write buffer offset adjustment
after flushing the last page of an eraseblock.Signed-off-by: Alexander Belyakov
Signed-off-by: David Woodhouse
02 May, 2008
2 commits
-
To support NFS export, we need to know the parent inode of directories.
Rather than growing the jffs2_inode_cache structure, share space with
the nlink field -- which was always set to 1 for directories anyway.Signed-off-by: David Woodhouse
-
We don't actually care about nlink; we only care whether the inode in
question is unlinked or not.Signed-off-by: David Woodhouse
22 Apr, 2008
2 commits
-
Signed-off-by: David Woodhouse
-
Add the write verification buffer to the dataflash. The mtd_dataflash has
the CONFIG_DATAFLASH_WRITE_VERIFY so is better a change to Kconfig.Signed-off-by: Michael Trimarchi
Signed-off-by: Andrew Morton
Signed-off-by: David Woodhouse
09 Aug, 2007
1 commit
-
Commit a7a6ace1406f95c3edb8365788f85984377f3832 revamped the OOB
handling but accidentally switched to 12-byte cleanmarkers, which is
incompatible with what 'flash_eraseall -j' will do. So using
flash_eraseall -j and then trying to mount the 'empty' flash will fail,
because the cleanmarkers aren't recognised.Signed-off-by: David Woodhouse
11 Jul, 2007
1 commit
-
We've seen some evil corruption issues, where the corruption seems to be
introduced after the JFFS2 crc32 is calculated but before the NAND
controller calculates the ECC. So it's in RAM or in the PCI DMA
transfer; not on the flash. Attempt to catch it earlier by (optionally)
reading back from the flash immediately after writing it.Signed-off-by: David Woodhouse
10 Jul, 2007
1 commit
-
Convert many spaces to tabs; one or two other minor cosmetic fixes.
Signed-off-by: David Woodhouse
05 May, 2007
1 commit
-
After flushing the last page of an eraseblock, don't leave the
wbuf 'offset' field pointing at the start of the next physical
eraseblock. This was causing a BUG() on NOR-ECC (Sibley) flash, where
we start writing a little further in, after the cleanmarker.Debugged by Alexander Belyakov
Signed-off-by: David Woodhouse
28 Apr, 2007
1 commit
-
Conflicts:
drivers/mtd/Kconfig
Signed-off-by: David Woodhouse
27 Apr, 2007
1 commit
-
This patch make JFFS2 able to work with UBI volumes via the emulated MTD
devices which are directly mapped to these volumes.Signed-off-by: Artem Bityutskiy
25 Apr, 2007
1 commit
-
In particular, remove the bit in the LICENCE file about contacting
Red Hat for alternative arrangements. Their errant IS department broke
that arrangement a long time ago -- the policy of collecting copyright
assignments from contributors came to an end when the plug was pulled on
the servers hosting the project, without notice or reason.We do still dual-license it for use with eCos, with the GPL+exception
licence approved by the FSF as being GPL-compatible. It's just that nobody
has the right to license it differently.Signed-off-by: David Woodhouse
23 Apr, 2007
1 commit
-
When compiling a LE-capable JFFS2 on PowerPC, wbuf.c fails to compile:
fs/jffs2/wbuf.c:973: error: braced-group within expression allowed only inside a function
fs/jffs2/wbuf.c:973: error: initializer element is not constant
fs/jffs2/wbuf.c:973: error: (near initialization for ‘oob_cleanmarker.magic’)
fs/jffs2/wbuf.c:974: error: braced-group within expression allowed only inside a function
fs/jffs2/wbuf.c:974: error: initializer element is not constant
fs/jffs2/wbuf.c:974: error: (near initialization for ‘oob_cleanmarker.nodetype’)
fs/jffs2/wbuf.c:975: error: braced-group within expression allowed only inside a function
fs/jffs2/wbuf.c:976: error: initializer element is not constant
fs/jffs2/wbuf.c:976: error: (near initialization for ‘oob_cleanmarker.totlen’)Provide constant_cpu_to_je{16,32} functions, and use them for initialising the
offending structure.Signed-off-by: David Woodhouse
18 Apr, 2007
1 commit
-
After a write error, any data in the write buffer must
be relocated. This is handled by the jffs2_wbuf_recover
function. This function does not fix up the erase block
summary information that is collected for writing at the
end of the block, which results in an incorrect summary
(or BUG if the summary was found to be empty).As the summary is not essential (it is an optimisation),
it may be disabled for the current erase block when this
situation arises. This patch does that.Signed-off-by: Adrian Hunter
Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse
09 Mar, 2007
1 commit
-
New bad eraseblock is an event which is important enough to be printed
about.Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse
08 Mar, 2007
1 commit
-
For the case when nand_write_page fail with -EIO for the first page in an
eraseblock, jffs2_wbuf_recover ends up producing a BUG in jffs2_block_refile
as jeb->first_node is not yet set up (it's set up later in jffs2_wbuf_recover).
This BUG is not really a bug; it's just jffs2_wbuf_recover calling
jffs2_block_refile with the wrong second parameter.
This patch takes care of this situation.Signed-off-by: Vitaly Wool
Signed-off-by: Thomas Gleixner
Signed-off-by: David Woodhouse
19 Feb, 2007
1 commit
-
fs/jffs2/wbuf.c: In function 'jffs2_check_oob_empty':
fs/jffs2/wbuf.c:993: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
fs/jffs2/wbuf.c:993: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
fs/jffs2/wbuf.c: In function 'jffs2_check_nand_cleanmarker':
fs/jffs2/wbuf.c:1036: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
fs/jffs2/wbuf.c:1036: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
fs/jffs2/wbuf.c: In function 'jffs2_write_nand_cleanmarker':
fs/jffs2/wbuf.c:1062: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
fs/jffs2/wbuf.c:1062: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'Signed-off-by: Andrew Morton
Signed-off-by: David Woodhouse
09 Feb, 2007
1 commit
-
Nowadays MTD supports an MTD_OOB_AUTO option which allows users
to access free bytes in NAND's OOB as a contiguous buffer, although
it may be highly discontinuous.This patch teaches JFFS2 to use this nice feature instead of the
old MTD_OOB_PLACE option. This for example caused problems with
OneNAND. Now JFFS2 does not care how are the free bytes situated.This may change position of the clean marker on some flashes,
but this is not a problem. JFFS2 will just re-erase the empty
eraseblocks and write the new (correct) clean marker.Signed-off-by: Artem Bityutskiy
Signed-off-by: David Woodhouse
18 Jan, 2007
1 commit
04 Dec, 2006
1 commit
-
Signed-off-by: Al Viro
29 Nov, 2006
1 commit
-
As was discussed between Ricard Wanderlöf, David Woodhouse, Artem
Bityutskiy and me, the current API for reading/writing OOB is confusing.The thing that introduces confusion is the need to specify ops.len
together with ops.ooblen for reads/writes that concern only OOB not data
area. So, ops.len is overloaded: when ops.datbuf != NULL it serves to
specify the length of the data read, and when ops.datbuf == NULL, it
serves to specify the full OOB read length.The patch inlined below is the slightly updated version of the previous
patch serving the same purpose, but with the new Artem's comments taken
into account.Artem, BTW, thanks a lot for your valuable input!
Signed-off-by: Vitaly Wool
Signed-off-by: David Woodhouse
27 Jun, 2006
1 commit
-
This patch converts the combination of list_del(A) and list_add(A, B) to
list_move(A, B) under fs/.Cc: Ian Kent
Acked-by: Joel Becker
Cc: Neil Brown
Cc: Hans Reiser
Cc: Urban Widmark
Acked-by: David Howells
Acked-by: Mark Fasheh
Signed-off-by: Akinobu Mita
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
29 May, 2006
4 commits
-
Return -EUCLEAN on read when a bitflip was detected and corrected, so the
clients can react and eventually copy the affected block to a spare one.
Make all in kernel users aware of the change.Signed-off-by: Thomas Gleixner
-
Hopefully the last iteration on this!
The handling of out of band data on NAND was accompanied by tons of fruitless
discussions and halfarsed patches to make it work for a particular
problem. Sufficiently annoyed by I all those "I know it better" mails and the
resonable amount of discarded "it solves my problem" patches, I finally decided
to go for the big rework. After removing the _ecc variants of mtd read/write
functions the solution to satisfy the various requirements was to refactor the
read/write _oob functions in mtd.The major change is that read/write_oob now takes a pointer to an operation
descriptor structure "struct mtd_oob_ops".instead of having a function with at
least seven arguments.read/write_oob which should probably renamed to a more descriptive name, can do
the following tasks:- read/write out of band data
- read/write data content and out of band data
- read/write raw data content and out of band data (ecc disabled)struct mtd_oob_ops has a mode field, which determines the oob handling mode.
Aside of the MTD_OOB_RAW mode, which is intended to be especially for
diagnostic purposes and some internal functions e.g. bad block table creation,
the other two modes are for mtd clients:MTD_OOB_PLACE puts/gets the given oob data exactly to/from the place which is
described by the ooboffs and ooblen fields of the mtd_oob_ops strcuture. It's
up to the caller to make sure that the byte positions are not used by the ECC
placement algorithms.MTD_OOB_AUTO puts/gets the given oob data automaticaly to/from the places in
the out of band area which are described by the oobfree tuples in the ecclayout
data structre which is associated to the devicee.The decision whether data plus oob or oob only handling is done depends on the
setting of the datbuf member of the data structure. When datbuf == NULL then
the internal read/write_oob functions are selected, otherwise the read/write
data routines are invoked.Tested on a few platforms with all variants. Please be aware of possible
regressions for your particular device / application scenarioDisclaimer: Any whining will be ignored from those who just contributed "hot
air blurb" and never sat down to tackle the underlying problem of the mess in
the NAND driver grown over time and the big chunk of work to fix up the
existing users. The problem was not the holiness of the existing MTD
interfaces. The problems was the lack of time to go for the big overhaul. It's
easy to add more mess to the existing one, but it takes alot of effort to go
for a real solution.Improvements and bugfixes are welcome!
Signed-off-by: Thomas Gleixner
-
The nand_oobinfo structure is not fitting the newer error correction
demands anymore. Replace it by struct nand_ecclayout and fixup the users
all over the place. Keep the nand_oobinfo based ioctl for user space
compability reasons.Signed-off-by: Thomas Gleixner
-
The info structure for out of band data was copied into
the mtd structure. Make it a pointer and remove the ability
to set it from userspace. The position of ecc bytes is
defined by the hardware and should not be changed by software.Signed-off-by: Thomas Gleixner
27 May, 2006
2 commits
-
A data node might not be in the fraglist; it could be f->metadata.
Signed-off-by: David Woodhouse
-
This allows us to drop another pointer from the struct jffs2_raw_node_ref,
shrinking it to 8 bytes on 32-bit machines (if the TEST_TOTLEN) paranoia
check is turned off, which will be committed soon).Signed-off-by: David Woodhouse