linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] Bad block markers here, there and everywhere
@ 2013-11-05 12:00 Ezequiel Garcia
  2013-11-05 12:00 ` [PATCH 1/1] mtd: nand: Allow bad block markers to be found in the data region Ezequiel Garcia
  2013-11-05 18:07 ` [PATCH 0/1] Bad block markers here, there and everywhere Brian Norris
  0 siblings, 2 replies; 7+ messages in thread
From: Ezequiel Garcia @ 2013-11-05 12:00 UTC (permalink / raw)
  To: linux-mtd
  Cc: Lior Amsalem, Thomas Petazzoni, Tawfik Bayouk, Artem Bityutskiy,
	Huang Shijie, Ezequiel Garcia, Gregory Clement, Brian Norris,
	David Woodhouse

Hi everyone,

This commit adds a new option called NAND_BBT_DATA_BBM. The change itself
is pretty small and simple to understand: when the badblock_pattern sets the
NAND_BBT_DATA_BBM option, scan_block_fast() reads the data region instead
of the OOB region.

So, let me explain why we need this new feature.

Some NAND controllers provide its own unique view of a device page, where the
page is partitioned into several DATA,OOB regions. In other words, a flash that's
specified by the manufacturer:

|-------------------------|
|         DATA      | OOB |
|-------------------------|

is actually handled by the driver/controller as:

|-------------------------|
| DATA | OOB | DATA | OOB |
|-------------------------|

Now, this has a peculiar side-effect: the bad block marker is located at
position that is regarded as the data region in the controller's view.

Therefore, when the device is scanned for bad blocks (for the first
time) and the bad block table is built using the factory-marked blocks,
these markers are never found.

To address this case, we introduce a new option NAND_BBT_DATA_BBM.
Such option is used to read the data region of a a given page, instead
of the oob region, in the scan_block_fast() function. The page is read
as usual, using the length and offset parameters set in the bad block pattern.

Given drivers can customize the bad block pattern to match its specific
requirements, the new option allows to search for a bad block marker at
*any* position within a page.

This feature would be important and helpful to deal with the Armada 370/XP
(pxa3xx-nand driver) bad block markers factory (initial) detection.
Details about the NAND controller can be found in the last patchset:

  https://lwn.net/Articles/571062/

Also, it seems gpmi-nand would also benefit from this feature. The gpmi-nand
driver seem to go through great pains to deal with this case. So, instead of
doing weird things at a driver level we can just handle this in the core code.

So, how does it look?

Ezequiel Garcia (1):
  mtd: nand: Allow bad block markers to be found in the data region

 drivers/mtd/nand/nand_bbt.c | 11 +++++++++--
 include/linux/mtd/bbm.h     |  4 ++++
 2 files changed, 13 insertions(+), 2 deletions(-)

-- 
1.8.1.5

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-11-14 21:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-05 12:00 [PATCH 0/1] Bad block markers here, there and everywhere Ezequiel Garcia
2013-11-05 12:00 ` [PATCH 1/1] mtd: nand: Allow bad block markers to be found in the data region Ezequiel Garcia
2013-11-05 18:07 ` [PATCH 0/1] Bad block markers here, there and everywhere Brian Norris
2013-11-05 23:01   ` Ezequiel Garcia
2013-11-05 23:15     ` Ezequiel Garcia
2013-11-14 18:58       ` Ezequiel Garcia
2013-11-14 21:52         ` Brian Norris

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