public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Brian Norris <computersforpeace@gmail.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>,
	Baruch Siach <baruch@tkos.co.il>,
	Dan Carpenter <error27@gmail.com>,
	Nicolas Ferre <nicolas.ferre@atmel.com>,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	Barry Song <barry.song@analog.com>,
	Gabor Juhos <juhosg@openwrt.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>,
	David Woodhouse <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>,
	Sukumar Ghorai <s-ghorai@ti.com>,
	Artem Bityutskiy <artem.bityutskiy@intel.com>,
	Florian Fainelli <florian@openwrt.org>,
	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>,
	Chuanxiao Dong <chuanxiao.dong@intel.com>,
	Joe Perches <joe@perches.com>,
	Guillaume LECERF <glecerf@gmail.com>,
	Roman Tereshonkov <roman.tereshonkov@nokia.com>,
	Adrian Hunter <adrian.hunter@nokia.com>
Subject: Re: [PATCH v2] mtd: nand: write bad block marker even with BBT
Date: Tue, 20 Dec 2011 09:49:55 +0100	[thread overview]
Message-ID: <4EF04C33.7060805@linutronix.de> (raw)
In-Reply-To: <1324332231-30884-1-git-send-email-computersforpeace@gmail.com>

On 12/19/2011 11:03 PM, 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. This can be a problem when:
>
>   * bootloader cannot read the flash-based BBT format
>   * BBT is corrupted and the flash must be rescanned for bad
>     blocks; we want to remember bad blocks that were marked from Linux
>
> In an attempt to keep the bad block markers in sync with the flash-based
> BBT, this patch changes the default so that we write bad block markers
> to the proper OOB area on each block in addition to flash-based BBT.
>
> Theoretically, the bad block table and the OOB markers can still get out
> of sync if the system experiences a power cut between writing the BBT to
> flash and writing the OOB marker to a newly-marked bad block. However,
> this is a relatively unlikely event, as new bad blocks shouldn't appear
> frequently.
>

The marker and BBT may get out of sync. You should use either the one 
_or_ the other but not both. Why use both anyway? I use BBT because I
have no room left in OOB or updating a single area in OOB is too
complicated / hardly possible.
In the former case, reading that area again and interpreting it as
something as it was once is a bad thing.

Why is the BBT corrupted? You have two tables. If one is broken you
have still the other. If you lose one block which was about to be
marked bad you find soon enough.

Sebastian

  parent reply	other threads:[~2011-12-20  8:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-19 22:03 [PATCH v2] mtd: nand: write bad block marker even with BBT Brian Norris
2011-12-19 22:16 ` Brian Norris
2011-12-20  8:49 ` Sebastian Andrzej Siewior [this message]
2011-12-20 18:17   ` Brian Norris
2011-12-20 20:49     ` Artem Bityutskiy
2011-12-22  1:15       ` Brian Norris
2011-12-23  8:13         ` Shmulik Ladkani
2012-01-06  3:10           ` Brian Norris

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=4EF04C33.7060805@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=David.Woodhouse@intel.com \
    --cc=adrian.hunter@nokia.com \
    --cc=agust@denx.de \
    --cc=arnd@arndb.de \
    --cc=artem.bityutskiy@intel.com \
    --cc=axel.lin@gmail.com \
    --cc=barry.song@analog.com \
    --cc=baruch@tkos.co.il \
    --cc=cernekee@gmail.com \
    --cc=chuanxiao.dong@intel.com \
    --cc=computersforpeace@gmail.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=randy.dunlap@oracle.com \
    --cc=robert.jarzmik@free.fr \
    --cc=roman.tereshonkov@nokia.com \
    --cc=s-ghorai@ti.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