From: Mike Dunn <mikedunn@newsguy.com>
To: linux-mtd@lists.infradead.org
Cc: thomas.petazzoni@free-electrons.com
Subject: Re: [PATCH 0/5] MTD: modify mtd api to return bitflip info on read operations
Date: Wed, 30 Nov 2011 17:27:19 -0000 [thread overview]
Message-ID: <4ED66140.8020008@newsguy.com> (raw)
Thanks Thomas. For some reason this post never made it to my inbox. Pasted from the list archive...
Le Mon, 28 Nov 2011 17:01:17 -0800,
Mike Dunn <mikedunn at newsguy.com <http://lists.infradead.org/mailman/listinfo/linux-mtd>> 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.
Then I guess it should be a single patch. As a general rule, should individual patches
not be interdependent?
> 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.
Well, then it wouldn't be a generic mtd read operation, and higher layers would have to be
aware of the type of device and call the appropriate read function.
Fewer drivers would need to be patched, but patches to infrastructure code would be complicated
and make the resulting code ugly, I think.
> 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.
Yes, you're right. I will do this in the next patch.
> 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 ?
I'm not a flash expert, but I think that the greatest number of bitflips on any one page
is a sufficient diagnostic of the integrity of an eraseblock. One bad page will make the
entire eraseblock unusable, so I'm not sure it's useful to report bitflips for specific pages.
Maybe some other statistics would be useful, such as the total number of bitflips during the
read operation, but I didn't want to make it unnecesarily complicated, and it's a vast
improvement over the current state of affairs.
Thanks again Thomas. I hope some others will offer opinions. Resolving this is the first step toward
getting a robust ubifs on my nand flash!
Mike
next reply other threads:[~2011-11-30 17:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-30 17:27 Mike Dunn [this message]
2011-11-30 17:06 ` [PATCH 0/5] MTD: modify mtd api to return bitflip info on read operations Thomas Petazzoni
-- strict thread matches above, loose matches on Subject: below --
2011-11-29 0:58 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=4ED66140.8020008@newsguy.com \
--to=mikedunn@newsguy.com \
--cc=linux-mtd@lists.infradead.org \
--cc=thomas.petazzoni@free-electrons.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