lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAyq3SZF9eGKfLLcC3zFHq85-AEb9B=Grjqfap8QqCUKLdLSVw@mail.gmail.com>
Date: Mon, 10 Feb 2025 10:46:19 +0800
From: Cheng Ming Lin <linchengming884@...il.com>
To: Miquel Raynal <miquel.raynal@...tlin.com>
Cc: vigneshr@...com, linux-mtd@...ts.infradead.org, 
	linux-kernel@...r.kernel.org, richard@....at, alvinzhou@...c.com.tw, 
	leoyu@...c.com.tw, Cheng Ming Lin <chengminglin@...c.com.tw>
Subject: Re: [PATCH v3 1/2] mtd: spi-nand: Add read retry support

Hi Miquel,

Miquel Raynal <miquel.raynal@...tlin.com> 於 2025年2月7日 週五 上午1:13寫道:
>
> 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.

This was originally based on the configuration in rawnand.
However, I agree that your proposed condition is a better approach.
Thank you for the suggestion.

>
> > +                             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.

>
> > +                             }
> > +
> > +                             /* 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

Thanks,
Cheng Ming Lin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