Skip to contentSkip to conversation

mtd, ubi, ubifs: resync with Linux-3.14

PATCH New Heiko Schocher 6 participants 16 messages Jun 24, 2014 – Aug 28, 2014

Subsystems (10)
lore
Share & tools
lore
#0 lore raw

v5 cover mtd, ubi, ubifs: resync with Linux-3.14

resync ubi subsystem with linux:

commit 455c6fdbd219161bd09b1165f11699d6d73de11c

Author: Linus Torvalds <[email protected]>
Date:   Sun Mar 30 20:40:15 2014 -0700
    Linux 3.14

A nice side effect of this, is we introduce UBI Fastmap support to U-Boot.

To produce this patch I did two steps:
- simple copy following files from linux to u-boot

drivers/mtd/mtdconcat.c drivers/mtd/mtdcore.c drivers/mtd/mtdpart.c drivers/mtd/ubi/attach.c drivers/mtd/ubi/build.c drivers/mtd/ubi/debug.c drivers/mtd/ubi/debug.h drivers/mtd/ubi/eba.c drivers/mtd/ubi/fastmap.c drivers/mtd/ubi/io.c drivers/mtd/ubi/kapi.c drivers/mtd/ubi/misc.c drivers/mtd/ubi/ubi-media.h drivers/mtd/ubi/ubi.h drivers/mtd/ubi/upd.c drivers/mtd/ubi/vmt.c drivers/mtd/ubi/vtbl.c drivers/mtd/ubi/wl.c fs/ubifs/budget.c
fs/ubifs/debug.c
fs/ubifs/debug.h
fs/ubifs/io.c
fs/ubifs/key.h
fs/ubifs/log.c
fs/ubifs/lprops.c
fs/ubifs/lpt.c fs/ubifs/lpt_commit.c fs/ubifs/master.c
fs/ubifs/misc.h
fs/ubifs/orphan.c fs/ubifs/recovery.c fs/ubifs/replay.c
fs/ubifs/sb.c
fs/ubifs/scan.c
fs/ubifs/super.c
fs/ubifs/tnc.c
fs/ubifs/tnc_misc.c fs/ubifs/ubifs-media.h fs/ubifs/ubifs.h include/linux/mtd/bbm.h include/linux/mtd/flashchip.h include/linux/mtd/mtd.h include/linux/mtd/nand.h include/linux/mtd/partitions.h include/linux/mtd/ubi.h

include/uapi/mtd/mtd-abi.h -> include/linux/mtd include/uapi/mtd/ubi-user.h -> include/linux/mtd

- make the code again compile clean and working -> commit this adapt the Linux code to compile and work with U-Boot.

Then squash this two patches to this patch, to not break bisectability. To make further sync with linux easier, the above two patches can be found in:

http://git.denx.de/?p=u-boot/u-boot-testing.git;a=shortlog;h=refs/heads/update-mtd%2Bubi-linux-v3.14

Please do not use this branch for testing this patchserie!

summary of changes for U-Boot adaptions:
- replace UBI_LINUX in current UBI code from U-Boot with __UBOOT__ as this define is used in other places in U-Boot where code from other projects is used.

- UBI Fastmap is now availiable in U-Boot activate it with CONFIG_MTD_UBI_FASTMAP

- onenand changes only compile tested.

- Following Code in drivers/mtd/nand/nand_base.c nand_do_write_ops() adapted for U-Boot:

      +#ifndef __UBOOT__
            /* Reject writes, which are not page aligned */
            if (NOTALIGNED(to) || NOTALIGNED(ops->len)) {
      +else
      +     /* Reject writes, which are not page aligned */
      +     if (NOTALIGNED(to)) {
      +endif

as the original linux code leads in not working use of the env var "filesize". For example a "nand write 80000000 80000 ${filesize}" would not work with it ...

- add CONFIG_MTD_NAND_VERIFY_WRITE from U-Boot code

- Documented the config defines in README

- kmalloc now uses memalign for allocating memory

Tested it on am33xx, imx6 and mpc83xx boards. MAKEALL for arm and powerpc and mips compiles clean.

Tested UBI fastmap on a board with 512 MiB nand flash. Attach time from old U-Boot was 2 seconds, reduced with UBI fastmap to 0.2 seconds.

Please test this patch!

- changes for v2:
- add lib/linux_compat.c as Joerg Krause detected
- changes for v3:
rebase with current U-Boot commit 61e76f53708cf082ef9061a140b57df3513b8ba1
- changes for v4:
- rebase with commit d8a97f934c64a7ba6f11da5e4cc7f3be57fcb82d
- remove compile error for mips, as Tom Rini suggested check "MAKEALL mips" compiles clean
- fix blackfin and microblaze compile
add fix for blackfin from Trom Rini also add his Signed-off-by

- changes for v5:
- extract linux/compat.h changes

Cc Marek Vasut <[email protected]>
Cc Sergey Lapin <[email protected]>
Cc Scott Wood <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Joerg Krause <[email protected]>

Heiko Schocher (5):
lib, rbtree: resync with Linux-3.14
lib, list_sort: add list_sort from linux 3.14 linux include: add ERR_CAST
lib, linux: move linux specific defines to linux/compat.h mtd, ubi, ubifs: resync with Linux-3.14

 README                              |   61 +
 board/prodrive/alpr/nand.c          |    4 +
 board/socrates/nand.c               |    6 +
 board/tqc/tqm8272/nand.c            |    4 +
 common/cmd_ubi.c                    |   28 +-
 common/cmd_ubifs.c                  |    2 +-
 drivers/mtd/mtdconcat.c             |  230 ++-
 drivers/mtd/mtdcore.c               | 1112 ++++++++++++-
 drivers/mtd/mtdcore.h               |   23 +
 drivers/mtd/mtdpart.c               |  515 +++++-
 drivers/mtd/nand/fsl_elbc_nand.c    |    4 +
 drivers/mtd/nand/fsl_ifc_nand.c     |    4 +
 drivers/mtd/nand/fsl_upm.c          |    4 +
 drivers/mtd/nand/mpc5121_nfc.c      |    4 +
 drivers/mtd/nand/mxc_nand.c         |    8 +
 drivers/mtd/nand/nand_base.c        | 1893 +++++++++++++++------
 drivers/mtd/nand/nand_bbt.c         |  296 ++--
 drivers/mtd/nand/nand_ids.c         |  266 +--
 drivers/mtd/nand/nand_util.c        |    3 +
 drivers/mtd/nand/ndfc.c             |    4 +
 drivers/mtd/onenand/onenand_base.c  |    1 +
 drivers/mtd/onenand/onenand_bbt.c   |    1 -
 drivers/mtd/onenand/samsung.c       |   10 +-
 drivers/mtd/ubi/Makefile            |    3 +-
 drivers/mtd/ubi/attach.c            | 1754 ++++++++++++++++++++
 drivers/mtd/ubi/build.c             |  812 ++++++---
 drivers/mtd/ubi/crc32.c             |   13 +-
 drivers/mtd/ubi/crc32table.h        |    2 +-
 drivers/mtd/ubi/debug.c             |  482 ++++--
 drivers/mtd/ubi/debug.h             |  175 +-
 drivers/mtd/ubi/eba.c               |  474 ++++--
 drivers/mtd/ubi/fastmap.c           | 1584 ++++++++++++++++++
 drivers/mtd/ubi/io.c                |  788 +++++----
 drivers/mtd/ubi/kapi.c              |  276 ++-
 drivers/mtd/ubi/misc.c              |   58 +-
 drivers/mtd/ubi/scan.c              | 1348 ---------------
 drivers/mtd/ubi/scan.h              |  153 --
 drivers/mtd/ubi/ubi-media.h         |  205 ++-
 drivers/mtd/ubi/ubi.h               |  610 +++++--
 drivers/mtd/ubi/upd.c               |  104 +-
 drivers/mtd/ubi/vmt.c               |  283 ++--
 drivers/mtd/ubi/vtbl.c              |  359 ++--
 drivers/mtd/ubi/wl.c                | 1590 +++++++++++-------
 drivers/usb/gadget/ether.c          |    5 -
 drivers/usb/gadget/storage_common.c |    5 -
 drivers/usb/musb-new/linux-compat.h |   58 -
 drivers/video/exynos_dp.c           |    1 +
 drivers/video/exynos_mipi_dsi.c     |    1 +
 fs/ubifs/budget.c                   |  662 +++++++-
 fs/ubifs/debug.c                    | 3129 ++++++++++++++++++++++++++++++++++-
 fs/ubifs/debug.h                    |  578 ++++---
 fs/ubifs/io.c                       |  897 +++++++++-
 fs/ubifs/key.h                      |   68 +-
 fs/ubifs/log.c                      |  663 +++++++-
 fs/ubifs/lprops.c                   |  538 +++++-
 fs/ubifs/lpt.c                      | 1242 +++++++++++++-
 fs/ubifs/lpt_commit.c               | 1903 ++++++++++++++++++++-
 fs/ubifs/master.c                   |  102 +-
 fs/ubifs/misc.h                     |  159 +-
 fs/ubifs/orphan.c                   |  671 +++++++-
 fs/ubifs/recovery.c                 |  738 ++++++---
 fs/ubifs/replay.c                   |  573 ++++---
 fs/ubifs/sb.c                       |  547 +++++-
 fs/ubifs/scan.c                     |  102 +-
 fs/ubifs/super.c                    | 2173 ++++++++++++++++++++----
 fs/ubifs/tnc.c                      |  742 ++++++++-
 fs/ubifs/tnc_misc.c                 |  124 +-
 fs/ubifs/ubifs-media.h              |   62 +-
 fs/ubifs/ubifs.c                    |  115 +-
 fs/ubifs/ubifs.h                    |  708 +++++---
 fs/yaffs2/ydirectenv.h              |    2 -
 include/linux/compat.h              |  330 +++-
 include/linux/err.h                 |   17 +-
 include/linux/list_sort.h           |   11 +
 include/linux/mtd/bbm.h             |   73 +-
 include/linux/mtd/concat.h          |    4 +
 include/linux/mtd/flashchip.h       |  105 ++
 include/linux/mtd/mtd.h             |  272 ++-
 include/linux/mtd/nand.h            |  351 +++-
 include/linux/mtd/partitions.h      |   60 +-
 include/linux/mtd/ubi.h             |  120 +-
 include/linux/rbtree.h              |  147 +-
 include/linux/rbtree_augmented.h    |  220 +++
 include/linux/usb/gadget.h          |    6 +-
 include/mtd/mtd-abi.h               |  183 +-
 include/mtd/ubi-user.h              |  305 +++-
 include/ubi_uboot.h                 |  165 +-
 include/usb/lin_gadget_compat.h     |   16 -
 lib/Makefile                        |    2 +
 lib/linux_compat.c                  |   47 +
 lib/list_sort.c                     |  298 ++++
 lib/rbtree.c                        |  684 +++++---
 92 files changed, 28069 insertions(+), 7471 deletions(-)
 create mode 100644 drivers/mtd/mtdcore.h
 create mode 100644 drivers/mtd/ubi/attach.c
 create mode 100644 drivers/mtd/ubi/fastmap.c
 delete mode 100644 drivers/mtd/ubi/scan.c
 delete mode 100644 drivers/mtd/ubi/scan.h
 create mode 100644 include/linux/list_sort.h
 create mode 100644 include/linux/mtd/flashchip.h
 create mode 100644 include/linux/rbtree_augmented.h
 create mode 100644 lib/linux_compat.c
 create mode 100644 lib/list_sort.c
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH v5 1/5 lib, rbtree: resync with Linux-3.14

resync with linux:

commit 455c6fdbd219161bd09b1165f11699d6d73de11c

Author: Linus Torvalds <[email protected]>
Date:   Sun Mar 30 20:40:15 2014 -0700
    Linux 3.14

Needed for the MTD/UBI/UBIFS resync

Just copied the files from Linux, changed the license file header, and add in the c-file:

+#define __UBOOT__
#include <linux/rbtree_augmented.h>
+#ifndef __UBOOT__
#include <linux/export.h>
+#else
+#include <ubi_uboot.h>
+#endif

so, it compiles for U-Boot.

Cc Marek Vasut <[email protected]>
Cc Sergey Lapin <[email protected]>
Cc Scott Wood <[email protected]>
Cc Tom Rini <[email protected]>

---
- changes for v2:
- none
- changes for v3:
- add in the commit message the description, how this sync patch with linux was done, as Marek and Tom suggested.
- changes for v4:
- none
- changes for v5:
- none

 include/linux/rbtree.h           | 147 +++------
 include/linux/rbtree_augmented.h | 220 +++++++++++++
 lib/rbtree.c                     | 684 ++++++++++++++++++++++++---------------
 3 files changed, 698 insertions(+), 353 deletions(-)
 create mode 100644 include/linux/rbtree_augmented.h
include/linux/rbtree.h +49 -98
index ad892d1..b5994e3 100644
@@ -1,7 +1,7 @@
 /*
   Red Black Trees
   (C) 1999  Andrea Arcangeli <[email protected]>
-
+  
  * SPDX-License-Identifier:	GPL-2.0+
 
   linux/include/linux/rbtree.h
@@ -11,138 +11,89 @@
   I know it's not the cleaner way,  but in C (not in C++) to get
   performances and genericity...
 
-  Some example of insert and search follows here. The search is a plain
-  normal search over an ordered tree. The insert instead must be implemented
-  int two steps: as first thing the code must insert the element in
-  order as a red leaf in the tree, then the support library function
-  rb_insert_color() must be called. Such function will do the
-  not trivial work to rebalance the rbtree if necessary.
-
------------------------------------------------------------------------
-static inline struct page * rb_search_page_cache(struct inode * inode,
-						 unsigned long offset)
-{
-	struct rb_node * n = inode->i_rb_page_cache.rb_node;
-	struct page * page;
-
-	while (n)
-	{
-		page = rb_entry(n, struct page, rb_page_cache);
-
-		if (offset < page->offset)
-			n = n->rb_left;
-		else if (offset > page->offset)
-			n = n->rb_right;
-		else
-			return page;
-	}
-	return NULL;
-}
-
-static inline struct page * __rb_insert_page_cache(struct inode * inode,
-						   unsigned long offset,
-						   struct rb_node * node)
-{
-	struct rb_node ** p = &inode->i_rb_page_cache.rb_node;
-	struct rb_node * parent = NULL;
-	struct page * page;
-
-	while (*p)
-	{
-		parent = *p;
-		page = rb_entry(parent, struct page, rb_page_cache);
-
-		if (offset < page->offset)
-			p = &(*p)->rb_left;
-		else if (offset > page->offset)
-			p = &(*p)->rb_right;
-		else
-			return page;
-	}
-
-	rb_link_node(node, parent, p);
-
-	return NULL;
-}
-
-static inline struct page * rb_insert_page_cache(struct inode * inode,
-						 unsigned long offset,
-						 struct rb_node * node)
-{
-	struct page * ret;
-	if ((ret = __rb_insert_page_cache(inode, offset, node)))
-		goto out;
-	rb_insert_color(node, &inode->i_rb_page_cache);
- out:
-	return ret;
-}
------------------------------------------------------------------------
+  See Documentation/rbtree.txt for documentation and samples.
 */
 
 #ifndef	_LINUX_RBTREE_H
 #define	_LINUX_RBTREE_H
 
+#define __UBOOT__
+#ifndef __UBOOT__
+#include <linux/kernel.h>
+#endif
 #include <linux/stddef.h>
 
-struct rb_node
-{
-	unsigned long  rb_parent_color;
-#define	RB_RED		0
-#define	RB_BLACK	1
+struct rb_node {
+	unsigned long  __rb_parent_color;
 	struct rb_node *rb_right;
 	struct rb_node *rb_left;
 } __attribute__((aligned(sizeof(long))));
     /* The alignment might seem pointless, but allegedly CRIS needs it */
 
-struct rb_root
-{
+struct rb_root {
 	struct rb_node *rb_node;
 };
 
 
-#define rb_parent(r)   ((struct rb_node *)((r)->rb_parent_color & ~3))
-#define rb_color(r)   ((r)->rb_parent_color & 1)
-#define rb_is_red(r)   (!rb_color(r))
-#define rb_is_black(r) rb_color(r)
-#define rb_set_red(r)  do { (r)->rb_parent_color &= ~1; } while (0)
-#define rb_set_black(r)  do { (r)->rb_parent_color |= 1; } while (0)
-
-static inline void rb_set_parent(struct rb_node *rb, struct rb_node *p)
-{
-	rb->rb_parent_color = (rb->rb_parent_color & 3) | (unsigned long)p;
-}
-static inline void rb_set_color(struct rb_node *rb, int color)
-{
-	rb->rb_parent_color = (rb->rb_parent_color & ~1) | color;
-}
+#define rb_parent(r)   ((struct rb_node *)((r)->__rb_parent_color & ~3))
 
 #define RB_ROOT	(struct rb_root) { NULL, }
 #define	rb_entry(ptr, type, member) container_of(ptr, type, member)
 
-#define RB_EMPTY_ROOT(root)	((root)->rb_node == NULL)
-#define RB_EMPTY_NODE(node)	(rb_parent(node) == node)
-#define RB_CLEAR_NODE(node)	(rb_set_parent(node, node))
+#define RB_EMPTY_ROOT(root)  ((root)->rb_node == NULL)
+
+/* 'empty' nodes are nodes that are known not to be inserted in an rbree */
+#define RB_EMPTY_NODE(node)  \
+	((node)->__rb_parent_color == (unsigned long)(node))
+#define RB_CLEAR_NODE(node)  \
+	((node)->__rb_parent_color = (unsigned long)(node))
+
 
 extern void rb_insert_color(struct rb_node *, struct rb_root *);
 extern void rb_erase(struct rb_node *, struct rb_root *);
 
+
 /* Find logical next and previous nodes in a tree */
-extern struct rb_node *rb_next(struct rb_node *);
-extern struct rb_node *rb_prev(struct rb_node *);
-extern struct rb_node *rb_first(struct rb_root *);
-extern struct rb_node *rb_last(struct rb_root *);
+extern struct rb_node *rb_next(const struct rb_node *);
+extern struct rb_node *rb_prev(const struct rb_node *);
+extern struct rb_node *rb_first(const struct rb_root *);
+extern struct rb_node *rb_last(const struct rb_root *);
+
+/* Postorder iteration - always visit the parent after its children */
+extern struct rb_node *rb_first_postorder(const struct rb_root *);
+extern struct rb_node *rb_next_postorder(const struct rb_node *);
 
 /* Fast replacement of a single node without remove/rebalance/add/rebalance */
-extern void rb_replace_node(struct rb_node *victim, struct rb_node *new,
+extern void rb_replace_node(struct rb_node *victim, struct rb_node *new, 
 			    struct rb_root *root);
 
 static inline void rb_link_node(struct rb_node * node, struct rb_node * parent,
 				struct rb_node ** rb_link)
 {
-	node->rb_parent_color = (unsigned long )parent;
+	node->__rb_parent_color = (unsigned long)parent;
 	node->rb_left = node->rb_right = NULL;
 
 	*rb_link = node;
 }
 
+#define rb_entry_safe(ptr, type, member) \
+	({ typeof(ptr) ____ptr = (ptr); \
+	   ____ptr ? rb_entry(____ptr, type, member) : NULL; \
+	})
+
+/**
+ * rbtree_postorder_for_each_entry_safe - iterate over rb_root in post order of
+ * given type safe against removal of rb_node entry
+ *
+ * @pos:	the 'type *' to use as a loop cursor.
+ * @n:		another 'type *' to use as temporary storage
+ * @root:	'rb_root *' of the rbtree.
+ * @field:	the name of the rb_node field within 'type'.
+ */
+#define rbtree_postorder_for_each_entry_safe(pos, n, root, field) \
+	for (pos = rb_entry_safe(rb_first_postorder(root), typeof(*pos), field); \
+	     pos && ({ n = rb_entry_safe(rb_next_postorder(&pos->field), \
+			typeof(*pos), field); 1; }); \
+	     pos = n)
+
 #endif	/* _LINUX_RBTREE_H */
include/linux/rbtree_augmented.h new file +220 -0

220 lines not on this page · raw message

lib/rbtree.c +429 -255

795 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#2 lore raw

PATCH v5 1/5 lib, rbtree: resync with Linux-3.14

Quoted 9 lines · Heiko Schocher

resync with linux:

commit 455c6fdbd219161bd09b1165f11699d6d73de11c

Author: Linus Torvalds <[email protected]>
Date:   Sun Mar 30 20:40:15 2014 -0700
    Linux 3.14

Needed for the MTD/UBI/UBIFS resync

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140828/410836f5/attachment.pgp>
#3 lore raw

PATCH v5 2/5 lib, list_sort: add list_sort from linux 3.14

In reply to Heiko Schocher

from linux 3.14:

commit 455c6fdbd219161bd09b1165f11699d6d73de11c

Author: Linus Torvalds <[email protected]>
Date:   Sun Mar 30 20:40:15 2014 -0700
    Linux 3.14

Needed for the MTD/UBI/UBIFS resync

Just copied the files from Linux, and added in the c-file the "#define __UBOOT__" for adding U-Boot special code. In this case we use this just for adding including U-Boot headers.

Cc Marek Vasut <[email protected]>
Cc Sergey Lapin <[email protected]>
Cc Scott Wood <[email protected]>
Cc Tom Rini <[email protected]>

---
- changes for v2:
- none
- changes for v3:
- add in the commit message the description, how this sync with linux patch was done, as Marek and Tom suggested.
- changes for v4:
- none
- changes for v5:
- none

 include/linux/list_sort.h |  11 ++
 lib/Makefile              |   1 +
 lib/list_sort.c           | 298 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 310 insertions(+)
 create mode 100644 include/linux/list_sort.h
 create mode 100644 lib/list_sort.c
include/linux/list_sort.h new file +11 -0
new file mode 100644
index 0000000..1a2df2e
@@ -0,0 +1,11 @@
+#ifndef _LINUX_LIST_SORT_H
+#define _LINUX_LIST_SORT_H
+
+#include <linux/types.h>
+
+struct list_head;
+
+void list_sort(void *priv, struct list_head *head,
+	       int (*cmp)(void *priv, struct list_head *a,
+			  struct list_head *b));
+#endif
lib/Makefile +1 -0
index 68210a5..9b1c2374 100644
@@ -43,6 +43,7 @@ obj-y	+= strmhz.o
 obj-$(CONFIG_TPM) += tpm.o
 obj-$(CONFIG_RBTREE)	+= rbtree.o
 obj-$(CONFIG_BITREVERSE) += bitrev.o
+obj-y += list_sort.o
 endif
 
 ifdef CONFIG_SPL_BUILD
lib/list_sort.c new file +298 -0

298 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#4 lore raw

PATCH v5 2/5 lib, list_sort: add list_sort from linux 3.14

Quoted 9 lines · Heiko Schocher

from linux 3.14:

commit 455c6fdbd219161bd09b1165f11699d6d73de11c

Author: Linus Torvalds <[email protected]>
Date:   Sun Mar 30 20:40:15 2014 -0700
    Linux 3.14

Needed for the MTD/UBI/UBIFS resync

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140828/90a4029e/attachment.pgp>
#5 lore raw

PATCH v5 3/5 linux include: add ERR_CAST

In reply to Heiko Schocher

add missing ERR_CAST to linux/err.h as it is needed for ubi/ubifs support

---

- changes for v5:
new

 include/linux/err.h | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
include/linux/err.h +13 -4
index 96c0c72..5b3c8bc 100644
@@ -1,12 +1,8 @@
 #ifndef _LINUX_ERR_H
 #define _LINUX_ERR_H
 
-/* XXX U-BOOT XXX */
-#if 0
 #include <linux/compiler.h>
-#else
 #include <linux/compat.h>
-#endif
 
 #include <asm/errno.h>
 
@@ -40,6 +36,19 @@ static inline long IS_ERR(const void *ptr)
 	return IS_ERR_VALUE((unsigned long)ptr);
 }
 
+/**
+ * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type
+ * @ptr: The pointer to cast.
+ *
+ * Explicitly cast an error-valued pointer to another pointer type in such a
+ * way as to make it clear that's what's going on.
+ */
+static inline void * __must_check ERR_CAST(__force const void *ptr)
+{
+	/* cast away the const */
+	return (void *) ptr;
+}
+
 #endif
 
 #endif /* _LINUX_ERR_H */
Signature · 1 line
1.8.3.1
#6 lore raw

PATCH v5 3/5 linux include: add ERR_CAST

Quoted 3 lines · Heiko Schocher

add missing ERR_CAST to linux/err.h as it is needed for ubi/ubifs support

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140828/554efce5/attachment.pgp>
#7 lore raw

PATCH v5 4/5 lib, linux: move linux specific defines to linux/compat.h

In reply to Heiko Schocher

- move linux specific defines from usb and video code into linux/compat.h
- move common linux specific defines from include/ubi_uboot.h to linux/compat.h
- add for new mtd/ubi/ubifs sync new needed linux specific defines to linux/compat.h

Cc Tom Rini <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Anatolij Gustschin <[email protected]>

---
- changes for v5:
new

 drivers/usb/gadget/ether.c          |   5 -
 drivers/usb/gadget/storage_common.c |   5 -
 drivers/usb/musb-new/linux-compat.h |  58 -------
 drivers/video/exynos_dp.c           |   1 +
 drivers/video/exynos_mipi_dsi.c     |   1 +
 fs/yaffs2/ydirectenv.h              |   2 -
 include/linux/compat.h              | 330 +++++++++++++++++++++++++++++++++++-
 include/linux/usb/gadget.h          |   6 +-
 include/ubi_uboot.h                 | 165 ++----------------
 lib/Makefile                        |   1 +
 lib/linux_compat.c                  |  47 +++++
 11 files changed, 386 insertions(+), 235 deletions(-)
 create mode 100644 lib/linux_compat.c
drivers/usb/gadget/ether.c +0 -5
index cc6cc1f..d0dd29f 100644
@@ -25,15 +25,10 @@
 
 #define atomic_read
 extern struct platform_data brd;
-#define spin_lock(x)
-#define spin_unlock(x)
 
 
 unsigned packet_received, packet_sent;
 
-#define GFP_ATOMIC ((gfp_t) 0)
-#define GFP_KERNEL ((gfp_t) 0)
-
 /*
  * Ethernet gadget driver -- with CDC and non-CDC options
  * Builds on hardware support for a full duplex link.
drivers/usb/gadget/storage_common.c +0 -5
index 02803df..b55e40b 100644
@@ -267,11 +267,6 @@ struct interrupt_data {
 #define ASCQ(x)		((u8) (x))
 
 struct device_attribute { int i; };
-struct rw_semaphore { int i; };
-#define down_write(...)			do { } while (0)
-#define up_write(...)			do { } while (0)
-#define down_read(...)			do { } while (0)
-#define up_read(...)			do { } while (0)
 #define ETOOSMALL	525
 
 #include <usb_mass_storage.h>
drivers/usb/musb-new/linux-compat.h +0 -58

76 lines not on this page · raw message

drivers/video/exynos_dp.c +1 -0
index 682483f..f60b060 100644
@@ -9,6 +9,7 @@
 #include <config.h>
 #include <common.h>
 #include <malloc.h>
+#include <linux/compat.h>
 #include <linux/err.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/cpu.h>
drivers/video/exynos_mipi_dsi.c +1 -0
index 7dd4652..c68ebd6 100644
@@ -11,6 +11,7 @@
 #include <malloc.h>
 #include <fdtdec.h>
 #include <libfdt.h>
+#include <linux/compat.h>
 #include <linux/err.h>
 #include <asm/arch/dsim.h>
 #include <asm/arch/mipi_dsim.h>
fs/yaffs2/ydirectenv.h +0 -2
index c6614f1..2b3e84f 100644
@@ -58,8 +58,6 @@ void yaffs_qsort(void *aa, size_t n, size_t es,
 #define inline
 #endif
 
-#define cond_resched()  do {} while (0)
-
 #define yaffs_trace(msk, fmt, ...) do { \
 	if (yaffs_trace_mask & (msk)) \
 		printf("yaffs: " fmt "\n", ##__VA_ARGS__); \
include/linux/compat.h +325 -5

352 lines not on this page · raw message

include/linux/usb/gadget.h +1 -5
index a8a5763..9bccd45 100644
@@ -19,6 +19,7 @@
 #define __LINUX_USB_GADGET_H
 
 #include <errno.h>
+#include <linux/compat.h>
 #include <linux/list.h>
 
 struct usb_ep;
@@ -410,11 +411,6 @@ struct usb_gadget_ops {
 				unsigned code, unsigned long param);
 };
 
-struct device {
-	void		*driver_data;	/* data private to the driver */
-	void            *device_data;   /* data private to the device */
-};
-
 /**
  * struct usb_gadget - represents a usb slave device
  * @ops: Function pointers used to access hardware-specific operations.
include/ubi_uboot.h +10 -155

194 lines not on this page · raw message

lib/Makefile +1 -0
index 9b1c2374..320197a 100644
@@ -59,6 +59,7 @@ obj-y += crc32.o
 obj-y += ctype.o
 obj-y += div64.o
 obj-y += hang.o
+obj-y += linux_compat.o
 obj-y += linux_string.o
 obj-$(CONFIG_REGEX) += slre.o
 obj-y += string.o
lib/linux_compat.c new file +47 -0

47 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#8 lore raw

PATCH v5 4/5 lib, linux: move linux specific defines to linux/compat.h

Quoted 11 lines · Heiko Schocher

- move linux specific defines from usb and video code into linux/compat.h
- move common linux specific defines from include/ubi_uboot.h to linux/compat.h
- add for new mtd/ubi/ubifs sync new needed linux specific defines to linux/compat.h

Cc Tom Rini <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Anatolij Gustschin <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140828/988a9274/attachment.pgp>
#9 lore raw

PATCH v5 5/5 mtd, ubi, ubifs: resync with Linux-3.14

In reply to Heiko Schocher

resync ubi subsystem with linux:

commit 455c6fdbd219161bd09b1165f11699d6d73de11c

Author: Linus Torvalds <[email protected]>
Date:   Sun Mar 30 20:40:15 2014 -0700
    Linux 3.14

A nice side effect of this, is we introduce UBI Fastmap support to U-Boot.

Cc Marek Vasut <[email protected]>
Cc Sergey Lapin <[email protected]>
Cc Scott Wood <[email protected]>
Cc Joerg Krause <[email protected]>

---

To produce this patch I did two steps:
- simple copy following files from linux to u-boot

drivers/mtd/mtdconcat.c
drivers/mtd/mtdcore.c
drivers/mtd/mtdpart.c
drivers/mtd/ubi/attach.c
drivers/mtd/ubi/build.c
drivers/mtd/ubi/debug.c
drivers/mtd/ubi/debug.h
drivers/mtd/ubi/eba.c
drivers/mtd/ubi/fastmap.c
drivers/mtd/ubi/io.c
drivers/mtd/ubi/kapi.c
drivers/mtd/ubi/misc.c
drivers/mtd/ubi/ubi-media.h
drivers/mtd/ubi/ubi.h
drivers/mtd/ubi/upd.c
drivers/mtd/ubi/vmt.c
drivers/mtd/ubi/vtbl.c
drivers/mtd/ubi/wl.c
fs/ubifs/budget.c
fs/ubifs/debug.c
fs/ubifs/debug.h
fs/ubifs/io.c
fs/ubifs/key.h
fs/ubifs/log.c
fs/ubifs/lprops.c
fs/ubifs/lpt.c
fs/ubifs/lpt_commit.c
fs/ubifs/master.c
fs/ubifs/misc.h
fs/ubifs/orphan.c
fs/ubifs/recovery.c
fs/ubifs/replay.c
fs/ubifs/sb.c
fs/ubifs/scan.c
fs/ubifs/super.c
fs/ubifs/tnc.c
fs/ubifs/tnc_misc.c
fs/ubifs/ubifs-media.h
fs/ubifs/ubifs.h
include/linux/mtd/bbm.h
include/linux/mtd/flashchip.h
include/linux/mtd/mtd.h
include/linux/mtd/nand.h
include/linux/mtd/partitions.h
include/linux/mtd/ubi.h

include/uapi/mtd/mtd-abi.h -> include/linux/mtd
include/uapi/mtd/ubi-user.h -> include/linux/mtd

- make the code again compile clean and working -> commit this adapt the Linux code to compile and work with U-Boot.

Then squash this two patches to this patch, to not break bisectability. To make further sync with linux easier, the above three patches can be found in:

http://git.denx.de/?p=u-boot/u-boot-testing.git;a=shortlog;h=refs/heads/update-mtd%2Bubi-linux-v3.14

Please do not use this branch for testing this patchserie!

summary of changes for U-Boot adaptions:
- replace UBI_LINUX in current UBI code from U-Boot with __UBOOT__ as this define is used in other places in U-Boot where code from other projects is used.

- UBI Fastmap is now availiable in U-Boot
activate it with CONFIG_MTD_UBI_FASTMAP

- onenand changes only compile tested.

- Following Code in drivers/mtd/nand/nand_base.c nand_do_write_ops() adapted for U-Boot:

+#ifndef __UBOOT__

        /* Reject writes, which are not page aligned */
        if (NOTALIGNED(to) || NOTALIGNED(ops->len)) {

+else
+ /* Reject writes, which are not page aligned */
+ if (NOTALIGNED(to)) {
+endif

as the original linux code leads in not working use of the env var "filesize". For example a "nand write 80000000 80000 ${filesize}" would not work with it ...

- add CONFIG_MTD_NAND_VERIFY_WRITE from U-Boot code

- Documented the config defines in README

- kmalloc now uses memalign for allocating memory

Tested it on am33xx, imx6 and mpc83xx boards. MAKEALL for arm and powerpc compiles clean.

Tested UBI fastmap on a board with 512 MiB nand flash. Attach time from old U-Boot was 2 seconds, reduced with UBI fastmap to 0.2 seconds.

Please test this patch!

- changes for v2:
- add lib/linux_compat.c as Joerg Krause detected

- changes for v3:
rebase with current U-Boot commit
61e76f53708cf082ef9061a140b57df3513b8ba1

- changes for v4:
- rebase with commit d8a97f934c64a7ba6f11da5e4cc7f3be57fcb82d
- remove compile error for mips, as Tom Rini suggested check "MAKEALL mips" compiles clean
- fix blackfin and microblaze compile
add fix for blackfin from Trom Rini also add his Signed-off-by

- changes for v5:
- extract linux/compat.h changes
- reworked this patch, so it contains really only the u-boot changes

 README                             |   61 +
 board/prodrive/alpr/nand.c         |    4 +
 board/socrates/nand.c              |    6 +
 board/tqc/tqm8272/nand.c           |    4 +
 common/cmd_ubi.c                   |   28 +-
 common/cmd_ubifs.c                 |    2 +-
 drivers/mtd/mtdconcat.c            |  230 ++-
 drivers/mtd/mtdcore.c              | 1112 ++++++++++++-
 drivers/mtd/mtdcore.h              |   23 +
 drivers/mtd/mtdpart.c              |  515 +++++-
 drivers/mtd/nand/fsl_elbc_nand.c   |    4 +
 drivers/mtd/nand/fsl_ifc_nand.c    |    4 +
 drivers/mtd/nand/fsl_upm.c         |    4 +
 drivers/mtd/nand/mpc5121_nfc.c     |    4 +
 drivers/mtd/nand/mxc_nand.c        |    8 +
 drivers/mtd/nand/nand_base.c       | 1893 ++++++++++++++++------
 drivers/mtd/nand/nand_bbt.c        |  296 ++--
 drivers/mtd/nand/nand_ids.c        |  266 +--
 drivers/mtd/nand/nand_util.c       |    3 +
 drivers/mtd/nand/ndfc.c            |    4 +
 drivers/mtd/onenand/onenand_base.c |    1 +
 drivers/mtd/onenand/onenand_bbt.c  |    1 -
 drivers/mtd/onenand/samsung.c      |   10 +-
 drivers/mtd/ubi/Makefile           |    3 +-
 drivers/mtd/ubi/attach.c           | 1754 ++++++++++++++++++++
 drivers/mtd/ubi/build.c            |  812 +++++++---
 drivers/mtd/ubi/crc32.c            |   13 +-
 drivers/mtd/ubi/crc32table.h       |    2 +-
 drivers/mtd/ubi/debug.c            |  482 ++++--
 drivers/mtd/ubi/debug.h            |  175 +-
 drivers/mtd/ubi/eba.c              |  474 ++++--
 drivers/mtd/ubi/fastmap.c          | 1584 ++++++++++++++++++
 drivers/mtd/ubi/io.c               |  788 +++++----
 drivers/mtd/ubi/kapi.c             |  276 +++-
 drivers/mtd/ubi/misc.c             |   58 +-
 drivers/mtd/ubi/scan.c             | 1348 ----------------
 drivers/mtd/ubi/scan.h             |  153 --
 drivers/mtd/ubi/ubi-media.h        |  205 ++-
 drivers/mtd/ubi/ubi.h              |  610 +++++--
 drivers/mtd/ubi/upd.c              |  104 +-
 drivers/mtd/ubi/vmt.c              |  283 ++--
 drivers/mtd/ubi/vtbl.c             |  359 +++--
 drivers/mtd/ubi/wl.c               | 1590 +++++++++++-------
 fs/ubifs/budget.c                  |  662 +++++++-
 fs/ubifs/debug.c                   | 3129 +++++++++++++++++++++++++++++++++++-
 fs/ubifs/debug.h                   |  578 ++++---
 fs/ubifs/io.c                      |  897 ++++++++++-
 fs/ubifs/key.h                     |   68 +-
 fs/ubifs/log.c                     |  663 +++++++-
 fs/ubifs/lprops.c                  |  538 ++++++-
 fs/ubifs/lpt.c                     | 1242 +++++++++++++-
 fs/ubifs/lpt_commit.c              | 1903 +++++++++++++++++++++-
 fs/ubifs/master.c                  |  102 +-
 fs/ubifs/misc.h                    |  159 +-
 fs/ubifs/orphan.c                  |  671 +++++++-
 fs/ubifs/recovery.c                |  738 ++++++---
 fs/ubifs/replay.c                  |  573 ++++---
 fs/ubifs/sb.c                      |  547 ++++++-
 fs/ubifs/scan.c                    |  102 +-
 fs/ubifs/super.c                   | 2173 +++++++++++++++++++++----
 fs/ubifs/tnc.c                     |  742 +++++++--
 fs/ubifs/tnc_misc.c                |  124 +-
 fs/ubifs/ubifs-media.h             |   62 +-
 fs/ubifs/ubifs.c                   |  115 +-
 fs/ubifs/ubifs.h                   |  708 +++++---
 include/linux/mtd/bbm.h            |   73 +-
 include/linux/mtd/concat.h         |    4 +
 include/linux/mtd/flashchip.h      |  105 ++
 include/linux/mtd/mtd.h            |  272 +++-
 include/linux/mtd/nand.h           |  351 +++-
 include/linux/mtd/partitions.h     |   60 +-
 include/linux/mtd/ubi.h            |  120 +-
 include/mtd/mtd-abi.h              |  183 ++-
 include/mtd/ubi-user.h             |  305 +++-
 include/usb/lin_gadget_compat.h    |   16 -
 75 files changed, 26662 insertions(+), 6879 deletions(-)
 create mode 100644 drivers/mtd/mtdcore.h
 create mode 100644 drivers/mtd/ubi/attach.c
 create mode 100644 drivers/mtd/ubi/fastmap.c
 delete mode 100644 drivers/mtd/ubi/scan.c
 delete mode 100644 drivers/mtd/ubi/scan.h
 create mode 100644 include/linux/mtd/flashchip.h
README +61 -0
index 8c29797..3392416 100644
@@ -3299,6 +3299,9 @@ FIT uImage format:
 		Adds the MTD partitioning infrastructure from the Linux
 		kernel. Needed for UBI support.
 
+		CONFIG_MTD_NAND_VERIFY_WRITE
+		verify if the written data is correct reread.
+
 - UBI support
 		CONFIG_CMD_UBI
 
@@ -3312,6 +3315,64 @@ FIT uImage format:
 		Make the verbose messages from UBI stop printing.  This leaves
 		warnings and errors enabled.
 
+
+		CONFIG_MTD_UBI_WL_THRESHOLD
+		This parameter defines the maximum difference between the highest
+		erase counter value and the lowest erase counter value of eraseblocks
+		of UBI devices. When this threshold is exceeded, UBI starts performing
+		wear leveling by means of moving data from eraseblock with low erase
+		counter to eraseblocks with high erase counter.
+
+		The default value should be OK for SLC NAND flashes, NOR flashes and
+		other flashes which have eraseblock life-cycle 100000 or more.
+		However, in case of MLC NAND flashes which typically have eraseblock
+		life-cycle less than 10000, the threshold should be lessened (e.g.,
+		to 128 or 256, although it does not have to be power of 2).
+
+		default: 4096
+		
+		CONFIG_MTD_UBI_BEB_LIMIT
+		This option specifies the maximum bad physical eraseblocks UBI
+		expects on the MTD device (per 1024 eraseblocks). If the
+		underlying flash does not admit of bad eraseblocks (e.g. NOR
+		flash), this value is ignored.
+
+		NAND datasheets often specify the minimum and maximum NVM
+		(Number of Valid Blocks) for the flashes' endurance lifetime.
+		The maximum expected bad eraseblocks per 1024 eraseblocks
+		then can be calculated as "1024 * (1 - MinNVB / MaxNVB)",
+		which gives 20 for most NANDs (MaxNVB is basically the total
+		count of eraseblocks on the chip).
+
+		To put it differently, if this value is 20, UBI will try to
+		reserve about 1.9% of physical eraseblocks for bad blocks
+		handling. And that will be 1.9% of eraseblocks on the entire
+		NAND chip, not just the MTD partition UBI attaches. This means
+		that if you have, say, a NAND flash chip admits maximum 40 bad
+		eraseblocks, and it is split on two MTD partitions of the same
+		size, UBI will reserve 40 eraseblocks when attaching a
+		partition.
+
+		default: 20
+
+		CONFIG_MTD_UBI_FASTMAP
+		Fastmap is a mechanism which allows attaching an UBI device
+		in nearly constant time. Instead of scanning the whole MTD device it
+		only has to locate a checkpoint (called fastmap) on the device.
+		The on-flash fastmap contains all information needed to attach
+		the device. Using fastmap makes only sense on large devices where
+		attaching by scanning takes long. UBI will not automatically install
+		a fastmap on old images, but you can set the UBI parameter
+		CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT to 1 if you want so. Please note
+		that fastmap-enabled images are still usable with UBI implementations
+		without	fastmap support. On typical flash devices the whole fastmap
+		fits into one PEB. UBI will reserve PEBs to hold two fastmaps.
+
+		CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT
+		Set this parameter to enable fastmap automatically on images
+		without a fastmap.
+		default: 0
+
 - UBIFS support
 		CONFIG_CMD_UBIFS
 
board/prodrive/alpr/nand.c +4 -0
index 50e8d82..5427de5 100644
@@ -93,6 +93,7 @@ static void alpr_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
 	}
 }
 
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 static int alpr_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
 {
 	int i;
@@ -103,6 +104,7 @@ static int alpr_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len
 
 	return 0;
 }
+#endif
 
 static int alpr_nand_dev_ready(struct mtd_info *mtd)
 {
@@ -128,7 +130,9 @@ int board_nand_init(struct nand_chip *nand)
 	nand->read_byte  = alpr_nand_read_byte;
 	nand->write_buf  = alpr_nand_write_buf;
 	nand->read_buf   = alpr_nand_read_buf;
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 	nand->verify_buf = alpr_nand_verify_buf;
+#endif
 	nand->dev_ready  = alpr_nand_dev_ready;
 
 	return 0;
board/socrates/nand.c +6 -0
index 3802c7e..7394478 100644
@@ -18,7 +18,9 @@ static void sc_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len);
 static u_char sc_nand_read_byte(struct mtd_info *mtd);
 static u16 sc_nand_read_word(struct mtd_info *mtd);
 static void sc_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len);
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 static int sc_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len);
+#endif
 static int sc_nand_device_ready(struct mtd_info *mtdinfo);
 
 #define FPGA_NAND_CMD_MASK		(0x7 << 28)
@@ -100,6 +102,7 @@ static void sc_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
 	}
 }
 
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 /**
  * sc_nand_verify_buf -  Verify chip data against buffer
  * @mtd:	MTD device structure
@@ -116,6 +119,7 @@ static int sc_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
 	}
 	return 0;
 }
+#endif
 
 /**
  * sc_nand_device_ready - Check the NAND device is ready for next command.
@@ -174,7 +178,9 @@ int board_nand_init(struct nand_chip *nand)
 	nand->read_word = sc_nand_read_word;
 	nand->write_buf = sc_nand_write_buf;
 	nand->read_buf = sc_nand_read_buf;
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 	nand->verify_buf = sc_nand_verify_buf;
+#endif
 
 	return 0;
 }
board/tqc/tqm8272/nand.c +4 -0
index 4925b8d..7fb2dfa 100644
@@ -188,6 +188,7 @@ static void tqm8272_write_buf(struct mtd_info *mtdinfo, const uint8_t *buf, int
 		*base = buf[i];
 }
 
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 static int tqm8272_verify_buf(struct mtd_info *mtdinfo, const uint8_t *buf, int len)
 {
 	struct nand_chip *this = mtdinfo->priv;
@@ -199,6 +200,7 @@ static int tqm8272_verify_buf(struct mtd_info *mtdinfo, const uint8_t *buf, int
 			return -1;
 	return 0;
 }
+#endif
 #endif /* #ifndef CONFIG_NAND_SPL */
 
 void board_nand_select_device(struct nand_chip *nand, int chip)
