public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: Mike Dunn <mikedunn@newsguy.com>
Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Jamie Iles <jamie@jamieiles.com>,
	Scott Branden <sbranden@broadcom.com>,
	Wan ZongShun <mcuos.com@gmail.com>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Andres Salomon <dilinger@queued.net>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Manuel Lauss <manuel.lauss@googlemail.com>,
	linux-mtd@lists.infradead.org, Ralf Baechle <ralf@linux-mips.org>,
	Jiandong Zheng <jdzheng@broadcom.com>,
	Sukumar Ghorai <s-ghorai@ti.com>, Olof Johansson <olof@lixom.net>,
	Vimal Singh <vimal.newwork@gmail.com>,
	Brian Norris <computersforpeace@gmail.com>,
	Robert Jarzmik <robert.jarzmik@free.fr>
Subject: Re: [PATCH 1/5] mtd api changed to return bitflips on read operations
Date: Tue, 29 Nov 2011 14:40:42 +0100	[thread overview]
Message-ID: <20111129144042.1979a587@skate> (raw)
In-Reply-To: <1322528477-19666-1-git-send-email-mikedunn@newsguy.com>

Le Mon, 28 Nov 2011 17:01:17 -0800,
Mike Dunn <mikedunn@newsguy.com> a écrit :

> +	/*
> +	 * 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);

Making this change in patch 1 will break the build if someone bisects
kernel changes between patch 1 and your other patches.

Also, seeing the large number of users that don't use/need the new
max_bitflips argument, wouldn't it be better to add a new, separate
->readext() operation (or another better name) ? This would probably
reduce the patch size quite a bit.

Also, another option is to allow max_bitflips to be NULL, which would
simplify things such as :

+	unsigned int max_bitflips;
 
-	ret = mtd->read(mtd, ptr, sizeof(fs), &sz, (u_char *) &fs);
+	ret = mtd->read(mtd, ptr, sizeof(fs), &sz, (u_char *) &fs,
+			&max_bitflips);


to

-	ret = mtd->read(mtd, ptr, sizeof(fs), &sz, (u_char *) &fs);
+	ret = mtd->read(mtd, ptr, sizeof(fs), &sz, (u_char *) &fs,
+			NULL);

and would therefore avoid the need for defining an useless variable.

Another question: is the max_bitflips information sufficient (i.e on a
large read with multiple pages, you will only get the value for the
worst page) ? Don't you need the bitflip count on a per-page basis ?

Regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

  reply	other threads:[~2011-11-29 13:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=20111129144042.1979a587@skate \
    --to=thomas.petazzoni@free-electrons.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=mikedunn@newsguy.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