linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Mike Dunn <mikedunn@newsguy.com>
Cc: Peter Horton <phorton@bitbox.co.uk>,
	Robert Jarzmik <robert.jarzmik@free.fr>,
	Ricard Wanderlof <ricard.wanderlof@axis.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH v2] MTD: modify mtd api to return bitflip info on read operations
Date: Mon, 12 Dec 2011 14:48:58 +0200	[thread overview]
Message-ID: <1323694138.24509.21.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <4EDFB142.6050208@newsguy.com>

[-- Attachment #1: Type: text/plain, Size: 1855 bytes --]

On Wed, 2011-12-07 at 10:32 -0800, Mike Dunn wrote:
> Hi Ricard, thanks for chiming in.
> 
> On 12/07/2011 12:01 AM, Ricard Wanderlof wrote:
> >
> >
> > So, something like this:
> > - The driver reports number of bit flips and current ECC strength etc to
> >   the mtd layer.
> > - Based on some userspace knob, the mtd framework reports -EUCLEAN if
> >   scrubbing is needed.
> > - Upper layers perform scrubbing if they want to (i.e. UBI) or not (i.e.
> >   JFFS2).
> 
> 
> Sounds like a nice compromise between user configurability and keeping the
> decision in the mtd layer.  The problem is that the read method currently goes
> directly to the driver, so all drivers would have to be patched.  The last patch
> I submitted was rejected as being too large.  And it can't be broken into
> smaller patches because they are interdependent and not bisectable. 
> Implementing this scheme would be an even larger patch, and the changes made to
> every driver would bear scrutiny.

Yeah, I think it is OK.

1. Sanitize MTD interfaces by turning mtd->kuku(buh, buh) to
mtd_kuku(mtd, buh, buh). This should be easy to do - introduce wrappers
which just call mtd->kuku(buh, buh).

Then you can add your ECC stuff to mtd_*() functions.

Careful with partitions - we want ECC levels to be per-partition, so
that one could set different scrublevels for different partitions. So I
guess your ECC stuff should be in partition functions.

I do not remember off-the top of my head how it is handled nowadays, but
in the past, when we had mtdpart as a separate module, it was possible
to bypass partition wrappers. You should make it so that even if there
are no partitions - everything goes via mtpart anyways. Nowadays mtdpart
is an integral part of mtd, so this should be easy to do.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2011-12-12 12:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-03 20:20 [PATCH v2] MTD: modify mtd api to return bitflip info on read operations Mike Dunn
2011-12-04  8:43 ` Peter Horton
2011-12-04 13:52   ` Mike Dunn
2011-12-04 14:43     ` Artem Bityutskiy
2011-12-04 14:55       ` Mike Dunn
2011-12-05  6:07         ` Artem Bityutskiy
2011-12-05 16:58           ` Mike Dunn
2011-12-05 17:09             ` Peter Horton
2011-12-05 18:57               ` Mike Dunn
2011-12-06 21:52                 ` Robert Jarzmik
2011-12-07  2:16                   ` Mike Dunn
2011-12-07  8:01                     ` Ricard Wanderlof
2011-12-07 18:32                       ` Mike Dunn
2011-12-12 12:48                         ` Artem Bityutskiy [this message]
2011-12-14 20:46                           ` Mike Dunn
2011-12-16 10:09                             ` Artem Bityutskiy
2011-12-07  9:42                   ` Peter Horton
2011-12-07 18:33                     ` Mike Dunn
2011-12-04 14:33 ` Artem Bityutskiy
2011-12-05  6:23 ` Artem Bityutskiy
2011-12-05 18:13   ` Mike Dunn
2011-12-05 21:16     ` Artem Bityutskiy

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=1323694138.24509.21.camel@sauron.fi.intel.com \
    --to=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mikedunn@newsguy.com \
    --cc=phorton@bitbox.co.uk \
    --cc=ricard.wanderlof@axis.com \
    --cc=robert.jarzmik@free.fr \
    /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;
as well as URLs for NNTP newsgroup(s).