public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
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: Tue, 11 Feb 2025 11:40:49 +0100	[thread overview]
Message-ID: <87msessr0u.fsf@bootlin.com> (raw)
In-Reply-To: <CAAyq3Sa9+FZGiGnBV=KbwVnQhWX-vc21CK75OXSnDDsE89mx1Q@mail.gmail.com> (Cheng Ming Lin's message of "Tue, 11 Feb 2025 16:13:32 +0800")

On 11/02/2025 at 16:13:32 +08, Cheng Ming Lin <linchengming884@gmail.com> wrote:

> Hi Miquel,
>
> Miquel Raynal <miquel.raynal@bootlin.com> 於 2025年2月10日 週一 下午6:07寫道:
>>
>> Hello,
>>
>> >> > +                             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)
>> >>
>> >> ?
>> >
>> > If we set the read_retry level to 0 upon, and set_read_retry fails
>> > when retry_mode equals to 1, it won't return an error. This could
>> > potentially mask an underlying issue.
>>
>> Don't save the return value in this case? But otherwise you would leave
>> the chip in a retry state, no?
>
> However, if we set the read_retry level to 0 upon, the chip would still
> remain in the retry state if set_read_retry fails.

Well, if even this fails, you have bigger troubles than read_retry being
enabled.

>
> I come up with a solution: setting the read_retry level to 0 right before
> the read_retry label. This ensures that subsequent reads always start
> from level 0, and it eliminates the need to reset the read_retry level at
> the end.

I don't see the difference with the previous solution. If it fails, it's
exactly the same.

Please do not add a function call to *every* read regardless of the fact
that we enabled read_retry (which I think is what you are suggesting).

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2025-02-11 10:55 UTC|newest]

Thread overview: 10+ 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 ` [PATCH v3 1/2] mtd: spi-nand: Add read retry support Cheng Ming Lin
2025-02-06 17:13   ` Miquel Raynal
2025-02-10  2:46     ` Cheng Ming Lin
2025-02-10 10:07       ` Miquel Raynal
2025-02-11  8:13         ` Cheng Ming Lin
2025-02-11 10:40           ` Miquel Raynal [this message]
2025-01-22  6:56 ` [PATCH v3 2/2] mtd: spi-nand: macronix: Add support for read retry Cheng Ming Lin
2025-02-06 17:07   ` Miquel Raynal
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=87msessr0u.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox