Skip to contentSkip to conversation

please pull UBI tree

GIT-PULL Artem Bityutskiy 6 participants 8 messages Apr 27, 2007

lore
Share & tools
lore
#0 lore raw

Linus, please, pull UBI tree from
git://git.infradead.org/ubi-2.6.git for-linus

The UBI tree has been in -mm for several releases and we would like to see it in the mainline.

We have several groups using UBI now and it has proved to be fairly stable. We've also got some feedback from community. We have also sent UBI for review to LKML several times, got feedback, and fixed what was requested.

In short, UBI provides wear-leveling support across the whole flash chip. UBI completely hides 2 aspects of flash chips which make them very difficult to work with:
1. wear of eraseblocks;
2. bad eraseblocks.

UBI also makes it possible to dynamically create, delete and re-size flash partitions (UBI volumes). So here some analogy to LVM may be pointed.

We are using UBI to develop a new flash file system on top, because it encapsulates most of the media-related complexities and make it possible to concentrate on file-system problems, instead on of solving flash media problems.

There is some documentation available at:
http://www.linux-mtd.infradead.org/doc/ubi.html
http://www.linux-mtd.infradead.org/faq/ubi.html

The sources are available via the GIT tree:
git://git.infradead.org/ubi-2.6.git

One can also browse the GIT tree using http://git.infradead.org/

 MAINTAINERS                   |    8 +
 drivers/mtd/Kconfig           |    2 +
 drivers/mtd/Makefile          |    2 +
 drivers/mtd/ubi/Kconfig       |   58 ++
 drivers/mtd/ubi/Kconfig.debug |  104 +++
 drivers/mtd/ubi/Makefile      |    7 +
 drivers/mtd/ubi/build.c       |  848 +++++++++++++++++++++
 drivers/mtd/ubi/cdev.c        |  722 ++++++++++++++++++
 drivers/mtd/ubi/debug.c       |  224 ++++++
 drivers/mtd/ubi/debug.h       |  161 ++++
 drivers/mtd/ubi/eba.c         | 1241 ++++++++++++++++++++++++++++++
 drivers/mtd/ubi/gluebi.c      |  323 ++++++++
 drivers/mtd/ubi/io.c          | 1259 +++++++++++++++++++++++++++++++
 drivers/mtd/ubi/kapi.c        |  575 ++++++++++++++
 drivers/mtd/ubi/misc.c        |  105 +++
 drivers/mtd/ubi/scan.c        | 1368 +++++++++++++++++++++++++++++++++
 drivers/mtd/ubi/scan.h        |  167 ++++
 drivers/mtd/ubi/ubi.h         |  535 +++++++++++++
 drivers/mtd/ubi/upd.c         |  348 +++++++++
 drivers/mtd/ubi/vmt.c         |  809 ++++++++++++++++++++
 drivers/mtd/ubi/vtbl.c        |  809 ++++++++++++++++++++
 drivers/mtd/ubi/wl.c          | 1671 +++++++++++++++++++++++++++++++++++++++++
 fs/jffs2/fs.c                 |   12 +
 fs/jffs2/os-linux.h           |    6 +
 fs/jffs2/wbuf.c               |   24 +
 include/linux/mtd/ubi.h       |  202 +++++
 include/mtd/Kbuild            |    2 +
 include/mtd/mtd-abi.h         |    1 +
 include/mtd/ubi-header.h      |  360 +++++++++
 include/mtd/ubi-user.h        |  161 ++++
 30 files changed, 12114 insertions(+), 0 deletions(-)

Artem B. Bityutskiy (1):
UBI: Unsorted Block Images

Artem Bityutskiy (3):
JFFS2: add UBI support
UBI: add me to MAINTAINERS
UBI: remove unused variable

commit d468a030026017008286919aa6127b1190efb2c2

Author: Artem Bityutskiy <[email protected]>
Date:   Fri Apr 27 15:11:44 2007 +0300

UBI: remove unused variable

commit 485764016d5accb813e8bdd076802a7e3318bb64

Author: Artem Bityutskiy <[email protected]>
Date:   Tue Feb 13 17:11:10 2007 +0200

