public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Mike Dunn <mikedunn@newsguy.com>
To: linux-mtd@lists.infradead.org
To: linux-mtd@lists.infradead.org
Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Mike Dunn <mikedunn@newsguy.com>,
	Scott Branden <sbranden@broadcom.com>,
	Wan ZongShun <mcuos.com@gmail.com>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	Robert Jarzmik <robert.jarzmik@free.fr>,
	Sukumar Ghorai <s-ghorai@ti.com>,
	Manuel Lauss <manuel.lauss@googlemail.com>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Vimal Singh <vimal.newwork@gmail.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	Jiandong Zheng <jdzheng@broadcom.com>,
	Andres Salomon <dilinger@queued.net>,
	Olof Johansson <olof@lixom.net>, Jamie Iles <jamie@jamieiles.com>,
	Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>
Subject: [PATCH 0/5] MTD: modify mtd api to return bitflip info on read operations
Date: Mon, 28 Nov 2011 16:58:35 -0800	[thread overview]
Message-ID: <1322528315-19631-1-git-send-email-mikedunn@newsguy.com> (raw)

Hi,

These patches propose a change to the mtd API for the purpose of returning to
the caller information on the number of bit errors corrected by the ecc
facilities of the device during read operations.  The affected functions are
read() and read_oob().

Currently, the -EUCLEAN value returned by read() and read_oob() is the only
information available to the caller regarding bit error corrections.  This
return value indicates simply that one or more bit errors were corrected.  To
make matters worse, this applies to the entire read operation, which can
potentially span the entire device.  Some NAND flash chips are error prone, and
compensate for that by using strong ecc algorithms capable of correcting
multiple errors in a single page.  In order for higher level code (e.g. UBI) to
effectively detect degradation of the integrity of erase blocks on these
devices, more detailed information is needed.

For the read() method, an unsigned int * argument is added, which the driver
uses to return to the caller the maximum number of bitflips that were corrected
on any single page.  For read_oob(), an element is added to the mtd_oob_ops
structure for the same purpose.  Devices without ecc capabilities (NOR flash,
etc) would simply set the value to 0.

The first patch shows the propsed api change, and the remainder implement it
throughout the mtd subsystem.  It has been tested on mtdram, nandsim,
onenandsim, and the diskonchip G4 flash (nand driver currently out-of-tree), on
partitioned and unpartitioned devices.  Drivers for other devices have been
compile-tested only, but the changes are trivial in most cases.  Comments,
criticisms, objections, gratefully received.

Thanks,
Mike