@@ -247,8 +249,10 @@ int board_nand_init(struct nand_chip *nand)
 #ifndef CONFIG_NAND_SPL
 	nand->write_buf	 = tqm8272_write_buf;
 	nand->read_buf	 = tqm8272_read_buf;
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 	nand->verify_buf = tqm8272_verify_buf;
 #endif
+#endif
 
 	/*
 	 * Select required NAND chip
common/cmd_ubi.c +1 -27
index 7c4d950..6bd610f 100644
@@ -19,6 +19,7 @@
 #include <onenand_uboot.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/err.h>
 #include <ubi_uboot.h>
 #include <asm/errno.h>
 #include <jffs2/load_kernel.h>
@@ -50,33 +51,6 @@ int ubifs_is_mounted(void);
 void cmd_ubifs_umount(void);
 #endif
 
-static void ubi_dump_vol_info(const struct ubi_volume *vol)
-{
-	ubi_msg("volume information dump:");
-	ubi_msg("vol_id          %d", vol->vol_id);
-	ubi_msg("reserved_pebs   %d", vol->reserved_pebs);
-	ubi_msg("alignment       %d", vol->alignment);
-	ubi_msg("data_pad        %d", vol->data_pad);
-	ubi_msg("vol_type        %d", vol->vol_type);
-	ubi_msg("name_len        %d", vol->name_len);
-	ubi_msg("usable_leb_size %d", vol->usable_leb_size);
-	ubi_msg("used_ebs        %d", vol->used_ebs);
-	ubi_msg("used_bytes      %lld", vol->used_bytes);
-	ubi_msg("last_eb_bytes   %d", vol->last_eb_bytes);
-	ubi_msg("corrupted       %d", vol->corrupted);
-	ubi_msg("upd_marker      %d", vol->upd_marker);
-
-	if (vol->name_len <= UBI_VOL_NAME_MAX &&
-		strnlen(vol->name, vol->name_len + 1) == vol->name_len) {
-		ubi_msg("name            %s", vol->name);
-	} else {
-		ubi_msg("the 1st 5 characters of the name: %c%c%c%c%c",
-				vol->name[0], vol->name[1], vol->name[2],
-				vol->name[3], vol->name[4]);
-	}
-	printf("\n");
-}
-
 static void display_volume_info(struct ubi_device *ubi)
 {
 	int i;
common/cmd_ubifs.c +1 -1
index fdc8bfe..0baa827 100644
@@ -37,7 +37,7 @@ int do_ubifs_mount(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		ubifs_initialized = 1;
 	}
 
-	ret = ubifs_mount(vol_name);
+	ret = uboot_ubifs_mount(vol_name);
 	if (ret)
 		return -1;
 
drivers/mtd/mtdconcat.c +215 -15

375 lines not on this page · raw message

drivers/mtd/mtdcore.c +1040 -72

1,291 lines not on this page · raw message

drivers/mtd/mtdcore.h new file +23 -0
new file mode 100644
index 0000000..7b03533
@@ -0,0 +1,23 @@
+/*
+ * These are exported solely for the purpose of mtd_blkdevs.c and mtdchar.c.
+ * You should not use them for _anything_ else.
+ */
+
+extern struct mutex mtd_table_mutex;
+
+struct mtd_info *__mtd_next_device(int i);
+int add_mtd_device(struct mtd_info *mtd);
+int del_mtd_device(struct mtd_info *mtd);
+int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int);
+int del_mtd_partitions(struct mtd_info *);
+int parse_mtd_partitions(struct mtd_info *master, const char * const *types,
+			 struct mtd_partition **pparts,
+			 struct mtd_part_parser_data *data);
+
+int __init init_mtdchar(void);
+void __exit cleanup_mtdchar(void);
+
+#define mtd_for_each_device(mtd)			\
+	for ((mtd) = __mtd_next_device(0);		\
+	     (mtd) != NULL;				\
+	     (mtd) = __mtd_next_device(mtd->index + 1))
drivers/mtd/mtdpart.c +455 -60