UBI: add me to MAINTAINERS

commit 0029da3bf430eea498eee8cef5933f9214534b8a

Author: Artem Bityutskiy <[email protected]>
Date:   Wed Oct 4 19:15:21 2006 +0300

JFFS2: add UBI support

This patch make JFFS2 able to work with UBI volumes via the emulated MTD devices which are directly mapped to these volumes.

commit 801c135ce73d5df1caf3eca35b66a10824ae0707

Author: Artem B. Bityutskiy <[email protected]>
Date:   Tue Jun 27 12:22:22 2006 +0400

UBI: Unsorted Block Images

UBI (Latin: "where?") manages multiple logical volumes on a single flash device, specifically supporting NAND flash devices. UBI provides a flexible partitioning concept which still allows for wear-levelling across the whole flash device.

In a sense, UBI may be compared to the Logical Volume Manager (LVM). Whereas LVM maps logical sector numbers to physical HDD sector numbers, UBI maps logical eraseblocks to physical eraseblocks.

More information may be found at
http://www.linux-mtd.infradead.org/doc/ubi.html

Partitioning/Re-partitioning

An UBI volume occupies a certain number of erase blocks. This is limited by a configured maximum volume size, which could also be viewed as the partition size. Each individual UBI volume's size can be changed independently of the other UBI volumes, provided that the sum of all volume sizes doesn't exceed a certain limit.

UBI supports dynamic volumes and static volumes. Static volumes are read-only and their contents are protected by CRC check sums.

Bad eraseblocks handling

UBI transparently handles bad eraseblocks. When a physical eraseblock becomes bad, it is substituted by a good physical eraseblock, and the user does not even notice this.

Scrubbing

On a NAND flash bit flips can occur on any write operation, sometimes also on read. If bit flips persist on the device, at first they can still be corrected by ECC, but once they accumulate, correction will become impossible. Thus it is best to actively scrub the affected eraseblock, by first copying it to a free eraseblock and then erasing the original. The UBI layer performs this type of scrubbing under the covers, transparently to the UBI volume users.

Erase Counts

UBI maintains an erase count header per eraseblock. This frees higher-level layers (like file systems) from doing this and allows for centralized erase count management instead. The erase counts are used by the wear-levelling algorithm in the UBI layer. The algorithm itself is exchangeable.

Booting from NAND

For booting directly from NAND flash the hardware must at least be capable of fetching and executing a small portion of the NAND flash. Some NAND flash controllers have this kind of support. They usually limit the window to a few kilobytes in erase block 0. This "initial program loader" (IPL) must then contain sufficient logic to load and execute the next boot phase.

Due to bad eraseblocks, which may be randomly scattered over the flash device, it is problematic to store the "secondary program loader" (SPL) statically. Also, due to bit-flips it may become corrupted over time. UBI allows to solve this problem gracefully by storing the SPL in a small static UBI volume.

UBI volumes vs. static partitions

UBI volumes are still very similar to static MTD partitions:

