public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Kevin Paul Herbert <kevin.herbert@meraki.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] ubi: Add support for UBI PEB sizes that are a multiple of the erase size
Date: Fri, 14 Oct 2011 17:15:09 +0300	[thread overview]
Message-ID: <1318601716.12351.137.camel@sauron> (raw)
In-Reply-To: <20111014011436.2E298A1DDB@snowflake>

On Thu, 2011-10-13 at 18:14 -0700, Kevin Paul Herbert wrote:
> Add support for UBI PEB sizes that are a multiple of the erase size.
> This allows for portability between UBI volumes on FLASH devices,
> as long as a common multiple of the erase size is used on all FLASH
> devices.
> 
> In order to implement this feature, a new field was added to the
> erase block header, which must be initialized by the ubinize tool.
> This new peb_size field in the ubi_ec_hdr was previously initialized
> as zero, so existing PEBs with this field containing zero are assumed
> to be using a PEB which is equal to the erase size. At attach time,
> the first erase block without errors is scanned for, looking for a
> PEB size field. If this field is non-zero, it is required to be a
> multiple of the erase size, and all subsequent PEBs are required to
> have the same value.
> 
> PEBs are required to be aligned on boundaries that are a multiple
> of the PEB size. This means that in the case of a bad block in NAND,
> rather than skipping to the next block, one must skip to the next
> properly aligned block. All checks for bad blocks now consider
> any bad block in the cluster to make the entire cluster bad.
> Otherwise, it would be impossible to determine boundaries when
> a block became bad.
> 
> Signed-off-by: Kevin Paul Herbert <kph@meraki.net>

Sorry, but why you decided to do this in UBI instead of trying to do
this in MTD level? I think it would require a bit more work mainly
because of strange MTD interface, which would need to be changed, but
that would mean that JFFS2 and other users would benefit.

I really did not think hard about this, but off the top of my head it
looks like you need:

1. Add new MTD interface and introduce stuff like:

mtd_read()
mtd_write()
mtd_mark_bad()
etc

which will just call mtd->read(), etc.

2. Add a new interface: mtd_concat_eraseblocks(2) or you name it, I can
use this function to tell MTD that I want it to make erasblocks to be
double size.

3. Modify mtd_read() etc to handle double erasblock sizes.

Wouldn't this be cleaner?

-- 
Best Regards,
Artem Bityutskiy

  reply	other threads:[~2011-10-14 14:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-14  1:14 [PATCH] ubi: Add support for UBI PEB sizes that are a multiple of the erase size Kevin Paul Herbert
2011-10-14 14:15 ` Artem Bityutskiy [this message]
2011-10-14 19:23   ` Kevin Paul Herbert

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=1318601716.12351.137.camel@sauron \
    --to=dedekind1@gmail.com \
    --cc=kevin.herbert@meraki.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