[PATCH v3 1/2] mtd: spi-nand: Add read retry support
Miquel Raynal
miquel.raynal at bootlin.com
Tue Feb 11 02:40:49 PST 2025
On 11/02/2025 at 16:13:32 +08, Cheng Ming Lin <linchengming884 at gmail.com> wrote:
> Hi Miquel,
>
> Miquel Raynal <miquel.raynal at 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
More information about the linux-mtd
mailing list