ops.oobbuf = buf + len;
ops.datbuf = buf;
ops.len = len;
- return mtd->read_oob(mtd, offs, &ops);
+ res = mtd->read_oob(mtd, offs, &ops);
+
+ /* Ignore ECC errors when checking for BBM */
+ if (res != -EUCLEAN && res != -EBADMSG)
+ return res;
+ return 0;
} else {
ops.oobbuf = buf + mtd->writesize;
ops.datbuf = buf;
ops.len = mtd->writesize;
res = mtd->read_oob(mtd, offs, &ops);
- if (res)
+ /* Ignore ECC errors when checking for BBM */
+ if (res && res != -EUCLEAN && res != -EBADMSG)
return res;
}
* byte reads for 16 bit buswidth.
*/
ret = mtd->read_oob(mtd, offs, &ops);
- if (ret)
+ /* Ignore ECC errors when checking for BBM */
+ if (ret && ret != -EUCLEAN && ret != -EBADMSG)
return ret;
if (check_short_pattern(buf, bd))