All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Wagner <david.wagner@free-electrons.com>
To: linux-mtd@lists.infradead.org
Cc: kmpark@infradead.org
Subject: impact of 2X_PROGRAM on read operations
Date: Mon, 06 Jun 2011 14:12:15 +0200	[thread overview]
Message-ID: <4DECC41F.5060808@free-electrons.com> (raw)

Hello,

I have been trying to understand what does the 2X_PROGRAM configuration
(and the IS_2PLANE macro).
At first, I was confused to see that, in onenand_command(), when the
command is "READ", the IS_2PLANE macro modifies the block and page
address. I was expecting this option only to affect program operations.
Then, after seeing jffs2 not finding its magic bitmask after switching
the 2X_PROGRAM configuration off, I understood that, since the 2X
Program only programs one OOB for two blocks, the read operations had to
be impacted anyway.

So, is the following right/almost/wrong ?
Let the size of physical pages/block sizes be 2KiB/128KiB
A filesystem on top of a 2X_PROGRAM-enabled mtd layer sees 4KiB-big
pages. When this FS wants to read one 4KiB page, the mtd layer will read
2KiB pages, two times. The layout of the blocks and pages is:


       Even plane           Odd plane
+--------------------+--------------------+
|        page 0      |  page 1   (oob 0&1)| <---  one logical page
|        page 2      |  page 3   (oob 2&3)|    as seen by a filesystem
|        page 4      |  page 5   (oob 4&5)|
|          .         |          .         |
|          .         |          .         |
|          .         |          .         |
| (Block 0)          | (Block 1)          |
+--------------------+--------------------+
|       page 128     | page 129 (oob)     |
|          .         |          .         |
|          .         |          .         |
|          .         |          .         |
| (Block 2)          | (Block 3)          |
+--------------------+--------------------+

(the page number is not the one that would be computed within
onenand_command but indicates the order in which pages get read or
programmed.)



Is there a way to safely read without 2X_PROGRAM enabled once it has
been flashed with a 2X_PROGRAM-enabled flasher (e.g. patched u-boot).


Regards,
David Wagner.
-- 
David Wagner, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

             reply	other threads:[~2011-06-06 12:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-06 12:12 David Wagner [this message]
2011-06-06 14:32 ` impact of 2X_PROGRAM on read operations Artem Bityutskiy
2011-06-09 12:44   ` David Wagner
2011-06-09 13:01     ` Kyungmin Park

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=4DECC41F.5060808@free-electrons.com \
    --to=david.wagner@free-electrons.com \
    --cc=kmpark@infradead.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 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.