[PATCH v2 43/62] UBI: Fastmap: Fall back to scanning mode after ECC error

Teresa Remmet t.remmet at phytec.de
Fri May 27 00:44:36 PDT 2016


From: Richard Weinberger <richard at nod.at>

If we encounter an uncorrectable ECC error while scanning for the fastmap
UBI must not fail hard. Instead fall back to scanning mode.

Reported-by: Alexander Block <Alexander.Block at continental-corporation.com>
Signed-off-by: Richard Weinberger <richard at nod.at>

Conflicts:
	drivers/mtd/ubi/attach.c

Fixed minor conflict.

Signed-off-by: Teresa Remmet <t.remmet at phytec.de>
---
 drivers/mtd/ubi/attach.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index dc14a2b..b49842b 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -1390,7 +1390,7 @@ int ubi_attach(struct ubi_device *ubi, int force_scan)
 		err = scan_all(ubi, ai, 0);
 	else {
 		err = scan_fast(ubi, ai);
-		if (err > 0) {
+		if (err > 0 || mtd_is_eccerr(err)) {
 			if (err != UBI_NO_FASTMAP) {
 				destroy_ai(ai);
 				ai = alloc_ai("ubi_aeb_slab_cache2");
-- 
1.9.1




More information about the barebox mailing list