public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Johannes Stezenbach <js@linuxtv.org>
To: linux-mtd@lists.infradead.org
Subject: padding in mkfs.jffs2 and nandwrite
Date: Wed, 14 Dec 2005 16:37:40 +0100	[thread overview]
Message-ID: <20051214153740.GB10310@linuxtv.org> (raw)

Hi,

I've prepared a jffs2 image with mkfs.jffs2 and written it to
NAND flash using nandwrite (details below). When the file system
is mounted r/w and written to, on future mounts the following
warning appears:

	Empty flash at 0x000000f8 ends at 0x00000200

This is caused by the padding added by either mkfs.jffs2 -p512
or nandwrite -p, because this padding is 0xff, which jffs2
sees as "free space which was wasted" (when jffs2 flushes
a page to disk it pads with 0x00, so it can tell that this space
was deliberately left unused).
(I think this warning will evetually go away when the block is garbage
collected, but this can take a loooong time.)

To avoid this warning I would like to suggest that we either
change mkfs.jffs2 and nandwrite to pad with 0x00, or add
an option to both to choose the padding value.

One additional question: Why does mkfs.jffs2 -p by default
pad to the end of the erase block? When whole pages are written
with all 0xff, but the first N pages of an erase block contain
valid nodes, jffs2 will assume that these pages are freshly
erased and good to write in.
Won't this cause instable bits when written again by jffs2?
(The data sheet for my flash says that there may be up to
three partial page write before erase is needed, but I'm not sure
if this allows to write the same byte twice.)

What I currently do to avoid the issue:

$ mkfs.jffs2 -v -e16384 -d foo -b -n -q | dd bs=512 conv=sync >foo.jffs2
$ flash_eraseall -j /dev/mtd0
$ nandwrite /dev/mtd0 foo.jffs2


Johannes

             reply	other threads:[~2005-12-14 15:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-14 15:37 Johannes Stezenbach [this message]
2005-12-16 17:26 ` padding in mkfs.jffs2 and nandwrite Johannes Stezenbach

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=20051214153740.GB10310@linuxtv.org \
    --to=js@linuxtv.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