Mike Dunn (5):
  mtd api changed to return bitflips on read operations
  backport mtd api change to mtd infrastructure
  backport mtd api change to nand, onenand infrastructure
  backport mtd api change to ubi
  backport mtd api change to everything else: devices, chips,
    partitioning, translation layers, etc

 drivers/mtd/afs.c                   |    8 +++++-
 drivers/mtd/ar7part.c               |   10 +++++---
 drivers/mtd/chips/cfi_cmdset_0001.c |    9 +++++--
 drivers/mtd/chips/cfi_cmdset_0002.c |    9 +++++--
 drivers/mtd/chips/cfi_cmdset_0020.c |    9 +++++--
 drivers/mtd/chips/map_absent.c      |    9 +++++--
 drivers/mtd/chips/map_ram.c         |    7 ++++-
 drivers/mtd/chips/map_rom.c         |    7 ++++-
 drivers/mtd/devices/block2mtd.c     |    5 +++-
 drivers/mtd/devices/doc2000.c       |    8 ++++--
 drivers/mtd/devices/doc2001.c       |    8 +++++-
 drivers/mtd/devices/doc2001plus.c   |    7 ++++-
 drivers/mtd/devices/docg3.c         |    5 +++-
 drivers/mtd/devices/lart.c          |    4 ++-
 drivers/mtd/devices/m25p80.c        |    4 ++-
 drivers/mtd/devices/ms02-nv.c       |    5 ++-
 drivers/mtd/devices/mtd_dataflash.c |    5 ++-
 drivers/mtd/devices/mtdram.c        |    3 +-
 drivers/mtd/devices/phram.c         |    4 ++-
 drivers/mtd/devices/pmc551.c        |    5 +++-
 drivers/mtd/devices/slram.c         |    7 ++++-
 drivers/mtd/devices/sst25l.c        |    5 +++-
 drivers/mtd/ftl.c                   |   34 ++++++++++++++++++++---------
 drivers/mtd/inftlcore.c             |    9 +++++--
 drivers/mtd/inftlmount.c            |    9 +++++--
 drivers/mtd/lpddr/lpddr_cmds.c      |    4 +-
 drivers/mtd/maps/bcm963xx-flash.c   |    7 ++++-
 drivers/mtd/mtdblock.c              |   11 +++++++--
 drivers/mtd/mtdblock_ro.c           |    4 ++-
 drivers/mtd/mtdchar.c               |   16 +++++++++----
 drivers/mtd/mtdconcat.c             |   12 +++++++---
 drivers/mtd/mtdoops.c               |    4 ++-
 drivers/mtd/mtdpart.c               |    4 +-
 drivers/mtd/mtdswap.c               |    7 ++++-
 drivers/mtd/nand/diskonchip.c       |    6 +++-
 drivers/mtd/nand/nand_base.c        |   19 ++++++++++++++--
 drivers/mtd/nand/nand_bbt.c         |   11 +++++++--
 drivers/mtd/nftlcore.c              |    9 +++++--
 drivers/mtd/nftlmount.c             |    9 +++++--
 drivers/mtd/onenand/onenand_base.c  |    5 +++-
 drivers/mtd/redboot.c               |    4 ++-
 drivers/mtd/rfd_ftl.c               |   18 +++++++++++----
 drivers/mtd/ssfdc.c                 |    7 ++++-
 drivers/mtd/tests/mtd_pagetest.c    |   40 ++++++++++++++++++++++------------
 drivers/mtd/tests/mtd_readtest.c    |    4 ++-
 drivers/mtd/tests/mtd_speedtest.c   |   12 +++++++---
 drivers/mtd/tests/mtd_stresstest.c  |    3 +-
 drivers/mtd/tests/mtd_subpagetest.c |   13 +++++++---
 drivers/mtd/tests/mtd_torturetest.c |    3 +-
 drivers/mtd/ubi/io.c                |    9 +++++--
 include/linux/mtd/mtd.h             |   11 ++++++++-
 include/linux/mtd/pmc551.h          |    3 +-
 52 files changed, 315 insertions(+), 135 deletions(-)

-- 
1.7.3.4

             reply	other threads:[~2011-11-29  1:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-29  0:58 Mike Dunn [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-11-30 17:27 [PATCH 0/5] MTD: modify mtd api to return bitflip info on read operations Mike Dunn
2011-11-30 17:06 ` Thomas Petazzoni

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=1322528315-19631-1-git-send-email-mikedunn@newsguy.com \
    --to=mikedunn@newsguy.com \
    --cc=Artem.Bityutskiy@nokia.com \
    --cc=computersforpeace@gmail.com \
    --cc=dbaryshkov@gmail.com \
    --cc=dilinger@queued.net \
    --cc=dwmw2@infradead.org \
    --cc=haojian.zhuang@gmail.com \
    --cc=jamie@jamieiles.com \
    --cc=jdzheng@broadcom.com \
    --cc=kyungmin.park@samsung.com \
    --cc=lars@metafoo.de \
    --cc=linux-mtd@lists.infradead.org \
    --cc=manuel.lauss@googlemail.com \
    --cc=mcuos.com@gmail.com \
    --cc=olof@lixom.net \
    --cc=ralf@linux-mips.org \
    --cc=robert.jarzmik@free.fr \
    --cc=s-ghorai@ti.com \
    --cc=sbranden@broadcom.com \
    --cc=vimal.newwork@gmail.com \
    /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