From: Heiko Schocher <hs@denx.de>
To: Brian Norris <computersforpeace@gmail.com>
Cc: Liu Shuo <b35362@freescale.com>,
linux-mtd@lists.infradead.org,
Artem Bityutskiy <dedekind1@gmail.com>
Subject: Re: mtd-util, flash_erase: MEMGETOOBSEL on davinci based board fail
Date: Wed, 21 Sep 2011 08:37:55 +0200 [thread overview]
Message-ID: <4E798643.8040400@denx.de> (raw)
In-Reply-To: <CAN8TOE9+ZjOADOqRD7aDj8ng92bkfh9Ev5f3fSMQaEfD-=t8ow@mail.gmail.com>
Hello Brian,
Brian Norris wrote:
> Add Liu Shuo, who was interested in similar problems with `flash_erase -j'.
>
> On Tue, Sep 20, 2011 at 6:27 AM, Heiko Schocher <hs@denx.de> wrote:
>> Artem Bityutskiy wrote:
>>> Sorry, this is the right link:
>>> http://git.infradead.org/mtd-utils.git
>> with this tree and the brian branch I get:
>>
>> root@armv5te:/home/hs/bmk/mtd-utils# ./flash_erase -j /dev/mtd7 0 0
>> flash_erase: error!: /dev/mtd7: unable to get NAND oobinfo
>> error 22 (Invalid argument)
>> root@armv5te:/home/hs/bmk/mtd-utils#
>>
>> :-(
>>
>> As I see in mtd-util:flash_erase.c line 197:
>>
>> if (ioctl(fd, MEMGETOOBSEL, &oobinfo) != 0)
>> ^^^^^^^^^^^^
>> this is the "old" style ... which fails ...
>
> Right, I haven't fixed all uses of MEMGETOOBSEL yet, and I definitely
> didn't touch flash_erase yet, although the mechanisms are available
> now.
>
> I have provided ioctl(MEMWRITE) which, in addition to simply writing
> data, has information about write mode that should replace
> MEMGETOOBSEL. Particularly, you would be interested in
> MTD_OPS_AUTO_OOB, which should be the only autoplacement routine
> necessary. The `brian' branch that Artem mentions provides support in
> libmtd for using the MEMWRITE ioctl, but nandwrite is the only utility
> that uses it properly right now.
>
> So the next step is for you (Heiko, Liu, or somebody else that wants
> `flash_erase -j') to replace:
>
> `ioctl(MEMGETOOBSEL)' plus `mtd_write_oob()'
>
> with
>
> `mtd_write()' using mode `MTD_OPS_AUTO_OOB'
Thanks for your explanation! I have to look in this deeper.
> I think it shouldn't be too difficult, but I do not have testing for
> JFFS2. I recommend trying to cut out all the manual layout stuff from
> flash_erase.c and instead making sure that `legacy_auto_oob_layout()'
> has up-to-date support for old layout methods (i.e., MEMGETOOBSEL),
> then for forward progress, you only need to make sure that the
> in-kernel MTD_OPS_AUTO_OOB works as desired. No more duplication of
> "auto" layouts in nandwrite, flash_erase, and in-kernel; just
> in-kernel handling of "auto" mode and legacy libmtd functions for
> supporting the old way.
>
> Let me know if you have questions about my MEMWRITE changes. I would
> be happy to clarify if needed.
Thanks!
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
prev parent reply other threads:[~2011-09-21 6:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-20 7:58 mtd-util, flash_erase: MEMGETOOBSEL on davinci based board fail Heiko Schocher
2011-09-20 8:08 ` Artem Bityutskiy
2011-09-20 8:20 ` Heiko Schocher
2011-09-20 11:27 ` Artem Bityutskiy
2011-09-20 12:45 ` Artem Bityutskiy
2011-09-20 12:51 ` Heiko Schocher
2011-09-20 13:27 ` Heiko Schocher
2011-09-20 20:48 ` Brian Norris
2011-09-21 6:37 ` Heiko Schocher [this message]
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=4E798643.8040400@denx.de \
--to=hs@denx.de \
--cc=b35362@freescale.com \
--cc=computersforpeace@gmail.com \
--cc=dedekind1@gmail.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 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.