linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Brian Norris" <norris@broadcom.com>
To: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Cc: Maxim Levitsky <maximlevitsky@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	David Woodhouse <David.Woodhouse@intel.com>,
	Brian Norris <norris@broadcom.com>,
	Artem Bityutskiy <dedekind1@gmail.com>
Subject: Re: [PATCH v2 2/2] mtd/nand: More BB Detection, dynamic scan options
Date: Tue, 13 Jul 2010 16:56:58 -0700	[thread overview]
Message-ID: <4C3CFD4A.3020708@broadcom.com> (raw)
In-Reply-To: <1279059181-29300-3-git-send-email-norris@broadcom.com>

I have a few comments/questions about the following sections.

On 07/13/2010 03:13 PM, Brian Norris wrote:
> Added new flag for scanning of both bytes 1 and 6 of the OOB for
> a BB marker (instead of simply one or the other).

<snip>

> diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
> index ec1700e..474ff66 100644
> --- a/drivers/mtd/nand/nand_bbt.c
> +++ b/drivers/mtd/nand/nand_bbt.c

<snip>

> @@ -447,6 +445,24 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf,
>   		if (ret<  0)
>   			return ret;
>
> +		/* Check if we need a second scan for the 6th byte
> +		 * Perhaps there is a more efficient way of doing this?
> +		 */
> +		if (!ret&&  bd->options&  NAND_BBT_SCANBYTE1AND6) {
> +			bd->offs = NAND_SMALL_BADBLOCK_POS;
> +			if (bd->options&  NAND_BBT_SCANALLPAGES)
> +				ret = scan_block_full(mtd, bd, from, buf,
> +						readlen, scanlen, len);
> +			else
> +				ret = scan_block_fast(mtd, bd, from, buf, len);
> +
> +			/* Reset offset for future scans */
> +			bd->offs = NAND_LARGE_BADBLOCK_POS;
> +
> +			if (ret<  0)
> +				return ret;
> +		}
> +
>   		if (ret) {
>   			this->bbt[i>>  3] |= 0x03<<  (i&  0x6);
>   			printk(KERN_WARNING "Bad eraseblock %d at 0x%012llx\n",

I realize it's probably not the best practice to just duplicate/modify 
the detection code as I did above. I am trying to find the best place to 
implement the scanning of both bytes 1 and 6 of the OOB. Perhaps 
nand_bbt.c:check_pattern() and check_short_pattern()?

Also, it seems to me that in addition to the main scanning routines, I 
should update the nand_default_block_markbad() function in nand_base.c 
so that it writes its BB marker to the proper bytes in the OOB. Does 
this sound reasonable?

Comments/corrections are appreciated!

Brian

  reply	other threads:[~2010-07-13 23:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-23 20:36 [PATCH] mtd/nand: Edit macro flag for BBT scan of last page in block Brian Norris
2010-06-25 21:36 ` [PATCH 2] mtd/nand, BB detect: factory marker in page 1, 2, last and byte 1 or 6 Brian Norris
2010-07-13  8:21   ` Artem Bityutskiy
2010-07-13 22:12     ` [PATCH v2 0/2] Improved BB Scanning Brian Norris
2010-07-13 22:13       ` [PATCH v2 1/2] mtd/nand, BB detect: factory marker in page 1, 2, last and byte 1 or 6 Brian Norris
2010-07-13 22:13       ` [PATCH v2 2/2] mtd/nand: More BB Detection, dynamic scan options Brian Norris
2010-07-13 23:56         ` Brian Norris [this message]
2010-07-15 19:15           ` [PATCH v3 " Brian Norris
2010-07-18 16:38       ` [PATCH v2 0/2] Improved BB Scanning Artem Bityutskiy
2010-07-19 19:32         ` Brian Norris
2010-07-21  9:49           ` Artem Bityutskiy
2010-07-22 19:44             ` Karl Beldan
2010-07-21 23:53       ` [PATCH] mtd/nand: Update nand_default_block_markbad() Brian Norris
2010-07-26  4:30         ` Artem Bityutskiy
2010-07-08  9:15 ` [PATCH] mtd/nand: Edit macro flag for BBT scan of last page in block Artem Bityutskiy
2010-07-13  8:01 ` Artem Bityutskiy

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=4C3CFD4A.3020708@broadcom.com \
    --to=norris@broadcom.com \
    --cc=David.Woodhouse@intel.com \
    --cc=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=maximlevitsky@gmail.com \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).