summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-06-08 10:59:07 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-06-11 17:23:37 +0300
commit1a49af2ca019dcb4614c32f832bbcb814b61409c (patch)
tree1ab9382a4f2433018b9a38c2449baa835373b51b /drivers/mtd
parent0798cea8c2e1afee59686c51d27d0e96b05e42d1 (diff)
downloadlinux-arm64-1a49af2ca019dcb4614c32f832bbcb814b61409c.tar.gz
linux-arm64-1a49af2ca019dcb4614c32f832bbcb814b61409c.tar.bz2
linux-arm64-1a49af2ca019dcb4614c32f832bbcb814b61409c.zip
UBI: improve ECC error message
ECC errors are quite typical errors on NAND, so it is worth improving the UBI message and print something like ubi_io_read: error -74 (ECC error) while reading 4096 bytes from PEB 1:4 ... rather than ubi_io_read: error -74 while reading 4096 bytes from PEB 1:4 ... Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/io.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
index b812f880536..ffb23033955 100644
--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -150,6 +150,8 @@ int ubi_io_read(const struct ubi_device *ubi, void *buf, int pnum, int offset,
retry:
err = ubi->mtd->read(ubi->mtd, addr, len, &read, buf);
if (err) {
+ const char errstr = (err == -EBADMSG) ? "ECC error" : "";
+
if (err == -EUCLEAN) {
/*
* -EUCLEAN is reported if there was a bit-flip which
@@ -165,15 +167,15 @@ retry:
}
if (read != len && retries++ < UBI_IO_RETRIES) {
- dbg_io("error %d while reading %d bytes from PEB %d:%d,"
+ dbg_io("error %d%s while reading %d bytes from PEB %d:%d,"
" read only %zd bytes, retry",
- err, len, pnum, offset, read);
+ err, errstr, len, pnum, offset, read);
yield();
goto retry;
}
ubi_err("error %d while reading %d bytes from PEB %d:%d, "
- "read %zd bytes", err, len, pnum, offset, read);
+ "read %zd bytes", err, errstr, len, pnum, offset, read);
ubi_dbg_dump_stack();
/*