From: Shmulik Ladkani <shmulik.ladkani@gmail.com>
To: Angus CLARK <angus.clark@st.com>, dedekind1@gmail.com
Cc: dwmw2@infradead.org, linux-mtd@lists.infradead.org
Subject: Re: mtd nand erase and bad block
Date: Fri, 1 Jun 2012 17:54:07 +0300 [thread overview]
Message-ID: <20120601175407.7c39a8fb@halley> (raw)
In-Reply-To: <4FC8CBA7.6000702@st.com>
Hi Angus,
On Fri, 01 Jun 2012 15:03:19 +0100 Angus CLARK <angus.clark@st.com> wrote:
> Hi Shmulik,
>
> >>>
> >>> Typically, debugfs is only enabled in development environments, and even then it
> >>> requires explicit user action, so this method of enabling erasing bad blocks is
> >>> safe enough for our needs.
> >>
> >> Sounds ok to me, especially if you send the patch together with a piece
> >> of doc for the mtd web-site. I just think it is important to document
> >> this feature. Is this doable?
> >
> > I think we should prefer a local "allow erase bad blocks" policy than a
> > global one.
> >
> > This is because when the global debugfs flag is on, *every* mtd erase
> > operation might lead to erasure of bad blocks - not necessarily those
> > triggered by the user which set the flag prior issuing his 'flash_erase'
> > command.
> >
> > Meaning, other MTD users (ubi, various ffs) which currently work on
> > other mtd partitions, are suddenly relaxed and allowed to erase bad
> > blocks - which is probably not what user intented.
> >
> > I suggest to be more restrictive and have the "allow erase bad blocks"
> > propery be local policy, that is - per an erase request.
> >
> > And since we'll probably need this thing only for userspace erase
> > calls (e.g. flash_erase) - I suggest placing it into the MEMERASE ioctl.
> >
> > Comments?
> >
>
> I would agree to some extent. Enabling the "allow erase bad blocks" option per
> erase request would certainly be a safer solution. However, I suspect extending
> the existing MEMERASE/MEMERASE64 IOCTLs is not really an option. That leaves
> inventing another IOCTL, or perhaps adding another file mode, which would
> achieve per-file-descriptor scope, if not per-erase-request.
>
> My approach was largely motivated by the desire not to change the existing ABI,
> and/or mtd-utils. One could argue that such an option should only ever be
> enabled by someone who knows what they are doing, and that might include things
> like un-mounting any filesystems beforehand.
>
> To be honest, I am in two minds. The solution I have at present is very simple
> (or perhaps naive!), requires minimial changes to the kernel, no changes to
> mtd-utils, and can be disabled completely by not including debugfs (which is
> standard practice on production systems). On the other hand, the ability to
> enable per-erase-request is a safer and more elegant solution. However, it
> would require updates to mtd-utils, and agreement from the MTD community
> regarding changes to the ABI...
>
> What do you think?
To be honest, I'm in two minds either ;)
I completely understand the reasons and motivation for a global
debugfs option. And it seems as a reasonable compromise.
OTOH, adding a new ioctl makes sense as we're offering a functionality
that didn't exist before.
Anyways, I guess its up to David or Artem.
My personal preference would be:
1. A new ioctl (MEMSCRUB?)
2. debugfs flag, PER MTD PART (slightly safer than your global flag)
3. global debugfs flag
BTW what do you think about option (2)? Would you consider it, or do you
think it's an overdesign, if we already accept the debugfs way?
Regards,
Shmulik
next prev parent reply other threads:[~2012-06-01 14:54 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-31 12:12 mtd nand erase and bad block Matteo Facchinetti
2012-05-31 13:28 ` Adrian Hunter
2012-05-31 14:28 ` Matteo Facchinetti
2012-05-31 19:57 ` Shmulik Ladkani
2012-06-01 6:24 ` Adrian Hunter
2012-06-01 6:37 ` Ricard Wanderlof
2012-06-01 8:29 ` Angus CLARK
2012-06-01 8:42 ` Artem Bityutskiy
2012-06-01 11:04 ` Shmulik Ladkani
2012-06-01 14:03 ` Angus CLARK
2012-06-01 14:54 ` Shmulik Ladkani [this message]
2012-06-01 15:28 ` Angus CLARK
2012-06-05 12:17 ` Artem Bityutskiy
2012-06-14 17:48 ` Brian Norris
2012-06-14 21:31 ` Shmulik Ladkani
2012-06-15 6:55 ` Angus CLARK
2012-06-26 22:10 ` Tomer Barletz
2012-06-18 9:34 ` Angus CLARK
2012-06-27 9:54 ` Artem Bityutskiy
2012-06-27 12:37 ` Angus CLARK
2012-06-29 10:31 ` Artem Bityutskiy
2012-07-02 7:14 ` Angus CLARK
2012-07-03 12:22 ` Artem Bityutskiy
2012-07-03 15:05 ` Angus CLARK
2012-07-16 14:37 ` 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=20120601175407.7c39a8fb@halley \
--to=shmulik.ladkani@gmail.com \
--cc=angus.clark@st.com \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
/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).