From: Bang Li <libang.linuxer@gmail.com>
To: miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com
Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
Bang Li <libang.linuxer@gmail.com>
Subject: [PATCH] mtdblock: tolerate corrected bit-flips
Date: Wed, 15 Mar 2023 00:56:53 +0800 [thread overview]
Message-ID: <20230314165653.252673-1-libang.linuxer@gmail.com> (raw)
mtd_read() may return -EUCLEAN in case of corrected bit-flips.This
particular condition should not be treated like an error.
Signed-off-by: Bang Li <libang.linuxer@gmail.com>
---
drivers/mtd/mtdblock_ro.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/mtdblock_ro.c b/drivers/mtd/mtdblock_ro.c
index 7c51952ce55d..66ffc9f1ead2 100644
--- a/drivers/mtd/mtdblock_ro.c
+++ b/drivers/mtd/mtdblock_ro.c
@@ -16,8 +16,10 @@ static int mtdblock_readsect(struct mtd_blktrans_dev *dev,
unsigned long block, char *buf)
{
size_t retlen;
+ int err;
- if (mtd_read(dev->mtd, (block * 512), 512, &retlen, buf))
+ err = mtd_read(dev->mtd, (block * 512), 512, &retlen, buf);
+ if (err && !mtd_is_bitflip(err))
return 1;
return 0;
}
--
2.25.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next reply other threads:[~2023-03-14 16:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-14 16:56 Bang Li [this message]
2023-03-22 16:08 ` [PATCH] mtdblock: tolerate corrected bit-flips Miquel Raynal
-- strict thread matches above, loose matches on Subject: below --
2023-03-23 14:03 Bang Li
2023-03-28 12:58 ` Miquel Raynal
2023-03-28 13:21 ` Richard Weinberger
2023-03-28 14:00 ` Miquel Raynal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230314165653.252673-1-libang.linuxer@gmail.com \
--to=libang.linuxer@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).