The JFFS2 requests OOB function from column 0.
But the oobtest in nand-tests doesn't.
So we only exit loop only when column start with 0.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
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 <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
If a write error occurs, the affected block is placed on the
bad_used_list. In the case that the write error occured
when writing summary data the block was also being placed on
the dirty_list, which caused list corruption and ultimately
a soft lockup in jffs2_mark_node_obsolete. This fixes that.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
A new module parameter has been added called 'overridesize',
which overrides the size that would be determined by the
ID bytes. 'overridesize' is specified in erase blocks and
as the exponent of a power of two e.g. 5 means a size of
32 erase blocks.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
A new module parameter 'rptwear' specifies how many erases between
reporting wear information. Zero means never.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
New module parameters have been added to nandsim to
simulate:
bitflips random bit flips
badblocks blocks that are initially marked bad
weakblocks blocks that fail to erase after a
small number of erase cycles
weakpages pages that fail to write after a
small number of successful writes
gravepages pages that fail to read after a
small number of successful reads
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
Enhance nandsim to be able to create more than 1 partition.
A new module parameter 'parts' may be used to specify partition
sizes.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
If an erase operation fails, the address at which the
failure occurred is returned by the driver. The MTD
partition must adjust this address (by subtracting the
partition offset) before returning to the caller.
This was not happening, which caused JFFS2 to mark
the wrong block bad!
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
OneNAND has internal bufferRAMs. The driver keeps track of
what is in the bufferRAM to save having to load from the
NAND core. After an erase operation, the driver must
mark bufferRAM invalid if it refers to the erased block.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
Add checks to ensure that out-of-band reads and writes are
not attempted with an invalid offset or length. Specifically,
the offset must be less than the size of oob for a page
and the length must not go beyond the size of the device.
Additionally the checks must adjust for auto-placement
(MTD_OOB_AUTO) of oob data.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
OneNAND double-density package (DDP) has two chips, each with
their own bufferRAM. The driver will skip loading data from
the NAND core if the data can be found in a bufferRAM, however
in that case, the correct chip's bufferRAM must be selected
before reading from bufferRAM.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
When a write is done, the length written is returned. When a
single subpage is written the length returned should be the
subpage size, however the page size was being returned.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
OneNAND can write oob to successive pages, but NAND
does not do that. For compatibility, disallow OneNAND
from writing past the end of the page.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Enable the use of oob operation mode MTD_OOB_AUTO with OneNAND.
Note that MTD_OOB_RAW is still not supported.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
When write-verify is enabled (CONFIG_MTD_ONENAND_VERIFY_WRITE),
the data written is read back and compared. The comparison
was being made between dataRAM buffers, but this does not
verify that the data made it to the dataRAM correctly in
the first place. This patch amends write-verify to
compare back to the original buffer. It also now verifies
sub-page writes.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
OneNAND records bad block information in the out-of-band area of either the first or second page of a block. Due to a logic error, only the first page was being checked.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
OneNAND does 2 memory allocations for bad block information.
Only one of them was being freed.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
The read-while-load method of reading from OneNAND needs to allow
for the change of bufferRAM address at the boundary between the
two chips in a double density (DDP) device.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>