diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-07-15 15:28:55 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-07-16 09:04:40 +0200 |
commit | 3b68dbcbfce830bdf91f50943e5ee41463717abf (patch) | |
tree | 230009208fe715a6e89365645f1a9fc0ef508cf7 /drivers/mtd | |
parent | 4c216abb0cf5da6f896298fa875cd7bb80dc76b9 (diff) | |
download | barebox-3b68dbcbfce830bdf91f50943e5ee41463717abf.tar.gz barebox-3b68dbcbfce830bdf91f50943e5ee41463717abf.tar.xz |
mtd: peb: Do not mark as bad in mtd_peb_torture()
Both the Kernel and mtd-utils have peb torture functions and both
do not mark the block as bad automatically. Instead, the caller
must mark the block as bad when -EIO is returned from the torture
function. Do the same in barebox. This is necessary as the UBI code
otherwise may mark a block as bad twice: Once indirectly in
mtd_peb_torture() and then directly afterwards.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/peb.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/mtd/peb.c b/drivers/mtd/peb.c index 388db7f587..c82b3e8bba 100644 --- a/drivers/mtd/peb.c +++ b/drivers/mtd/peb.c @@ -493,9 +493,8 @@ static uint8_t patterns[] = {0xa5, 0x5a, 0x0}; * is passed then this function will with the block freshly erased and * the positive number returned indicaties how often the block has been * erased during this test. - * If the block does not pass the test the block is marked as bad and - * -EIO is returned. - * Other negative errors are returned in case of other errors. + * If the block does not pass the test -EIO is returned. + * Other negative errors are returned in case of other errors. */ int mtd_peb_torture(struct mtd_info *mtd, int pnum) { @@ -549,11 +548,9 @@ out: * has not passed because it happened on a freshly erased * physical eraseblock which means something is wrong with it. */ - dev_err(&mtd->class_dev, "read problems on freshly erased PEB %d, marking it bad\n", + dev_err(&mtd->class_dev, "read problems on freshly erased PEB %d, must be bad\n", pnum); - mtd_peb_mark_bad(mtd, pnum); - err = -EIO; } |