760 lines not on this page · raw message

drivers/mtd/nand/fsl_elbc_nand.c +4 -0
index 2f31fc9..7e1e6ec 100644
@@ -561,6 +561,7 @@ static void fsl_elbc_read_buf(struct mtd_info *mtd, u8 *buf, int len)
 		       len, avail);
 }
 
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 /*
  * Verify buffer against the FCM Controller Data Buffer
  */
@@ -593,6 +594,7 @@ static int fsl_elbc_verify_buf(struct mtd_info *mtd,
 	ctrl->index += len;
 	return i == len && ctrl->status == LTESR_CC ? 0 : -EIO;
 }
+#endif
 
 /* This function is called after Program and Erase Operations to
  * check for success or failure.
@@ -725,7 +727,9 @@ static int fsl_elbc_chip_init(int devnum, u8 *addr)
 	nand->read_byte = fsl_elbc_read_byte;
 	nand->write_buf = fsl_elbc_write_buf;
 	nand->read_buf = fsl_elbc_read_buf;
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 	nand->verify_buf = fsl_elbc_verify_buf;
+#endif
 	nand->select_chip = fsl_elbc_select_chip;
 	nand->cmdfunc = fsl_elbc_cmdfunc;
 	nand->waitfunc = fsl_elbc_wait;
drivers/mtd/nand/fsl_ifc_nand.c +4 -0
index be5a16a..a8d0b20 100644
@@ -681,6 +681,7 @@ static void fsl_ifc_read_buf(struct mtd_info *mtd, u8 *buf, int len)
 		       __func__, len, avail);
 }
 
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 /*
  * Verify buffer against the IFC Controller Data Buffer
  */
