public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Bityutskiy, Artem" <artem.bityutskiy@intel.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: Angus CLARK <angus.clark@st.com>,
	Dan Carpenter <error27@gmail.com>, Barry Song <21cnbao@gmail.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Nicolas Ferre <nicolas.ferre@atmel.com>,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	"Hunter, Adrian" <adrian.hunter@intel.com>,
	Gabor Juhos <juhosg@openwrt.org>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	Jonas Gorski <jonas.gorski@gmail.com>,
	Jamie Iles <jamie@jamieiles.com>,
	Ivan Djelic <ivan.djelic@parrot.com>,
	Robert Jarzmik <robert.jarzmik@free.fr>,
	"Woodhouse, David" <david.woodhouse@intel.com>,
	Maxim Levitsky <maximlevitsky@gmail.com>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	Kevin Cernekee <cernekee@gmail.com>,
	Kulikov Vasiliy <segooon@gmail.com>,
	Jim Quinlan <jim2101024@gmail.com>,
	Andres Salomon <dilinger@queued.net>,
	Axel Lin <axel.lin@gmail.com>, Anatolij Gustschin <agust@denx.de>,
	Mike Frysinger <vapier@gentoo.org>, Arnd Bergmann <arnd@arndb.de>,
	Lei Wen <leiwen@marvell.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Florian Fainelli <florian@openwrt.org>,
	Ricard Wanderlof <ricard.wanderlof@axis.com>,
	Peter Wippich <pewi@gw-instruments.de>,
	Matthieu CASTET <matthieu.castet@parrot.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Shmulik Ladkani <shmulik.ladkani@gmail.com>,
	Wolfram Sang <w.sang@pengutronix.de>,
	"Dong, Chuanxiao" <chuanxiao.dong@intel.com>,
	Joe Perches <joe@perches.com>,
	Guillaume LECERF <glecerf@gmail.com>,
	Roman Tereshonkov <roman.tereshonkov@nokia.com>
Subject: Re: [PATCH v4 2/2] mtd: nand: write BBM to OOB even with flash-based BBT
Date: Thu, 2 Feb 2012 08:12:04 +0000	[thread overview]
Message-ID: <1328170449.28171.119.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <1327120684-7066-3-git-send-email-computersforpeace@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1883 bytes --]

On Fri, 2012-01-20 at 20:38 -0800, Brian Norris wrote:
> Currently, the flash-based BBT implementation writes bad block data only
> to its flash-based table and not to the OOB marker area. Then, as new bad
> blocks are marked over time, the OOB markers become out of date and the
> flash-based table becomes the only source of current bad block
> information.

I think the comment could be corrected: OOB markers become incomplete,
not out-of-date?


>   * This is the default implementation, which can be overridden by a hardware
> - * specific driver.
> + * specific driver. We try operations in the following order, according to our
> + * bbt_options (NAND_BBT_NO_OOB_BBM and NAND_BBT_USE_FLASH):
> + *  (1) erase the affected block, to allow OOB marker to be written cleanly
> + *  (2) update in-memory BBT
> + *  (3) write bad block marker to OOB area of affected block
> + *  (4) update flash-based BBT
> + * Note that we retain the first error encountered in (3) or (4), finish the
> + * procedures, and dump the error in the end.
>  */
>  static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)
>  {
>  	struct nand_chip *chip = mtd->priv;
>  	uint8_t buf[2] = { 0, 0 };
> -	int block, ret, i = 0;
> +	int block, res, ret = 0, i = 0;
> +	int write_oob = !(chip->bbt_options & NAND_BBT_NO_OOB_BBM);
>  
> -	if (!(chip->bbt_options & NAND_BBT_USE_FLASH)) {
> +	BUG_ON((chip->bbt_options & NAND_BBT_NO_OOB_BBM) &&
> +			!(chip->bbt_options & NAND_BBT_USE_FLASH));

If get the chip options wrong then this will be noticed only in the
field when a block gets bad? Probably we better put all the validation
of chip options to the NAND scan function so that incorrect combinations
are noticed immediately. Probably with a comment why.

Otherwise looks OK and I guess we could merge it.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 464 bytes --]

---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

      parent reply	other threads:[~2012-02-02  8:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-21  4:38 [PATCH v4 0/2] write OOB BBM + flash-based BBT Brian Norris
2012-01-21  4:38 ` [PATCH v4 1/2] mtd: nand: move SCANLASTPAGE handling to the correct code block Brian Norris
2012-01-27 14:56   ` Bityutskiy, Artem
2012-01-28 20:09     ` Brian Norris
2012-01-21  4:38 ` [PATCH v4 2/2] mtd: nand: write BBM to OOB even with flash-based BBT Brian Norris
2012-01-21  9:57   ` Shmulik Ladkani
2012-01-21 10:10   ` Shmulik Ladkani
2012-01-23 21:31     ` Brian Norris
2012-02-02  8:12   ` Bityutskiy, Artem [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=1328170449.28171.119.camel@sauron.fi.intel.com \
    --to=artem.bityutskiy@intel.com \
    --cc=21cnbao@gmail.com \
    --cc=adrian.hunter@intel.com \
    --cc=agust@denx.de \
    --cc=angus.clark@st.com \
    --cc=arnd@arndb.de \
    --cc=axel.lin@gmail.com \
    --cc=bigeasy@linutronix.de \
    --cc=cernekee@gmail.com \
    --cc=chuanxiao.dong@intel.com \
    --cc=computersforpeace@gmail.com \
    --cc=david.woodhouse@intel.com \
    --cc=dbaryshkov@gmail.com \
    --cc=dilinger@queued.net \
    --cc=error27@gmail.com \
    --cc=florian@openwrt.org \
    --cc=glecerf@gmail.com \
    --cc=ivan.djelic@parrot.com \
    --cc=jamie@jamieiles.com \
    --cc=jim2101024@gmail.com \
    --cc=joe@perches.com \
    --cc=jonas.gorski@gmail.com \
    --cc=juhosg@openwrt.org \
    --cc=kyungmin.park@samsung.com \
    --cc=leiwen@marvell.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux@dominikbrodowski.net \
    --cc=matthieu.castet@parrot.com \
    --cc=maximlevitsky@gmail.com \
    --cc=nicolas.ferre@atmel.com \
    --cc=pewi@gw-instruments.de \
    --cc=ricard.wanderlof@axis.com \
    --cc=robert.jarzmik@free.fr \
    --cc=roman.tereshonkov@nokia.com \
    --cc=s.hauer@pengutronix.de \
    --cc=segooon@gmail.com \
    --cc=shmulik.ladkani@gmail.com \
    --cc=vapier@gentoo.org \
    --cc=w.sang@pengutronix.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