From: Leon Pollak <leonp@plris.com>
To: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: Erase error does not mark smth in BBT
Date: Mon, 09 Dec 2013 17:02:29 +0200 [thread overview]
Message-ID: <2617855.2mDaZaEr79@leonp.plris.com> (raw)
In-Reply-To: <CAFLxGvyvB_tTsVm1j6H26W+its4+ko8Ug5vmSBk0zRp-t3HGuw@mail.gmail.com>
On Sunday 08 December 2013 15:43:33 Richard Weinberger wrote:
> On Sun, Dec 8, 2013 at 10:51 AM, Leon Pollak <leonp@plris.com> wrote:
> > Hello, all.
> > I am studying the code in nand_base.c
> > I thought that when erase command ends with an error, the
> > corresponding block will be marked as bad or in OOB or in BBT or in
> > both.
> > I think I walked through the code carefully, but did not find this
> > BBT/OOB treatment.
> >
> > Please, help me - where is my error?
>
> You're looking at the wrong layer. :-)
> Look at the users of mtd_block_markbad().
Thank you very much, Richard.
Yes, I understood my problem - I expected to see the BBT update on
erasure failure in the kernel driver.
But, as I understood after your hint and code study, the BBT update is
totally on the "user's" responsibility.
---
So, I went to the mtd-utils package.
And there I have the similar problem - when looking into the
flash_erase.c file I see the following:
if (mtd_erase(mtd_desc, &mtd, fd, eb) != 0) {
sys_errmsg("%s: MTD Erase failure", mtd_device);
continue;
}
and I was not able to find any usage of mtd_mark_bad.
Contrary, analyzing the nandwrite.c file, I found that the logic is as
following (lines 537-555):
1. Try to write block data.
2. If failed, try to erase this block.
3. If erased failed (EIO) mark the block as bad and restart from (1).
---
So, here the question comes:
If the block erasure already failed once (in flash_erase.c) - doesn't
this require the BBT update at this point?
Why do one need to retry to erase/program it?
AFAIK, most of NAND vendors state that the block once not erased is bad
and even if you succeeded to erase it afterwords, it is dangerous to
continue to use it.
Thank you very much for your help.
--
Leon
next prev parent reply other threads:[~2013-12-09 15:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-08 9:51 Erase error does not mark smth in BBT Leon Pollak
2013-12-08 14:43 ` Richard Weinberger
2013-12-09 15:02 ` Leon Pollak [this message]
2013-12-09 18:44 ` Brian Norris
2013-12-09 20:26 ` Richard Weinberger
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=2617855.2mDaZaEr79@leonp.plris.com \
--to=leonp@plris.com \
--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