@@ -713,6 +714,7 @@ static int fsl_ifc_verify_buf(struct mtd_info *mtd,
 	ctrl->index += len;
 	return i == len && ctrl->status == IFC_NAND_EVTER_STAT_OPC ? 0 : -EIO;
 }
+#endif
 
 /* This function is called after Program and Erase Operations to
  * check for success or failure.
@@ -911,7 +913,9 @@ static int fsl_ifc_chip_init(int devnum, u8 *addr)
 
 	nand->write_buf = fsl_ifc_write_buf;
 	nand->read_buf = fsl_ifc_read_buf;
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 	nand->verify_buf = fsl_ifc_verify_buf;
+#endif
 	nand->select_chip = fsl_ifc_select_chip;
 	nand->cmdfunc = fsl_ifc_cmdfunc;
 	nand->waitfunc = fsl_ifc_wait;
drivers/mtd/nand/fsl_upm.c +4 -0
index 3ae0044..65ce98a 100644
@@ -153,6 +153,7 @@ static void upm_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
 		buf[i] = in_8(chip->IO_ADDR_R);
 }
 
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 static int upm_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
 {
 	int i;
@@ -165,6 +166,7 @@ static int upm_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
 
 	return 0;
 }
+#endif
 
 static int nand_dev_ready(struct mtd_info *mtd)
 {
@@ -191,7 +193,9 @@ int fsl_upm_nand_init(struct nand_chip *chip, struct fsl_upm_nand *fun)
 	chip->read_byte = upm_nand_read_byte;
 	chip->read_buf = upm_nand_read_buf;
 	chip->write_buf = upm_nand_write_buf;
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 	chip->verify_buf = upm_nand_verify_buf;
+#endif
 	if (fun->dev_ready)
 		chip->dev_ready = nand_dev_ready;
 
drivers/mtd/nand/mpc5121_nfc.c +4 -0
index d0f3a35..7233bfc 100644
@@ -459,6 +459,7 @@ static void mpc5121_nfc_write_buf(struct mtd_info *mtd,
 	mpc5121_nfc_buf_copy(mtd, (u_char *) buf, len, 1);
 }
 
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 /* Compare buffer with NAND flash */
 static int mpc5121_nfc_verify_buf(struct mtd_info *mtd,
 				  const u_char * buf, int len)
