mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Yunus Bas <y.bas@phytec.de>
To: barebox@lists.infradead.org
Subject: Re: [PATCH] mtd: nand_bbt: Skip bad blocks when searching for the BBT in NAND
Date: Mon, 4 May 2020 16:30:33 +0200	[thread overview]
Message-ID: <96d54d41-390c-02dc-6b91-d59ad3d363d2@phytec.de> (raw)
In-Reply-To: <1588599895-368145-1-git-send-email-y.bas@phytec.de>

Please skip this patch, there seems to be a problem here.

Regards

Y. Bas

Am 04.05.20 um 15:44 schrieb Yunus Bas:
> From: Stefan Riedmueller <s.riedmueller@phytec.de>
>
> The blocks containing the bad block table can become bad as well. So
> make sure to skip any blocks that are marked bad when searching for the
> bad block table.
>
> Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
> Signed-off-by: Christian Hemp <c.hemp@phytec.de>
> Signed-off-by: Yunus Bas <y.bas@phytec.de>
> ---
>   drivers/mtd/nand/nand_bbt.c | 10 ++++++++--
>   1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
> index 435a06f..403c0ae 100644
> --- a/drivers/mtd/nand/nand_bbt.c
> +++ b/drivers/mtd/nand/nand_bbt.c
> @@ -560,8 +560,14 @@ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr
>   			int actblock = startblock + dir * block;
>   			loff_t offs = (loff_t)actblock << this->bbt_erase_shift;
>   
> -			/* Read first page */
> -			scan_read(mtd, buf, offs, mtd->writesize, td);
> +			/* Read first page including oob */
> +			scan_read_oob(mtd, buf, offs, scanlen);
> +
> +			/* Skip blocks which are marked bad */
> +			if (buf[mtd->writesize] == 0x00) {
> +				continue;
> +			}
> +
>   			if (!check_pattern(buf, scanlen, mtd->writesize, td)) {
>   				td->pages[i] = actblock << blocktopage;
>   				if (td->options & NAND_BBT_VERSION) {

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2020-05-04 14:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04 13:44 Yunus Bas
2020-05-04 14:30 ` Yunus Bas [this message]

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=96d54d41-390c-02dc-6b91-d59ad3d363d2@phytec.de \
    --to=y.bas@phytec.de \
    --cc=barebox@lists.infradead.org \
    /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