diff options
| -rw-r--r-- | drivers/mtd/ubi/io.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c index b812f8805367..ffb230339558 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, | |||
| 150 | retry: | 150 | retry: |
| 151 | err = ubi->mtd->read(ubi->mtd, addr, len, &read, buf); | 151 | err = ubi->mtd->read(ubi->mtd, addr, len, &read, buf); |
| 152 | if (err) { | 152 | if (err) { |
| 153 | const char errstr = (err == -EBADMSG) ? "ECC error" : ""; | ||
| 154 | |||
| 153 | if (err == -EUCLEAN) { | 155 | if (err == -EUCLEAN) { |
| 154 | /* | 156 | /* |
| 155 | * -EUCLEAN is reported if there was a bit-flip which | 157 | * -EUCLEAN is reported if there was a bit-flip which |
| @@ -165,15 +167,15 @@ retry: | |||
| 165 | } | 167 | } |
| 166 | 168 | ||
| 167 | if (read != len && retries++ < UBI_IO_RETRIES) { | 169 | if (read != len && retries++ < UBI_IO_RETRIES) { |
| 168 | dbg_io("error %d while reading %d bytes from PEB %d:%d," | 170 | dbg_io("error %d%s while reading %d bytes from PEB %d:%d," |
| 169 | " read only %zd bytes, retry", | 171 | " read only %zd bytes, retry", |
| 170 | err, len, pnum, offset, read); | 172 | err, errstr, len, pnum, offset, read); |
| 171 | yield(); | 173 | yield(); |
| 172 | goto retry; | 174 | goto retry; |
| 173 | } | 175 | } |
| 174 | 176 | ||
| 175 | ubi_err("error %d while reading %d bytes from PEB %d:%d, " | 177 | ubi_err("error %d while reading %d bytes from PEB %d:%d, " |
| 176 | "read %zd bytes", err, len, pnum, offset, read); | 178 | "read %zd bytes", err, errstr, len, pnum, offset, read); |
| 177 | ubi_dbg_dump_stack(); | 179 | ubi_dbg_dump_stack(); |
| 178 | 180 | ||
| 179 | /* | 181 | /* |
