All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] always use partition wrappers; drivers return bitflips
@ 2011-12-20 18:42 Mike Dunn
  2011-12-20 18:42 ` [PATCH 1/2] MTD: pass driver methods through partition wrappers on unpartitioned devices Mike Dunn
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Mike Dunn @ 2011-12-20 18:42 UTC (permalink / raw)
  To: linux-mtd, linux-mtd
  Cc: Thomas Petazzoni, Lars-Peter Clausen, Mike Dunn, Scott Branden,
	Wan ZongShun, Artem Bityutskiy, Dmitry Eremin-Solenikov,
	Robert Jarzmik, Manuel Lauss, Haojian Zhuang, Kyungmin Park,
	Vimal Singh, Ralf Baechle, Jiandong Zheng, Andres Salomon,
	Olof Johansson, Jamie Iles, Brian Norris, David Woodhouse

Hi,

These two patches accomplish the goal of returning bitflip info from the drivers
to mtd without requiring the huge patch that results from changing the prototype
of the read() method.

The first patch ensures that driver methods always go through the wrappers in
the partitioning code by creating a "partition" that spans the entire device on
otherwise unpartitioned devices.

Now that the methods always pass through the mtd code via the partitioning
wrappers, the second patch tweaks the meaning of the return code from the
driver's read() and read_oob() methods.  Where previously, in the absence of a
hard error, the driver returned either -EUCLEAN (one or more bitflips were
corrected) or 0 (no bitflips), the driver now returns, absent an error, the
maximum number of bitflips corrected on any single page.  The original set of
possible values (and their meanings) returned from mtd to the higher layer
remains unchanged for now.

This bifurcation of the driver <-> mtd and mtd <-> higher layer is admitedly a
little kludgy and potentially confusing for driver writers, but has the
advantage of touching few files.  With two exceptions, all drivers for devices
with ecc capability go through the nand or onenand interfaces, limiting the
changes to the nand and onenand infrastructure code.  Absent an error, devices
without ecc already return 0 always, so they comply with the modified api by
default.

If this flies, I'll follow up with patches to implement the change in the
meaning of -EUCLEAN returned from mtd that was previously discussed. Otherwise,
I can resubmit the large patch with the change to the read() prototype in lieu
of patch 2/2.

Thanks,
Mike

Mike Dunn (2):
  MTD: pass driver methods through partition wrappers on unpartitioned
    devices
  MTD: read(), read_oob() driver methods return num bitflips

 drivers/mtd/devices/docg3.c        |    5 +++-
 drivers/mtd/mtdcore.c              |   17 ++++++++++++--
 drivers/mtd/mtdpart.c              |   39 +++++++++++++++++++++++++++--------
 drivers/mtd/nand/alauda.c          |    4 +-
 drivers/mtd/nand/nand_base.c       |   10 +++++++-
 drivers/mtd/onenand/onenand_base.c |    6 +++-
 6 files changed, 62 insertions(+), 19 deletions(-)

-- 
1.7.3.4

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

end of thread, other threads:[~2011-12-23 14:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-20 18:42 [PATCH 0/2] always use partition wrappers; drivers return bitflips Mike Dunn
2011-12-20 18:42 ` [PATCH 1/2] MTD: pass driver methods through partition wrappers on unpartitioned devices Mike Dunn
2011-12-22 12:34   ` Artem Bityutskiy
2011-12-22 23:28     ` Mike Dunn
2011-12-22 13:05   ` Artem Bityutskiy
2011-12-22 18:03     ` Artem Bityutskiy
2011-12-22 23:28       ` Mike Dunn
2011-12-23 14:47         ` Artem Bityutskiy
2011-12-22 23:28     ` Mike Dunn
2011-12-20 18:42 ` [PATCH 2/2] MTD: read(), read_oob() driver methods return num bitflips Mike Dunn
2011-12-21  8:10 ` [PATCH 0/2] always use partition wrappers; drivers return bitflips Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.