From: Angus CLARK <angus.clark@st.com>
To: dedekind1@gmail.com
Cc: linux-mtd@lists.infradead.org, dwmw2@infradead.org,
Shmulik Ladkani <shmulik.ladkani@gmail.com>
Subject: Re: mtd nand erase and bad block
Date: Tue, 03 Jul 2012 16:05:06 +0100 [thread overview]
Message-ID: <4FF30A22.8040500@st.com> (raw)
In-Reply-To: <1341318170.2979.61.camel@sauron.fi.intel.com>
Hi Artem,
On 07/03/2012 01:22 PM, Artem Bityutskiy wrote:
> On Mon, 2012-07-02 at 08:14 +0100, Angus CLARK wrote:
>> On 06/29/2012 11:31 AM, Artem Bityutskiy wrote:
>>> On Wed, 2012-06-27 at 13:37 +0100, Angus CLARK wrote:
>>>> However, for case 2, I just want to force the erase operation so I can wipe the
>>>> BBTs and return the device as close as possible to its original state. We could
>>>> put some logic in the kernel, "if 'MEMBBSCRUB" on BBT blocks, do not
>>>> update/rewrite BBTs", but I think this "policy" decision would be better handled
>>>> in userspace.
>>>
>>> Sounds like you need 2 separate ioctls:
>>> 1. MEMBBSCRUB
>>
>> There are occasions when it is useful to unmark a bad block, but without erasing
>> first. Therefore, I guess my preference would be to split this further:
>> 'erase-bad-block' and 'mark-block-as-good'.
>
> I can smell over-engineering
Indeed. The solution I shared at the start of this thread involved a 3-line
patch to add a debugfs entry! This meets our own requirements for
debug/development, although I admit it is a little unsafe when used
inappropriately ;-)
> - any good example?
One example would to be regain access to blocks that were incorrectly identified
as bad during the creation of the BBTs. This can happen when the NAND device is
pre-programmed with a boot-loader or test-software, but the process used to
perform the pre-programming does not write the BBTs. If the ECC data is such
that it clashes with the OOB BBM, then linux will detect these as bad blocks on
first boot. Of course, the problem lies with the pre-programmer, but it is
helpful to get access to the blocks in linux without erasing the data first.
> Note, you will leave
> unused bytes in the ioctl data structure an make it extandable in the
> future.
So, are you suggesting that I implement a MEMBBSCRUB ioctl, with a flag to
indicate whether or not the BBTs should be updated (and some extra padding for
future-proofing)? Might have think about what happens when called on blocks
reserved for the BBTs...
Cheers,
Angus
next prev parent reply other threads:[~2012-07-03 15:06 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
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 [this message]
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=4FF30A22.8040500@st.com \
--to=angus.clark@st.com \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=shmulik.ladkani@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;
as well as URLs for NNTP newsgroup(s).