diff options
author | Patrick Delaunay | 2023-06-05 09:52:08 +0200 |
---|---|---|
committer | Dario Binacchi | 2023-10-13 10:49:07 +0200 |
commit | be0da1257f189c09604b01bc04a7e8411bf18e5c (patch) | |
tree | cadc9498e861a5f74f59574628f5b3edc5696081 /arch/arm/dts | |
parent | 4b1c067ea78f01fb5b79fa4e6589f750b330c592 (diff) |
dfu: mtd: mark bad the MTD block on erase error
In the MTD DFU backend, it is needed to mark the NAND block bad when the
erase failed with the -EIO error, as it is done in UBI and JFFS2 code.
This operation is not done in the MTD framework, but the bad block
tag (in BBM or in BBT) is required to avoid to write data on this block
in the next DFU_OP_WRITE loop in mtd_block_op(): the code skip the bad
blocks, tested by mtd_block_isbad().
Without this patch, when the NAND block become bad on DFU write operation
- low probability on new NAND - the DFU write operation will always failed
because the failing block is never marked bad.
This patch also adds a test to avoid to request an erase operation on a
block already marked bad; this test is not performed in MTD framework
in mtd_erase().
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Diffstat (limited to 'arch/arm/dts')
0 files changed, 0 insertions, 0 deletions