Skip to content
Snippets Groups Projects
  1. Apr 22, 2016
    • Heiko Schocher's avatar
      ubifs: fix memory corruption in super.c · b1d6590d
      Heiko Schocher authored
      
      In list "super_blocks" ubifs collects allocated super_block
      structs. U-Boot frees on unmount the allocated struct,
      so the pointer stored in this list is free after the umount.
      On a new ubifs mount, the new allocated super_block struct
      get inserted into the super_blocks list ... which contains
      now a freed pointer, and the list_add_tail() corrupts the
      freed memory ...
      
      2 solutions are possible:
      - remove the super_block from the super_blocks list
        on umount
      
      - as U-Boot does not use the super_blocks list ...
        remove it complete for U-Boot.
      
      Both solutions should not introduce problems for porting
      to newer linux version, so this patch removes the unused
      super_blocks list, as it saves code size and execution
      time.
      
      Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
      b1d6590d
  2. Mar 14, 2016
  3. Jan 25, 2016
  4. Jan 19, 2016
  5. Nov 05, 2015
  6. Oct 26, 2015
  7. Oct 24, 2015
  8. Sep 11, 2015
    • Simon Glass's avatar
      Move malloc_cache_aligned() to its own header · 6e295186
      Simon Glass authored
      
      At present malloc.h is included everywhere since it recently was added to
      common.h in this commit:
      
         4519668b mtd/nand/ubi: assortment of alignment fixes
      
      This seems wasteful and unnecessary. We have been trying to trim down
      common.h and put separate functions into separate header files and that
      change goes in the opposite direction.
      
      Move malloc_cache_aligned() to a new header so that this can be avoided.
      The header would perhaps be better named as alignmem.h but it needs to be
      included after common.h and people might be confused by this. With the name
      memalign.h it fits nicely after malloc() in most cases.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      Acked-by: default avatarMarcel Ziswiler <marcel.ziswiler@toradex.com>
      6e295186
  9. Aug 28, 2015
  10. Jan 29, 2015
  11. Jan 28, 2015
  12. Nov 20, 2014
    • Masahiro Yamada's avatar
      include: move various macros to include/linux/kernel.h · cba1da49
      Masahiro Yamada authored
      
      U-Boot has imported various utility macros from Linux
      scattering them to various places without consistency.
      
      In include/common.h are min, max, min3, max3, ARRAY_SIZE, ALIGN,
      container_of, DIV_ROUND_UP, etc.
      In include/linux/compat.h are min_t, max_t, round_up, round_down,
      etc.
      We also have duplicated defines of min_t in some *.c files.
      
      Moreover, we are suffering from too cluttered include/common.h.
      
      This commit moves various macros that originate in
      include/linux/kernel.h of Linux to their original position.
      
      Note:
      This commit simply moves the macros; the macros roundup,
      min, max, min2, max3, ARRAY_SIZE are different
      from those of Linux at this point.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
      cba1da49
  13. Sep 24, 2014
  14. Sep 16, 2014
  15. Aug 25, 2014
    • Heiko Schocher's avatar
      mtd,ubi,ubifs: sync with linux v3.15 · 4e67c571
      Heiko Schocher authored
      
      snyc with linux v3.15:
      
      commit 1860e379875dfe7271c649058aeddffe5afd9d0d
      Author: Linus Torvalds <torvalds@linux-foundation.org>
      Date:   Sun Jun 8 11:19:54 2014 -0700
      
          Linux 3.15
      
      Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
      Cc: Scott Wood <scottwood@freescale.com>
      Cc: Tom Rini <trini@ti.com>
      4e67c571
    • Heiko Schocher's avatar
      mtd, ubi, ubifs: update for the sync with linux v3.14 · ddf7bcfa
      Heiko Schocher authored
      
      while playing with the new mtd/ubi/ubifs sync, found some
      small updates for it:
      
      - add del_mtd_partition() to include/linux/mtd/mtd
      - mtd: add a debug_printf
      - remove some not used functions
      
      Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
      Cc: Scott Wood <scottwood@freescale.com>
      Cc: Tom Rini <trini@ti.com>
      ddf7bcfa
    • Heiko Schocher's avatar
      mtd, ubi, ubifs: resync with Linux-3.14 · ff94bc40
      Heiko Schocher authored
      
      resync ubi subsystem with linux:
      
      commit 455c6fdbd219161bd09b1165f11699d6d73de11c
      Author: Linus Torvalds <torvalds@linux-foundation.org>
      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.
      
      Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
      Signed-off-by: default avatarTom Rini <trini@ti.com>
      Cc: Marek Vasut <marex@denx.de>
      Cc: Sergey Lapin <slapin@ossfans.org>
      Cc: Scott Wood <scottwood@freescale.com>
      Cc: Joerg Krause <jkrause@posteo.de>
      ff94bc40
  16. May 12, 2014
  17. Feb 26, 2014
    • Tom Rini's avatar
      arm: Switch to -mno-unaligned-access when supported by the compiler · 1551df35
      Tom Rini authored
      
      When we tell the compiler to optimize for ARMv7 (and ARMv6 for that
      matter) it assumes a default of SCTRL.A being cleared and unaligned
      accesses being allowed and fast at the hardware level.  We set this bit
      and must pass along -mno-unaligned-access so that the compiler will
      still breakdown accesses and not trigger a data abort.
      
      To better help understand the requirements of the project with respect
      to unaligned memory access, the
      Documentation/unaligned-memory-access.txt file has been added as
      doc/README.unaligned-memory-access.txt and is taken from the v3.14-rc1
      tag of the kernel.
      
      Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
      Cc: Mans Rullgard <mans@mansr.com>
      Signed-off-by: default avatarTom Rini <trini@ti.com>
      1551df35
  18. Feb 21, 2014
  19. Feb 19, 2014
    • Masahiro Yamada's avatar
      kbuild: use Linux Kernel build scripts · 6825a95b
      Masahiro Yamada authored
      
      Now we are ready to switch over to real Kbuild.
      
      This commit disables temporary scripts:
        scripts/{Makefile.build.tmp, Makefile.host.tmp}
      and enables real Kbuild scripts:
        scripts/{Makefile.build,Makefile.host,Makefile.lib}.
      
      This switch is triggered by the line in scripts/Kbuild.include
        -build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
        +build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
      
      We need to adjust some build scripts for U-Boot.
      But smaller amount of modification is preferable.
      
      Additionally, we need to fix compiler flags which are
      locally added or removed.
      
      In Kbuild, it is not allowed to change CFLAGS locally.
      Instead, ccflags-y, asflags-y, cppflags-y,
      CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
      are prepared for that purpose.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
      Tested-by: default avatarGerhard Sittig <gsi@denx.de>
      6825a95b
    • Masahiro Yamada's avatar
      kbuild: change out-of-tree build · 9e414032
      Masahiro Yamada authored
      
      This commit changes the working directory
      where the build process occurs.
      
      Before this commit, build process occurred under the source
      tree for both in-tree and out-of-tree build.
      
      That's why we needed to add $(obj) prefix to all generated
      files in makefiles like follows:
        $(obj)u-boot.bin:  $(obj)u-boot
      
      Here, $(obj) is empty for in-tree build, whereas it points
      to the output directory for out-of-tree build.
      
      And our old build system changes the current working directory
      with "make -C <sub-dir>" syntax when descending into the
      sub-directories.
      
      On the other hand, Kbuild uses a different idea
      to handle out-of-tree build and directory descending.
      
      The build process of Kbuild always occurs under the output tree.
      When "O=dir/to/store/output/files" is given, the build system
      changes the current working directory to that directory and
      restarts the make.
      
      Kbuild uses "make -f $(srctree)/scripts/Makefile.build obj=<sub-dir>"
      syntax for descending into sub-directories.
      (We can write it like "make $(obj)=<sub-dir>" with a shorthand.)
      This means the current working directory is always the top
      of the output directory.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
      Tested-by: default avatarGerhard Sittig <gsi@denx.de>
      9e414032
  20. Nov 17, 2013
  21. Oct 31, 2013
  22. Oct 14, 2013
  23. Jul 24, 2013
  24. Apr 11, 2013
  25. Mar 04, 2013
    • Joe Hershberger's avatar
      ubifs: Allow ubifsmount volume reference by number · 949a7710
      Joe Hershberger authored
      
      UBI can mount volumes by name or number  The current code forces you
      to name the volume by prepending every name with "ubi:".
      
      >From fs/ubifs/super.c
       * There are several ways to specify UBI volumes when mounting UBIFS:
       * o ubiX_Y    - UBI device number X, volume Y;
       * o ubiY      - UBI device number 0, volume Y;
       * o ubiX:NAME - mount UBI device X, volume with name NAME;
       * o ubi:NAME  - mount UBI device 0, volume with name NAME.
      
      Now any name passed in any of the above forms are allowed.
      
      Also update the configs that referenced ubifsmount.
      
      Signed-off-by: default avatarJoe Hershberger <joe.hershberger@ni.com>
      949a7710
  26. Mar 01, 2013
  27. Oct 15, 2012
    • Albert ARIBAUD's avatar
      ARM: prevent misaligned array inits · b823fd9b
      Albert ARIBAUD authored
      
      Under option -munaligned-access, gcc can perform local char
      or 16-bit array initializations using misaligned native
      accesses which will throw a data abort exception. Fix files
      where these array initializations were unneeded, and for
      files known to contain such initializations, enforce gcc
      option -mno-unaligned-access.
      
      Signed-off-by: default avatarAlbert ARIBAUD <albert.u.boot@aribaud.net>
      [trini: Switch to usign call cc-option for -mno-unaligned-access as
      Albert had done previously as that's really correct]
      Signed-off-by: default avatarTom Rini <trini@ti.com>
      b823fd9b
  28. Sep 10, 2012
    • Veli-Pekka Peltola's avatar
      ubifs: Fix ubifsload when using ZLIB · 8044c138
      Veli-Pekka Peltola authored
      
      Using ZLIB compression with UBIFS fails if last data node is not a size of
      UBIFS_BLOCK_SIZE (4096 bytes).
      
      Easiest way to test this is trying to read a file smaller than 4k:
      => ubifsload 41000000 /etc/fstab
      Loading file '/etc/fstab' to addr 0x41000000 with size 704 (0x000002c0)...
      UBIFS error (pid 0): read_block: bad data node (block 0, inode 2506)
      UBIFS error (pid 0): do_readpage: cannot read page 0 of inode 2506, error -22
      Error reading file '/etc/fstab'
      /etc/fstab not found!
      exit not allowed from main input shell.
      =>
      
      With this patch:
      
      => ubifsload 41000000 /etc/fstab
      Loading file '/etc/fstab' to addr 0x41000000 with size 704 (0x000002c0)...
      Done
      =>
      
      Signed-off-by: default avatarVeli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
      Cc: kmpark@infradead.org
      Tested-by: default avatarAndreas Bießmann <andreas.devel@googlemail.com>
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      8044c138
  29. Sep 03, 2012
  30. Aug 09, 2012
  31. Oct 12, 2011
    • Lars Poeschel's avatar
      ubifs bad superblock bug · 349a8d5e
      Lars Poeschel authored
      
      This patch fixes an issue when ubifs reads a bad superblock. Later it
      tries to free memory, that was not allocated, which freezes u-boot.
      This is fixed by looking for a non null pointer before free.
      
      The message I got before u-boot freezes:
      UBI: max/mean erase counter: 53/32
      UBIFS: mounted UBI device 0, volume 1, name "rootfs"
      UBIFS: mounted read-only
      UBIFS: file system size:   49140 bytes (50319360 KiB, 0 MiB, 49140 LEBs)
      UBIFS: journal size:       49 bytes (6838272 KiB, 0 MiB, 6678 LEBs)
      UBIFS: media format:       w4/r0 (latest is w4/r0)
      UBIFS: default compressor: LZO
      UBIFS: reserved for root:  0 bytes (0 KiB)
      UBIFS error (pid 0): ubifs_read_node: bad node type (255 but expected 9)
      UBIFS error (pid 0): ubifs_read_node: bad node at LEB 330:13104
      UBIFS error (pid 0): ubifs_iget: failed to read inode 1, error -22
      Error reading superblock on volume 'ubi:rootfs'!
      
      Signed-off-by: default avatarLars Poeschel <larsi@wh2.tu-dresden.de>
      Cc: Kyungmin Park <kmpark@infradead.org>
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      349a8d5e
  32. Sep 09, 2011
  33. Aug 19, 2011
  34. Jan 11, 2011
Loading