linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] mtd api changed to return bitflips on read operations
@ 2011-11-29  1:01 Mike Dunn
  2011-11-29 13:40 ` Thomas Petazzoni
  2011-12-01  8:49 ` Artem Bityutskiy
  0 siblings, 2 replies; 8+ messages in thread
From: Mike Dunn @ 2011-11-29  1:01 UTC (permalink / raw)
  To: linux-mtd, linux-mtd
  Cc: Artem Bityutskiy, Lars-Peter Clausen, Mike Dunn, Scott Branden,
	Wan ZongShun, Dmitry Eremin-Solenikov, Robert Jarzmik,
	Sukumar Ghorai, Manuel Lauss, Haojian Zhuang, Kyungmin Park,
	Vimal Singh, Ralf Baechle, Jiandong Zheng, Andres Salomon,
	Olof Johansson, Jamie Iles, Brian Norris, David Woodhouse

Proposed mtd api change.

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
---
 include/linux/mtd/mtd.h |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 9f5b312..67f4bbc 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -81,6 +81,9 @@ struct mtd_erase_region_info {
  *		mode = MTD_OPS_PLACE_OOB or MTD_OPS_RAW)
  * @datbuf:	data buffer - if NULL only oob data are read/written
  * @oobbuf:	oob data buffer
+ * @max_bitflips: for read operations, greatest number of bit errors corrected
+ *                on any one minimum i/o unit (e.g., nand page)
+ *                (value returned to caller by the driver)
  *
  * Note, it is allowed to read more than one OOB area at one go, but not write.
  * The interface assumes that the OOB write requests program only one page's
@@ -95,6 +98,7 @@ struct mtd_oob_ops {
 	uint32_t	ooboffs;
 	uint8_t		*datbuf;
 	uint8_t		*oobbuf;
+	unsigned int	max_bitflips;
 };
 
 #define MTD_MAX_OOBFREE_ENTRIES_LARGE	32
@@ -201,8 +205,13 @@ struct mtd_info {
 	 */
 	struct backing_dev_info *backing_dev_info;
 
+	/*
+	 * max_bitflips returns to caller the greatest number of bit errors
+	 * corrected on any one minimum i/o unit (e.g., nand page)
+	 */
+	int (*read) (struct mtd_info *mtd, loff_t from, size_t len,
+		     size_t *retlen, u_char *buf, unsigned int *max_bitflips);
 
-	int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
 	int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
 
 	/* In blackbox flight recorder like scenarios we want to make successful
-- 
1.7.3.4

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

end of thread, other threads:[~2011-12-01 12:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-29  1:01 [PATCH 1/5] mtd api changed to return bitflips on read operations Mike Dunn
2011-11-29 13:40 ` Thomas Petazzoni
2011-12-01  9:08   ` Artem Bityutskiy
2011-12-01 11:22     ` Mike Dunn
2011-12-01 11:38       ` Artem Bityutskiy
2011-12-01 12:41         ` Mike Dunn
2011-12-01  8:49 ` Artem Bityutskiy
2011-12-01 11:06   ` Mike Dunn

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