All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Jarzmik <robert.jarzmik@free.fr>
To: Mike Dunn <mikedunn@newsguy.com>
Cc: Peter Horton <phorton@bitbox.co.uk>,
	linux-mtd@lists.infradead.org, dedekind1@gmail.com
Subject: Re: [PATCH v2] MTD: modify mtd api to return bitflip info on read operations
Date: Tue, 06 Dec 2011 22:52:29 +0100	[thread overview]
Message-ID: <87hb1de5b6.fsf@free.fr> (raw)
In-Reply-To: <4EDD142B.6090303@newsguy.com> (Mike Dunn's message of "Mon, 05 Dec 2011 10:57:47 -0800")

Mike Dunn <mikedunn@newsguy.com> writes:
> On 12/05/2011 09:09 AM, Peter Horton wrote:
>> Surely the check for "do we need to scrub ?" should be done lower down
>> otherwise all users of the mtd NAND interface (UBI / JFFS2 etc) are going to
>> have to re-implement those sysfs files and the corresponding checks.
> Well, anything higher up that wants to avail itself of this api change will need
> some rework regardless.  Currently the only info passed up from the driver is
> that at least one bitflip occurred somewhere during the read.  The plan is to
> eventually make some changes to UBI so that the decision to scrub is made more
> intelligently.

I'd like to second Mike's proposition here.

Policy should not be put into drivers code whenever possible. The question "do
we need to scrub" is to be answered in upper layers IMHO. Moreover, upper layer
would then have the choice to trigger scrubbing on their own policy. This policy
could rely on the information provided by the driver :
 - how much bitflips the ECC can fix

Even better, but I don't know how, the policy should be a userspace matter and
not a kernel one, as I was told many times before :)

Therefore, a upperlayer which strives at very high security level could scrub at
1 bitflip even if the ECC can fix 8. A "normal" upperlayer could go up to 8
before scrubbing.

Now for the "re-implement sysfs and checks", that's true. What could be done is
in a first time, copycat the current behaviour, ie. UBI scrubs if nb_bitflips >
0, and the same for JFFS I suppose.

Then in a second pass, add sysfs values for the trigger (whether in upperlayers
or MTD). This needs a consensus from the list.

Cheers.

-- 
Robert

  reply	other threads:[~2011-12-06 21:52 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 [this message]
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
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=87hb1de5b6.fsf@free.fr \
    --to=robert.jarzmik@free.fr \
    --cc=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mikedunn@newsguy.com \
    --cc=phorton@bitbox.co.uk \
    /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 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.