From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Cheng Ming Lin <linchengming884@gmail.com>
Cc: vigneshr@ti.com, linux-mtd@lists.infradead.org,
linux-kernel@vger.kernel.org, richard@nod.at,
alvinzhou@mxic.com.tw, leoyu@mxic.com.tw,
Cheng Ming Lin <chengminglin@mxic.com.tw>
Subject: Re: [PATCH v3 1/2] mtd: spi-nand: Add read retry support
Date: Thu, 06 Feb 2025 18:13:25 +0100 [thread overview]
Message-ID: <878qqj3sju.fsf@bootlin.com> (raw)
In-Reply-To: <20250122065605.285145-2-linchengming884@gmail.com> (Cheng Ming Lin's message of "Wed, 22 Jan 2025 14:56:04 +0800")
Hello Cheng,
> @@ -687,18 +691,43 @@ static int spinand_mtd_regular_page_read(struct mtd_info *mtd, loff_t from,
> if (ret)
> break;
>
> +read_retry:
> ret = spinand_read_page(spinand, &iter.req);
> if (ret < 0 && ret != -EBADMSG)
> break;
>
> - if (ret == -EBADMSG)
> + if (ret == -EBADMSG && spinand->set_read_retry) {
> + if (spinand->read_retries && (++retry_mode < spinand->read_retries)) {
I believe the condition should be:
if (spinand->read_retries && (++retry_mode <= spinand->read_retries)) {
So if you have 5 retry modes, you can provide 5 in the manufacturer driver,
and not 6.
> + ret = spinand->set_read_retry(spinand, retry_mode);
> + if (ret < 0) {
> + ecc_failed = true;
> + return ret;
Shall we try to set the read_retry level to 0 upon:
if (ret < 0 && retry_mode > 1)
?
> + }
> +
> + /* Reset ecc_stats; retry */
> + mtd->ecc_stats = old_stats;
> + goto read_retry;
> + } else {
> + /* No more retry modes; real failure */
> + ecc_failed = true;
> + }
> + } else if (ret == -EBADMSG) {
Rest lgtm.
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Cheng Ming Lin <linchengming884@gmail.com>
Cc: vigneshr@ti.com, linux-mtd@lists.infradead.org,
linux-kernel@vger.kernel.org, richard@nod.at,
alvinzhou@mxic.com.tw, leoyu@mxic.com.tw,
Cheng Ming Lin <chengminglin@mxic.com.tw>
Subject: Re: [PATCH v3 1/2] mtd: spi-nand: Add read retry support
Date: Thu, 06 Feb 2025 18:13:25 +0100 [thread overview]
Message-ID: <878qqj3sju.fsf@bootlin.com> (raw)
In-Reply-To: <20250122065605.285145-2-linchengming884@gmail.com> (Cheng Ming Lin's message of "Wed, 22 Jan 2025 14:56:04 +0800")
Hello Cheng,
> @@ -687,18 +691,43 @@ static int spinand_mtd_regular_page_read(struct mtd_info *mtd, loff_t from,
> if (ret)
> break;
>
> +read_retry:
> ret = spinand_read_page(spinand, &iter.req);
> if (ret < 0 && ret != -EBADMSG)
> break;
>
> - if (ret == -EBADMSG)
> + if (ret == -EBADMSG && spinand->set_read_retry) {
> + if (spinand->read_retries && (++retry_mode < spinand->read_retries)) {
I believe the condition should be:
if (spinand->read_retries && (++retry_mode <= spinand->read_retries)) {
So if you have 5 retry modes, you can provide 5 in the manufacturer driver,
and not 6.
> + ret = spinand->set_read_retry(spinand, retry_mode);
> + if (ret < 0) {
> + ecc_failed = true;
> + return ret;
Shall we try to set the read_retry level to 0 upon:
if (ret < 0 && retry_mode > 1)
?
> + }
> +
> + /* Reset ecc_stats; retry */
> + mtd->ecc_stats = old_stats;
> + goto read_retry;
> + } else {
> + /* No more retry modes; real failure */
> + ecc_failed = true;
> + }
> + } else if (ret == -EBADMSG) {
Rest lgtm.
Thanks,
Miquèl
next prev parent reply other threads:[~2025-02-06 17:13 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-22 6:56 [PATCH v3 0/2] Add support for read retry Cheng Ming Lin
2025-01-22 6:56 ` Cheng Ming Lin
2025-01-22 6:56 ` [PATCH v3 1/2] mtd: spi-nand: Add read retry support Cheng Ming Lin
2025-01-22 6:56 ` Cheng Ming Lin
2025-02-06 17:13 ` Miquel Raynal [this message]
2025-02-06 17:13 ` Miquel Raynal
2025-02-10 2:46 ` Cheng Ming Lin
2025-02-10 2:46 ` Cheng Ming Lin
2025-02-10 10:07 ` Miquel Raynal
2025-02-10 10:07 ` Miquel Raynal
2025-02-11 8:13 ` Cheng Ming Lin
2025-02-11 8:13 ` Cheng Ming Lin
2025-02-11 10:40 ` Miquel Raynal
2025-02-11 10:40 ` Miquel Raynal
2025-01-22 6:56 ` [PATCH v3 2/2] mtd: spi-nand: macronix: Add support for read retry Cheng Ming Lin
2025-01-22 6:56 ` Cheng Ming Lin
2025-02-06 17:07 ` Miquel Raynal
2025-02-06 17:07 ` Miquel Raynal
2025-02-10 2:46 ` Cheng Ming Lin
2025-02-10 2:46 ` Cheng Ming Lin
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=878qqj3sju.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=alvinzhou@mxic.com.tw \
--cc=chengminglin@mxic.com.tw \
--cc=leoyu@mxic.com.tw \
--cc=linchengming884@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.