@@ -479,6 +480,7 @@ static int mpc5121_nfc_verify_buf(struct mtd_info *mtd,
 
 	return 0;
 }
+#endif
 
 /* Read byte from NFC buffers */
 static u8 mpc5121_nfc_read_byte(struct mtd_info *mtd)
@@ -607,7 +609,9 @@ int board_nand_init(struct nand_chip *chip)
 	chip->read_word = mpc5121_nfc_read_word;
 	chip->read_buf = mpc5121_nfc_read_buf;
 	chip->write_buf = mpc5121_nfc_write_buf;
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 	chip->verify_buf = mpc5121_nfc_verify_buf;
+#endif
 	chip->select_chip = mpc5121_nfc_select_chip;
 	chip->bbt_options = NAND_BBT_USE_FLASH;
 	chip->ecc.mode = NAND_ECC_SOFT;
drivers/mtd/nand/mxc_nand.c +8 -0
index ed0ca3a..2e5b5b9 100644
@@ -949,6 +949,8 @@ static void mxc_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
 	host->col_addr = col;
 }
 
+#ifdef __UBOOT__
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 /*
  * Used by the upper layer to verify the data in NAND Flash
  * with the data in the buf.
@@ -972,6 +974,8 @@ static int mxc_nand_verify_buf(struct mtd_info *mtd,
 
 	return 0;
 }
+#endif
+#endif
 
 /*
  * This function is used by upper layer for select and
@@ -1203,7 +1207,11 @@ int board_nand_init(struct nand_chip *this)
 	this->read_word = mxc_nand_read_word;
 	this->write_buf = mxc_nand_write_buf;
 	this->read_buf = mxc_nand_read_buf;
+#ifdef __UBOOT__
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 	this->verify_buf = mxc_nand_verify_buf;
+#endif
+#endif
 
 	host->regs = (struct mxc_nand_regs __iomem *)CONFIG_MXC_NAND_REGS_BASE;
 #ifdef MXC_NFC_V3_2
drivers/mtd/nand/nand_base.c +1381 -512

232 lines not on this page · raw message

drivers/mtd/nand/nand_bbt.c +141 -155

296 lines not on this page · raw message

drivers/mtd/nand/nand_ids.c +141 -125

266 lines not on this page · raw message

drivers/mtd/nand/nand_util.c +3 -0
index b292826..024f6fb 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/nand/ndfc.c +4 -0
index 5510b13..2659595 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/onenand/onenand_base.c +1 -0
index e33e8d3..03deabc 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/onenand/onenand_bbt.c +0 -1
index 0267c2c..52509f1 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/onenand/samsung.c +1 -9
index df04c2b..5e56a29 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/ubi/Makefile +2 -1
index 56c2823..4807f94 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/ubi/attach.c new file +1754 -0

1,754 lines not on this page · raw message

drivers/mtd/ubi/build.c +586 -226

812 lines not on this page · raw message

drivers/mtd/ubi/crc32.c +7 -6
index f1bebf5..0d65bf4 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/ubi/crc32table.h +1 -1
index 0438af4..02ce6fd 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/ubi/debug.c +381 -101

482 lines not on this page · raw message

drivers/mtd/ubi/debug.h +78 -97

175 lines not on this page · raw message

drivers/mtd/ubi/eba.c +315 -159

474 lines not on this page · raw message

drivers/mtd/ubi/fastmap.c new file +1584 -0

1,584 lines not on this page · raw message

drivers/mtd/ubi/io.c +473 -315

788 lines not on this page · raw message

drivers/mtd/ubi/kapi.c +219 -57

276 lines not on this page · raw message

drivers/mtd/ubi/misc.c +53 -5

58 lines not on this page · raw message

drivers/mtd/ubi/scan.c deleted +0 -1348

1,348 lines not on this page · raw message

drivers/mtd/ubi/scan.h deleted +0 -153

153 lines not on this page · raw message

drivers/mtd/ubi/ubi-media.h +176 -29

205 lines not on this page · raw message

drivers/mtd/ubi/ubi.h +496 -114

610 lines not on this page · raw message

drivers/mtd/ubi/upd.c +53 -51

104 lines not on this page · raw message

drivers/mtd/ubi/vmt.c +147 -136

283 lines not on this page · raw message

drivers/mtd/ubi/vtbl.c +200 -159

359 lines not on this page · raw message

drivers/mtd/ubi/wl.c +1033 -557

1,590 lines not on this page · raw message

fs/ubifs/budget.c +640 -22

662 lines not on this page · raw message

fs/ubifs/debug.c +3058 -71

3,129 lines not on this page · raw message

fs/ubifs/debug.h +282 -296

578 lines not on this page · raw message

fs/ubifs/io.c +866 -31

897 lines not on this page · raw message

fs/ubifs/key.h +24 -44

68 lines not on this page · raw message

fs/ubifs/log.c +648 -15

663 lines not on this page · raw message

fs/ubifs/lprops.c +505 -33

538 lines not on this page · raw message

fs/ubifs/lpt.c +1211 -31

1,242 lines not on this page · raw message

fs/ubifs/lpt_commit.c +1886 -17

1,903 lines not on this page · raw message

fs/ubifs/master.c +78 -24

102 lines not on this page · raw message

fs/ubifs/misc.h +75 -84

159 lines not on this page · raw message

fs/ubifs/orphan.c +651 -20

671 lines not on this page · raw message

fs/ubifs/recovery.c +538 -200

738 lines not on this page · raw message

fs/ubifs/replay.c +285 -288

573 lines not on this page · raw message

fs/ubifs/sb.c +510 -37

547 lines not on this page · raw message

fs/ubifs/scan.c +56 -46

102 lines not on this page · raw message

fs/ubifs/super.c +1833 -340

2,173 lines not on this page · raw message

fs/ubifs/tnc.c +652 -90

742 lines not on this page · raw message

fs/ubifs/tnc_misc.c +88 -36

124 lines not on this page · raw message

fs/ubifs/ubifs-media.h +36 -26

62 lines not on this page · raw message

fs/ubifs/ubifs.c +109 -6

115 lines not on this page · raw message

fs/ubifs/ubifs.h +478 -230

708 lines not on this page · raw message

include/linux/mtd/bbm.h +37 -36

73 lines not on this page · raw message

include/linux/mtd/concat.h +4 -0
index c92b4dd..195a4a5 100644

Lines of this file are not shown. View the raw message.

include/linux/mtd/flashchip.h new file +105 -0

105 lines not on this page · raw message

include/linux/mtd/mtd.h +185 -87

272 lines not on this page · raw message

include/linux/mtd/nand.h +272 -79

351 lines not on this page · raw message

include/linux/mtd/partitions.h +33 -27

60 lines not on this page · raw message

include/linux/mtd/ubi.h +92 -28

120 lines not on this page · raw message

include/mtd/mtd-abi.h +131 -52

183 lines not on this page · raw message

include/mtd/ubi-user.h +230 -75

305 lines not on this page · raw message

include/usb/lin_gadget_compat.h +0 -16
index a25e9d9..29fb166 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.8.3.1

Part of the diff is not shown here. View the raw message.

#10 lore raw

PATCH v5 5/5 mtd, ubi, ubifs: resync with Linux-3.14

Quoted 11 lines · Heiko Schocher

resync ubi subsystem with linux:

commit 455c6fdbd219161bd09b1165f11699d6d73de11c

Author: Linus Torvalds <[email protected]>
Date:   Sun Mar 30 20:40:15 2014 -0700
    Linux 3.14

A nice side effect of this, is we introduce UBI Fastmap support to U-Boot.

Quoted 6 lines
Cc Marek Vasut <[email protected]>
Cc Sergey Lapin <[email protected]>
Cc Scott Wood <[email protected]>
Cc Joerg Krause <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140828/32a7a686/attachment.pgp>
#11 lore raw

v5 cover mtd, ubi, ubifs: resync with Linux-3.14

In reply to Heiko Schocher

I applied this series of patches on top of a patch from Stephen Warren from 2014-06-23: [PATCH] usb: ci_udc: fix interaction with CONFIG_USB_ETH_CDC.

Now my USB Ethernet driver does not work anymore. I am using tfpd for downloading files over USB Ethernet Gadget from my notebook to an Freescale i.MX28 board.

This is the error message:

=> run update_rootfs
Updating rootfs ...
using ci_udc, OUT ep- IN ep- STATUS ep-
high speed config #1: 2 mA, Ethernet Gadget, using CDC Ethernet
ERROR: The remote end did not respond in time.
at drivers/usb/gadget/ether.c:2383/usb_eth_init()

Best regards
J?rg Krause

Quoted 245 lines · Heiko Schocher

resync ubi subsystem with linux:

commit 455c6fdbd219161bd09b1165f11699d6d73de11c

Author: Linus Torvalds <[email protected]>
Date:   Sun Mar 30 20:40:15 2014 -0700
     Linux 3.14

A nice side effect of this, is we introduce UBI Fastmap support to U-Boot.

To produce this patch I did two steps:
- simple copy following files from linux to u-boot

drivers/mtd/mtdconcat.c drivers/mtd/mtdcore.c drivers/mtd/mtdpart.c drivers/mtd/ubi/attach.c drivers/mtd/ubi/build.c drivers/mtd/ubi/debug.c drivers/mtd/ubi/debug.h drivers/mtd/ubi/eba.c drivers/mtd/ubi/fastmap.c drivers/mtd/ubi/io.c drivers/mtd/ubi/kapi.c drivers/mtd/ubi/misc.c drivers/mtd/ubi/ubi-media.h drivers/mtd/ubi/ubi.h drivers/mtd/ubi/upd.c drivers/mtd/ubi/vmt.c drivers/mtd/ubi/vtbl.c drivers/mtd/ubi/wl.c fs/ubifs/budget.c
fs/ubifs/debug.c
fs/ubifs/debug.h
fs/ubifs/io.c
fs/ubifs/key.h
fs/ubifs/log.c
fs/ubifs/lprops.c
fs/ubifs/lpt.c fs/ubifs/lpt_commit.c fs/ubifs/master.c
fs/ubifs/misc.h
fs/ubifs/orphan.c fs/ubifs/recovery.c fs/ubifs/replay.c
fs/ubifs/sb.c
fs/ubifs/scan.c
fs/ubifs/super.c
fs/ubifs/tnc.c
fs/ubifs/tnc_misc.c fs/ubifs/ubifs-media.h fs/ubifs/ubifs.h include/linux/mtd/bbm.h include/linux/mtd/flashchip.h include/linux/mtd/mtd.h include/linux/mtd/nand.h include/linux/mtd/partitions.h include/linux/mtd/ubi.h

include/uapi/mtd/mtd-abi.h -> include/linux/mtd include/uapi/mtd/ubi-user.h -> include/linux/mtd

- make the code again compile clean and working -> commit this adapt the Linux code to compile and work with U-Boot.

Then squash this two patches to this patch, to not break bisectability. To make further sync with linux easier, the above two patches can be found in:

http://git.denx.de/?p=u-boot/u-boot-testing.git;a=shortlog;h=refs/heads/update-mtd%2Bubi-linux-v3.14

Please do not use this branch for testing this patchserie!

summary of changes for U-Boot adaptions:
- replace UBI_LINUX in current UBI code from U-Boot with __UBOOT__ as this define is used in other places in U-Boot where code from other projects is used.

- UBI Fastmap is now availiable in U-Boot activate it with CONFIG_MTD_UBI_FASTMAP

- onenand changes only compile tested.

- Following Code in drivers/mtd/nand/nand_base.c nand_do_write_ops() adapted for U-Boot:

       +#ifndef __UBOOT__
             /* Reject writes, which are not page aligned */
             if (NOTALIGNED(to) || NOTALIGNED(ops->len)) {
       +else
       +     /* Reject writes, which are not page aligned */
       +     if (NOTALIGNED(to)) {
       +endif

as the original linux code leads in not working use of the env var "filesize". For example a "nand write 80000000 80000 ${filesize}" would not work with it ...

- add CONFIG_MTD_NAND_VERIFY_WRITE from U-Boot code

- Documented the config defines in README

- kmalloc now uses memalign for allocating memory

Tested it on am33xx, imx6 and mpc83xx boards. MAKEALL for arm and powerpc and mips compiles clean.

Tested UBI fastmap on a board with 512 MiB nand flash. Attach time from old U-Boot was 2 seconds, reduced with UBI fastmap to 0.2 seconds.

Please test this patch!

- changes for v2:
- add lib/linux_compat.c as Joerg Krause detected
- changes for v3:
rebase with current U-Boot commit 61e76f53708cf082ef9061a140b57df3513b8ba1
- changes for v4:
- rebase with commit d8a97f934c64a7ba6f11da5e4cc7f3be57fcb82d
- remove compile error for mips, as Tom Rini suggested check "MAKEALL mips" compiles clean
- fix blackfin and microblaze compile
add fix for blackfin from Trom Rini also add his Signed-off-by

- changes for v5:
- extract linux/compat.h changes

Cc Marek Vasut <[email protected]>
Cc Sergey Lapin <[email protected]>
Cc Scott Wood <[email protected]>
Cc Wolfgang Denk <[email protected]>
Cc Joerg Krause <[email protected]>

Heiko Schocher (5):
lib, rbtree: resync with Linux-3.14
lib, list_sort: add list_sort from linux 3.14 linux include: add ERR_CAST
lib, linux: move linux specific defines to linux/compat.h mtd, ubi, ubifs: resync with Linux-3.14

  README                              |   61 +
  board/prodrive/alpr/nand.c          |    4 +
  board/socrates/nand.c               |    6 +
  board/tqc/tqm8272/nand.c            |    4 +
  common/cmd_ubi.c                    |   28 +-
  common/cmd_ubifs.c                  |    2 +-
  drivers/mtd/mtdconcat.c             |  230 ++-
  drivers/mtd/mtdcore.c               | 1112 ++++++++++++-
  drivers/mtd/mtdcore.h               |   23 +
  drivers/mtd/mtdpart.c               |  515 +++++-
  drivers/mtd/nand/fsl_elbc_nand.c    |    4 +
  drivers/mtd/nand/fsl_ifc_nand.c     |    4 +
  drivers/mtd/nand/fsl_upm.c          |    4 +
  drivers/mtd/nand/mpc5121_nfc.c      |    4 +
  drivers/mtd/nand/mxc_nand.c         |    8 +
  drivers/mtd/nand/nand_base.c        | 1893 +++++++++++++++------
  drivers/mtd/nand/nand_bbt.c         |  296 ++--
  drivers/mtd/nand/nand_ids.c         |  266 +--
  drivers/mtd/nand/nand_util.c        |    3 +
  drivers/mtd/nand/ndfc.c             |    4 +
  drivers/mtd/onenand/onenand_base.c  |    1 +
  drivers/mtd/onenand/onenand_bbt.c   |    1 -
  drivers/mtd/onenand/samsung.c       |   10 +-
  drivers/mtd/ubi/Makefile            |    3 +-
  drivers/mtd/ubi/attach.c            | 1754 ++++++++++++++++++++
  drivers/mtd/ubi/build.c             |  812 ++++++---
  drivers/mtd/ubi/crc32.c             |   13 +-
  drivers/mtd/ubi/crc32table.h        |    2 +-
  drivers/mtd/ubi/debug.c             |  482 ++++--
  drivers/mtd/ubi/debug.h             |  175 +-
  drivers/mtd/ubi/eba.c               |  474 ++++--
  drivers/mtd/ubi/fastmap.c           | 1584 ++++++++++++++++++
  drivers/mtd/ubi/io.c                |  788 +++++----
  drivers/mtd/ubi/kapi.c              |  276 ++-
  drivers/mtd/ubi/misc.c              |   58 +-
  drivers/mtd/ubi/scan.c              | 1348 ---------------
  drivers/mtd/ubi/scan.h              |  153 --
  drivers/mtd/ubi/ubi-media.h         |  205 ++-
  drivers/mtd/ubi/ubi.h               |  610 +++++--
  drivers/mtd/ubi/upd.c               |  104 +-
  drivers/mtd/ubi/vmt.c               |  283 ++--
  drivers/mtd/ubi/vtbl.c              |  359 ++--
  drivers/mtd/ubi/wl.c                | 1590 +++++++++++-------
  drivers/usb/gadget/ether.c          |    5 -
  drivers/usb/gadget/storage_common.c |    5 -
  drivers/usb/musb-new/linux-compat.h |   58 -
  drivers/video/exynos_dp.c           |    1 +
  drivers/video/exynos_mipi_dsi.c     |    1 +
  fs/ubifs/budget.c                   |  662 +++++++-
  fs/ubifs/debug.c                    | 3129 ++++++++++++++++++++++++++++++++++-
  fs/ubifs/debug.h                    |  578 ++++---
  fs/ubifs/io.c                       |  897 +++++++++-
  fs/ubifs/key.h                      |   68 +-
  fs/ubifs/log.c                      |  663 +++++++-
  fs/ubifs/lprops.c                   |  538 +++++-
  fs/ubifs/lpt.c                      | 1242 +++++++++++++-
  fs/ubifs/lpt_commit.c               | 1903 ++++++++++++++++++++-
  fs/ubifs/master.c                   |  102 +-
  fs/ubifs/misc.h                     |  159 +-
  fs/ubifs/orphan.c                   |  671 +++++++-
  fs/ubifs/recovery.c                 |  738 ++++++---
  fs/ubifs/replay.c                   |  573 ++++---
  fs/ubifs/sb.c                       |  547 +++++-
  fs/ubifs/scan.c                     |  102 +-
  fs/ubifs/super.c                    | 2173 ++++++++++++++++++++----
  fs/ubifs/tnc.c                      |  742 ++++++++-
  fs/ubifs/tnc_misc.c                 |  124 +-
  fs/ubifs/ubifs-media.h              |   62 +-
  fs/ubifs/ubifs.c                    |  115 +-
  fs/ubifs/ubifs.h                    |  708 +++++---
  fs/yaffs2/ydirectenv.h              |    2 -
  include/linux/compat.h              |  330 +++-
  include/linux/err.h                 |   17 +-
  include/linux/list_sort.h           |   11 +
  include/linux/mtd/bbm.h             |   73 +-
  include/linux/mtd/concat.h          |    4 +
  include/linux/mtd/flashchip.h       |  105 ++
  include/linux/mtd/mtd.h             |  272 ++-
  include/linux/mtd/nand.h            |  351 +++-
  include/linux/mtd/partitions.h      |   60 +-
  include/linux/mtd/ubi.h             |  120 +-
  include/linux/rbtree.h              |  147 +-
  include/linux/rbtree_augmented.h    |  220 +++
  include/linux/usb/gadget.h          |    6 +-
  include/mtd/mtd-abi.h               |  183 +-
  include/mtd/ubi-user.h              |  305 +++-
  include/ubi_uboot.h                 |  165 +-
  include/usb/lin_gadget_compat.h     |   16 -
  lib/Makefile                        |    2 +
  lib/linux_compat.c                  |   47 +
  lib/list_sort.c                     |  298 ++++
  lib/rbtree.c                        |  684 +++++---
  92 files changed, 28069 insertions(+), 7471 deletions(-)

create mode 100644 drivers/mtd/mtdcore.h create mode 100644 drivers/mtd/ubi/attach.c create mode 100644 drivers/mtd/ubi/fastmap.c delete mode 100644 drivers/mtd/ubi/scan.c delete mode 100644 drivers/mtd/ubi/scan.h create mode 100644 include/linux/list_sort.h create mode 100644 include/linux/mtd/flashchip.h create mode 100644 include/linux/rbtree_augmented.h create mode 100644 lib/linux_compat.c create mode 100644 lib/list_sort.c

#12 lore raw

v5 cover mtd, ubi, ubifs: resync with Linux-3.14

Dear J?rg,

Quoted 8 lines · In message <[email protected]> you wrote:

I applied this series of patches on top of a patch from Stephen Warren from 2014-06-23: [PATCH] usb: ci_udc: fix interaction with CONFIG_USB_ETH_CDC.

Now my USB Ethernet driver does not work anymore. I am using tfpd for downloading files over USB Ethernet Gadget from my notebook to an Freescale i.MX28 board.

It is definitely not wise to testseveral independent changes at once, as you will never know which of them (or any interacton between these) caused the problem.

I strongly recommend to apply only one of these patches iitially, then test it, and only if it works, then apply the second patch (series).

Quoted 8 lines

This is the error message:

=> run update_rootfs
Updating rootfs ...
using ci_udc, OUT ep- IN ep- STATUS ep-
high speed config #1: 2 mA, Ethernet Gadget, using CDC Ethernet
ERROR: The remote end did not respond in time.
at drivers/usb/gadget/ether.c:2383/usb_eth_init()

It would have been helpful to show the actual commands here, instead of referring to "update_rootfs" the definition of which is unknown to us. In any case, this looks like a USB gadget driver related issue, which is independent from Heiko's changes. So I think you wpuld have seen the same problem when testing Stephen's patch alone. You should do that, and eventually report the problem against the "usb: ci_udc:
fix interaction..." patch.

The mtd, ubi, ubifs update appears to be innocent here.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Life. Don't talk to me about life.      - Marvin the Paranoid Android
#13 lore raw

v5 cover mtd, ubi, ubifs: resync with Linux-3.14

Dear Wolfgang,

Quoted 7 lines · Wolfgang Denk

Dear J?rg,

Quoted 4 lines · In message <[email protected]> you wrote:

I applied this series of patches on top of a patch from Stephen Warren from 2014-06-23: [PATCH] usb: ci_udc: fix interaction with CONFIG_USB_ETH_CDC.

Quoted 6 lines
Quoted 3 lines

Now my USB Ethernet driver does not work anymore. I am using tfpd for downloading files over USB Ethernet Gadget from my notebook to an Freescale i.MX28 board.

It is definitely not wise to testseveral independent changes at once, as you will never know which of them (or any interacton between these) caused the problem.

I understand.

Since commit 2813006fecdab740c3745b2dcbb06777cdd51dff on u-boot-imx branch the USB Ethernet driver on my custom i.MX28 board is broken. I cannot use tftp for downloading a file. The patch from Stephen Warren fixed most (but not all) problems with the driver.

Quoted 4 lines

I strongly recommend to apply only one of these patches iitially, then test it, and only if it works, then apply the second patch (series)

Stephen Warren, Marek Vasut and I am trying to figure out, why USB Ethernet driver is broken since the stated commit. One assumption of Stephen Warren was that is has something to do with mtd or ubifs. That's why I am reporting this.

Quoted 8 lines
Quoted 8 lines

This is the error message:

=> run update_rootfs
Updating rootfs ...
using ci_udc, OUT ep- IN ep- STATUS ep-
high speed config #1: 2 mA, Ethernet Gadget, using CDC Ethernet
ERROR: The remote end did not respond in time.
at drivers/usb/gadget/ether.c:2383/usb_eth_init()

Quoted 7 lines

It would have been helpful to show the actual commands here, instead of referring to "update_rootfs" the definition of which is unknown to us. In any case, this looks like a USB gadget driver related issue, which is independent from Heiko's changes. So I think you wpuld have seen the same problem when testing Stephen's patch alone. You should do that, and eventually report the problem against the "usb: ci_udc:
fix interaction..." patch.

That's right. I already reported the problem to Stephen Warren.

Quoted 2 lines

The mtd, ubi, ubifs update appears to be innocent here.

Seems so. Maybe I will revert the patches from Stephen Warren to the commit where my USB Ethernet driver worked well and apply the mtd, ubi, ubifs patches for testing.

Quoted 5 lines

Best regards,

Wolfgang Denk

Best regards
J?rg Krause

#14 lore raw

v5 cover mtd, ubi, ubifs: resync with Linux-3.14

Quoted 18 lines · J?rg Krause

Dear Wolfgang,

Quoted 7 lines · Wolfgang Denk

Dear J?rg,

Quoted 4 lines · In message <[email protected]> you wrote:

I applied this series of patches on top of a patch from Stephen Warren from 2014-06-23: [PATCH] usb: ci_udc: fix interaction with CONFIG_USB_ETH_CDC.

Quoted 7 lines
Quoted 3 lines

Now my USB Ethernet driver does not work anymore. I am using tfpd for downloading files over USB Ethernet Gadget from my notebook to an Freescale i.MX28 board.

It is definitely not wise to testseveral independent changes at once, as you will never know which of them (or any interacton between these) caused the problem.

Quoted 6 lines

I understand.

Since commit 2813006fecdab740c3745b2dcbb06777cdd51dff on u-boot-imx branch the USB Ethernet driver on my custom i.MX28 board is broken. I cannot use tftp for downloading a file. The patch from Stephen Warren fixed most (but not all) problems with the driver.

I would actually be really glad if you could test plain u-boot-usb/master and see if your USB problem is present there. Also, it would be really nice to isolate the sequence of commands which triggers the bug, so we have a proper reproducible testcase.

Anyway, this thread is not a place where I would like to discuss this. This should be discussed in the "original" thread, that is:

Subj: [PATCH] usb: ci_udc: fix interaction with CONFIG_USB_ETH_CDC

[...]

Best regards,
Marek Vasut

#15 lore raw

v5 cover mtd, ubi, ubifs: resync with Linux-3.14

In reply to Jörg Krause
Quoted 23 lines · J?rg Krause

Dear Wolfgang,

Quoted 7 lines · Wolfgang Denk

Dear J?rg,

Quoted 4 lines · In message <[email protected]> you wrote:

I applied this series of patches on top of a patch from Stephen Warren from 2014-06-23: [PATCH] usb: ci_udc: fix interaction with CONFIG_USB_ETH_CDC.

Quoted 6 lines
Quoted 3 lines

Now my USB Ethernet driver does not work anymore. I am using tfpd for downloading files over USB Ethernet Gadget from my notebook to an Freescale i.MX28 board.

It is definitely not wise to testseveral independent changes at once, as you will never know which of them (or any interacton between these) caused the problem.

I understand.

Since commit 2813006fecdab740c3745b2dcbb06777cdd51dff on u-boot-imx branch the USB Ethernet driver on my custom i.MX28 board is broken. I cannot use tftp for downloading a file. The patch from Stephen Warren fixed most (but not all) problems with the driver.

Quoted 1 line
Quoted 7 lines
Quoted 3 lines

I strongly recommend to apply only one of these patches iitially, then test it, and only if it works, then apply the second patch (series)

Stephen Warren, Marek Vasut and I am trying to figure out, why USB Ethernet driver is broken since the stated commit. One assumption of Stephen Warren was that is has something to do with mtd or ubifs. That's why I am reporting this.

That's not quite true. I had asked you to bisect your branch to find out *which* commit caused the problems. Anyway, hopefully the issue will become clearer once I read the responses to the ci_udc patch...