* both consist of eraseblocks (logical eraseblocks in case of UBI volumes, and physical eraseblocks in case of static partitions;
* both support three basic operations - read, write, erase.

But UBI volumes have the following advantages over traditional static MTD partitions:

* there are no eraseblock wear-leveling constraints in case of UBI volumes, so the user should not care about this;
* there are no bit-flips and bad eraseblocks in case of UBI volumes.

So, UBI volumes may be considered as flash devices with relaxed restrictions.

Where can it be found?

Documentation, kernel code and applications can be found in the MTD gits.

What are the applications for?

The applications help to create binary flash images for two purposes: pfi files (partial flash images) for in-system update of UBI volumes, and plain binary images, with or without OOB data in case of NAND, for a manufacturing step. Furthermore some tools are/and will be created that allow flash content analysis after a system has crashed..

Who did UBI?

The original ideas, where UBI is based on, were developed by Andreas Arnez, Frank Haverkamp and Thomas Gleixner. Josh W. Boyer and some others were involved too. The implementation of the kernel layer was done by Artem B. Bityutskiy. The user-space applications and tools were written by Oliver Lohmann with contributions from Frank Haverkamp, Andreas Arnez, and Artem. Joern Engel contributed a patch which modifies JFFS2 so that it can be run on a UBI volume. Thomas Gleixner did modifications to the NAND layer. Alexander Schmidt made some testing work as well as core functionality improvements.

Signature · 2 lines
Best regards,
Artem Bityutskiy (Битюцкий Артём)
#1 lore raw
Quoted 6 lines · Artem Bityutskiy

Linus, please, pull UBI tree from
git://git.infradead.org/ubi-2.6.git for-linus

The UBI tree has been in -mm for several releases and we would like to see it in the mainline.

Quite frankly, I have absolutely _zero_ visibility into things like this, so before I merge it I want ack's from various layers (preferably a mixture of interests - are any vendors interested, is DavidW ok with this, who is using it now and are the interfaces and designs correct etc etc?)

So I simply cannot make that decision. I don't have the expertise or the knowledge. I'll have to trust somebody else for things like this, and it should be somebody who isn't "personally involved".

In other words, I kind of want a sign-off from other parties, because I can't pull things like this "blind".

Are there (embedded?) vendors that already integrate this into their kernel, or wait for it? Is dwmw supportive of this? Questions, questions..

Linus

#2 lore raw
Quoted 5 lines · Linus Torvalds
Quoted 4 lines · Artem Bityutskiy

Linus, please, pull UBI tree from
git://git.infradead.org/ubi-2.6.git for-linus

Quoted 7 lines
Quoted 2 lines

The UBI tree has been in -mm for several releases and we would like to see it in the mainline.

Quite frankly, I have absolutely _zero_ visibility into things like this, so before I merge it I want ack's from various layers (preferably a mixture of interests - are any vendors interested, is DavidW ok with this, who is using it now and are the interfaces and designs correct etc etc?)

Well, IBM is using it in a large project, the involved people are in CC. Thomas has 3+ customers who use it, I've added him to CC.

I'm working for Nokia now and we use it. We also develop a new file system on top of UBI and Nokia invests money in it. So UBI is going to be maintained.

Also there was enough questions interest in the MTD mailing lists as well. Particularly, a guy from @sunsung.com was interested.

P.S. Just for the reference, here is the URL of the new file-system development tree (we have just started):
git://git.infradead.org/~dedekind/jffs3-2.6.git
or gitweb
http://git.infradead.org/?p=users/dedekind/jffs3-2.6.git;a=summary

Signature · 2 lines
Best regards,
Artem Bityutskiy (Битюцкий Артём)
#3 lore raw
Quoted 9 lines · Artem Bityutskiy
Quoted 8 lines · Linus Torvalds
Quoted 6 lines · Artem Bityutskiy

Linus, please, pull UBI tree from
git://git.infradead.org/ubi-2.6.git for-linus

The UBI tree has been in -mm for several releases and we would like to see it in the mainline.

Quoted 7 lines
Quoted 4 lines

Quite frankly, I have absolutely _zero_ visibility into things like this, so before I merge it I want ack's from various layers (preferably a mixture of interests - are any vendors interested, is DavidW ok with this, who is using it now and are the interfaces and designs correct etc etc?)

Well, IBM is using it in a large project, the involved people are in CC. Thomas has 3+ customers who use it, I've added him to CC.

Right, it is deployed already in a couple of customer projects and many folks at the Embedded Linux Conference showed interest.

It definitely has my ack and blessing.

tglx

#4 lore raw
Quoted 15 lines · Thomas Gleixner
Quoted 14 lines · Artem Bityutskiy
Quoted 12 lines · Linus Torvalds
Quoted 6 lines · Artem Bityutskiy

Linus, please, pull UBI tree from
git://git.infradead.org/ubi-2.6.git for-linus

The UBI tree has been in -mm for several releases and we would like to see it in the mainline.

Quite frankly, I have absolutely _zero_ visibility into things like this, so before I merge it I want ack's from various layers (preferably a mixture of interests - are any vendors interested, is DavidW ok with this, who is using it now and are the interfaces and designs correct etc etc?)

Quoted 7 lines
Quoted 2 lines

Well, IBM is using it in a large project, the involved people are in CC. Thomas has 3+ customers who use it, I've added him to CC.

Right, it is deployed already in a couple of customer projects and many folks at the Embedded Linux Conference showed interest.

It definitely has my ack and blessing.

Hey, I'm convinced. Pulled, pushed out.

Linus

#5 lore raw
In reply to Linus Torvalds
Quoted 17 lines · On Fri, 27 Apr 2007 09:00:25 -0700 (PDT) Linus Torvalds…
Quoted 6 lines · Artem Bityutskiy

Linus, please, pull UBI tree from
git://git.infradead.org/ubi-2.6.git for-linus

The UBI tree has been in -mm for several releases and we would like to see it in the mainline.

Quite frankly, I have absolutely _zero_ visibility into things like this, so before I merge it I want ack's from various layers (preferably a mixture of interests - are any vendors interested, is DavidW ok with this, who is using it now and are the interfaces and designs correct etc etc?)

So I simply cannot make that decision. I don't have the expertise or the knowledge. I'll have to trust somebody else for things like this, and it should be somebody who isn't "personally involved".

Quoted 5 lines

In other words, I kind of want a sign-off from other parties, because I can't pull things like this "blind".

Are there (embedded?) vendors that already integrate this into their kernel, or wait for it? Is dwmw supportive of this? Questions, questions..

The patchset used to contain lots of debugging support which wildly duplicated thigs which we already did and was generally overdone. That appears to all have been cleaned up now, so thanks for doing that.

The one remaining nit I'd have with the debug code is that it adds a private hexdump() facility. By my count, that is the kernel's eighth hexdump implementation. There may be even more which don't have "hexdump" in their name.

lib/hexdump.c is rather overdue.

#6 lore raw
Quoted 30 lines · On Fri, 27 Apr 2007 13:52:24 -0700 Andrew Morton wrote:
Quoted 17 lines · On Fri, 27 Apr 2007 09:00:25 -0700 (PDT) Linus Torvalds…
Quoted 6 lines · Artem Bityutskiy

Linus, please, pull UBI tree from
git://git.infradead.org/ubi-2.6.git for-linus

The UBI tree has been in -mm for several releases and we would like to see it in the mainline.

Quite frankly, I have absolutely _zero_ visibility into things like this, so before I merge it I want ack's from various layers (preferably a mixture of interests - are any vendors interested, is DavidW ok with this, who is using it now and are the interfaces and designs correct etc etc?)

So I simply cannot make that decision. I don't have the expertise or the knowledge. I'll have to trust somebody else for things like this, and it should be somebody who isn't "personally involved".

Quoted 5 lines

In other words, I kind of want a sign-off from other parties, because I can't pull things like this "blind".

Are there (embedded?) vendors that already integrate this into their kernel, or wait for it? Is dwmw supportive of this? Questions, questions..

The patchset used to contain lots of debugging support which wildly duplicated thigs which we already did and was generally overdone. That appears to all have been cleaned up now, so thanks for doing that.

Quoted 6 lines

The one remaining nit I'd have with the debug code is that it adds a private hexdump() facility. By my count, that is the kernel's eighth hexdump implementation. There may be even more which don't have "hexdump" in their name.

lib/hexdump.c is rather overdue.

I have a version of that from James Ketrenos that I have been working on... Can post in a few days.

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#7 lore raw
Quoted 10 lines · Randy Dunlap
Quoted 9 lines · On Fri, 27 Apr 2007 13:52:24 -0700 Andrew Morton wrote:

The patchset used to contain lots of debugging support which wildly duplicated thigs which we already did and was generally overdone. That appears to all have been cleaned up now, so thanks for doing that.

The one remaining nit I'd have with the debug code is that it adds a private hexdump() facility. By my count, that is the kernel's eighth hexdump implementation. There may be even more which don't have "hexdump" in their name.

Quoted 4 lines
Quoted 1 line

lib/hexdump.c is rather overdue.

I have a version of that from James Ketrenos that I have been working on... Can post in a few days.

Excellent. We'll take a look at it as soon as you do.

josh