From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
To: Hans Zhang <zhanghonghui@innofidei.com>
Cc: Richard Genoud <richard.genoud@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
linux-mtd <linux-mtd@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
zhouguangming@innofidei.com
Subject: Re: [PATCH] Make the mtdblock read/write skip the bad nand sector
Date: Mon, 25 Nov 2013 08:52:39 -0300 [thread overview]
Message-ID: <20131125115238.GC2408@localhost> (raw)
In-Reply-To: <529334D9.2030204@innofidei.com>
On Mon, Nov 25, 2013 at 07:30:33PM +0800, Hans Zhang wrote:
> On 2013/11/25 18:23, Richard Genoud wrote:
> >
> > Well, yes, write through the char device would be a solution.
> >> But, *why* are you writing through mtdblock instead?
> >>
> >>> I think that maybe it's an optional approach through mtdblock in case we do not have
> >>> the mtd-tools in our environments, we do provider a simpler way to write the NAND
> >>> through mtdblock.
> >>>
> >> Uh? simpler? Writing through mtdchat is as simple as it gets:
> >>
> >> $ cat some_file.img > /dev/mtd0
> >>
> >> Sorry, but I'm still confused at what are you trying to accomplish.
> > I think that what Hans wants to do is:
> > $ cat some_file.img > /dev/mtd0
> > And that doesn't fail on a bad block but jumps over it.
> > ... Which is a bad idea.
> > But, likeyou, I didn't figured out why mtdblock instead of mtdchar.
> >
> >
>
> I'm sorry it's my mistake, I thought the NAND need to be erased explicitly in userspace
> before written when through the mtdchar device. That's why I use the mtdblock instead of
> mtdchar.
>
Your understanding is correct: NAND *must* be erased explictly in userspace
before writing. However, keep in mind the following additional constraints:
* Writing should be always performed using 'nandwrite',
not tools such as 'cat' or 'dd'.
* An mtdblock shouldn't be used to access directly the NAND from
userspace. AFAICS, the primarily usage of mtdblock is to be able to
mount JFFS2.
Out of curiosity, what's your NAND layout? What FS are you using?
Unless you have some special requirement, you should be using UBI to
access the device (and not MTD).
Just a suggestion...
--
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
next prev parent reply other threads:[~2013-11-25 11:53 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-21 8:54 [PATCH] Make the mtdblock read/write skip the bad nand sector Hans Zhang
2013-11-21 10:59 ` Richard Genoud
2013-11-22 1:22 ` Hans Zhang
2013-11-22 1:52 ` Ezequiel Garcia
2013-11-22 2:10 ` Hans Zhang
2013-11-22 8:14 ` Richard Weinberger
2013-11-22 11:45 ` Ezequiel Garcia
2013-11-25 1:29 ` Hans Zhang
2013-11-25 10:11 ` Ezequiel Garcia
2013-11-25 10:23 ` Richard Genoud
2013-11-25 11:30 ` Hans Zhang
2013-11-25 11:52 ` Ezequiel Garcia [this message]
2013-11-25 12:16 ` David Woodhouse
2013-11-25 12:30 ` Ezequiel Garcia
2013-11-25 15:12 ` Peter Korsgaard
2013-11-25 15:46 ` David Woodhouse
2013-11-29 13:26 ` Pavel Machek
2013-12-10 7:43 ` Brian Norris
-- strict thread matches above, loose matches on Subject: below --
2013-11-21 8:39 Hans Zhang
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=20131125115238.GC2408@localhost \
--to=ezequiel.garcia@free-electrons.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=richard.genoud@gmail.com \
--cc=zhanghonghui@innofidei.com \
--cc=zhouguangming@innofidei.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