- Oct 25, 2011
-
-
Anton staaf authored
Currently, if a device read request is done that does not begin or end on a sector boundary a stack allocated bounce buffer is used to perform the read, and then just the part of the sector that is needed is copied into the users buffer. This stack allocation can mean that the bounce buffer will not be aligned to the dcache line size. This is a problem when caches are enabled because unaligned cache invalidates are not safe. This patch uses ALLOC_CACHE_ALIGN_BUFFER to create a stack allocated cache line size aligned bounce buffer. Signed-off-by:
Anton Staaf <robotboy@chromium.org> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Dave Liu <r63238@freescale.com> Cc: Andy Fleming <afleming@gmail.com> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Change-Id: I32e1594d90ef039137bb219b0f7ced55768744ff Acked-by:
Mike Frysinger <vapier@gentoo.org>
-
- Oct 15, 2011
-
-
Mike Frysinger authored
The top level Makefile does not do any recursion into subdirs when cleaning, so these clean/distclean targets in random arch/board dirs never get used. Punt them all. MAKEALL didn't report any errors related to this that I could see. Signed-off-by:
Mike Frysinger <vapier@gentoo.org>
-
- Oct 12, 2011
-
-
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:
Lars Poeschel <larsi@wh2.tu-dresden.de> Cc: Kyungmin Park <kmpark@infradead.org> Signed-off-by:
Stefan Roese <sr@denx.de>
-
- Oct 09, 2011
-
-
Wolfgang Denk authored
Fix: jffs2_1pass.c: In function 'jffs2_1pass_read_inode': jffs2_1pass.c:699:7: warning: variable 'ret' set but not used [-Wunused-but-set-variable] jffs2_1pass.c: In function 'jffs2_1pass_build_lists': jffs2_1pass.c:1578:14: warning: variable 'empty_start' set but not used [-Wunused-but-set-variable] Signed-off-by:
Wolfgang Denk <wd@denx.de>
-
- Oct 01, 2011
-
-
Sergei Shtylyov authored
Currently in do_fat_read() when reading FAT sectors, we have to divide down LINEAR_PREFETCH_SIZE by the sector size, whereas it's defined as 2 sectors worth of bytes. In order to avoid redundant multiplication/division, introduce #define PREFETCH_BLOCKS instead of #define LINEAR_PREFETCH_SIZE. Signed-off-by:
Sergei Shtylyov <sshtylyov@mvista.com>
-
Sergei Shtylyov authored
The root directory cluster field only exists in a FAT32 boot sector, so the 'root_cluster' variable in do_fat_read() contains garbage in case of FAT12/16. Make it contain 0 instead as this is what is passed to get_vfatname() in that case anyway. Signed-off-by:
Sergei Shtylyov <sshtylyov@mvista.com>
-
Sergei Shtylyov authored
The code multiples the FAT size in sectors by the sector size and then tries to compare that to the number of sectors in the 'getsize' variable. While fixing this, also change the initial value of 'getsize' as the division of FATBUFSIZE by the sector size gets us FATBUFBLOCKS. Signed-off-by:
Sergei Shtylyov <sshtylyov@mvista.com>
-
Sergei Shtylyov authored
Apple iPod nanos have sector sizes of 2 or 4 KiB, which crashes U-Boot when it tries to read the boot sector into 512-byte buffer situated on stack. Make the FAT code indifferent to the sector size. Signed-off-by:
Sergei Shtylyov <sshtylyov@mvista.com>
-
- Sep 09, 2011
-
-
Wolfgang Denk authored
Commit 46d7274c "UBIFS: Change ubifsload to set the filesize variable" introduced the follwing compiler warning: ubifs.c: In function 'ubifs_load': ubifs.c:742: warning: format '%lX' expects type 'long unsigned int', but argument 3 has type 'u32' Signed-off-by:
Wolfgang Denk <wd@denx.de> Cc: Bastian Ruppert <Bastian.Ruppert@Sewerin.de>
-
Bastian Ruppert authored
This is the same behaviour like tftp or fatload command. Signed-off-by:
Bastian Ruppert <Bastian.Ruppert@Sewerin.de> CC: kmpark@infradead.org Acked-by:
Detlev Zundel <dzu@denx.de>
-
Wolfgang Denk authored
Fix these: yaffs_guts.c: In function 'yaffs_ReadDataFromFile': yaffs_guts.c:4622: warning: pointer targets in passing argument 3 of 'yaffs_AddrToChunk' differ in signedness yaffs_guts.c:4622: warning: pointer targets in passing argument 4 of 'yaffs_AddrToChunk' differ in signedness yaffs_guts.c: In function 'yaffs_WriteDataToFile': yaffs_guts.c:4745: warning: pointer targets in passing argument 3 of 'yaffs_AddrToChunk' differ in signedness yaffs_guts.c:4745: warning: pointer targets in passing argument 4 of 'yaffs_AddrToChunk' differ in signedness yaffs_guts.c: In function 'yaffs_ResizeFile': yaffs_guts.c:4968: warning: pointer targets in passing argument 3 of 'yaffs_AddrToChunk' differ in signedness yaffs_guts.c:4968: warning: pointer targets in passing argument 4 of 'yaffs_AddrToChunk' differ in signedness yaffs_guts.c: In function 'yaffs_GutsInitialise': yaffs_guts.c:7235: warning: assignment from incompatible pointer type yaffs_guts.c: In function 'yaffs_CreateNewObject': yaffs_guts.c:2143: warning: 'tn' may be used uninitialized in this function yaffs_guts.c: In function 'yaffs_MknodObject': yaffs_guts.c:2258: warning: 'str' may be used uninitialized in this function Signed-off-by:
Wolfgang Denk <wd@denx.de>
-
Wolfgang Denk authored
Fix these: yaffs_guts.c: At top level: yaffs_guts.c:400: warning: 'yaffs_SkipFullVerification' defined but not used Testing shows no changes of the image sizes. Signed-off-by:
Wolfgang Denk <wd@denx.de>
-
Wolfgang Denk authored
Fix these: yaffs_guts.c: In function 'yaffs_Scan': yaffs_guts.c:5436: warning: pointer targets in passing argument 4 of 'yaffs_QueryInitialBlockState' differ in signedness yaffs_guts.c: In function 'yaffs_ScanBackwards': yaffs_guts.c:6017: warning: pointer targets in passing argument 4 of 'yaffs_QueryInitialBlockState' differ in signedness yaffs_nand.c: In function 'yaffs_QueryInitialBlockState': yaffs_nand.c:109: warning: pointer targets in passing argument 4 of 'dev->queryNANDBlock' differ in signedness yaffs_nand.c:113: warning: pointer targets in passing argument 4 of 'yaffs_TagsCompatabilityQueryNANDBlock' differ in signedness Signed-off-by:
Wolfgang Denk <wd@denx.de>
-
Wolfgang Denk authored
Drop the "-DNO_Y_INLINE" setting to fix these: yaffs_guts.h:806: warning: 'yaffs_GetBlockInfo' defined but not used Impact on image size is negligible - for the VCMA9 board the text segment size grew from 496353 to 496357 bytes (i. e. 0.0008%); total image size even remained constant. Signed-off-by:
Wolfgang Denk <wd@denx.de>
-
Wolfgang Denk authored
Fix these: yaffscfg.c: In function 'cmd_yaffs_mread_file': yaffscfg.c:316: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'char *' yaffscfg.c: In function 'cmd_yaffs_ls': yaffscfg.c:371: warning: format '%7d' expects type 'int', but argument 3 has type 'off_t' Signed-off-by:
Wolfgang Denk <wd@denx.de>
-
- Aug 19, 2011
-
-
Wolfgang Denk authored
Free private_data member element before freeing file structure. This was causing malloc to crash. Also remove unnecessary variable assigments as file structure gets free'd as well. Signed-off-by:
Rod Boyce <uboot@teamboyce.co.uk> Signed-off-by:
Wolfgang Denk <wd@denx.de> Cc: Stefan Roese <sr@denx.de> Signed-off-by:
Stefan Roese <sr@denx.de>
-
- Aug 04, 2011
-
-
Albert ARIBAUD authored
There was a mix of UTF-8 and ISO-8859 files in the U-Boot source tree, which could cause issues with the patchwork review system. This commit converts all ISO-8859 files to UTF-8. Signed-off-by:
Albert ARIBAUD <albert.u.boot@aribaud.net>
-
- Jul 28, 2011
-
-
Anton Staaf authored
Previously reading or writing zero full sectors (reading the end of one sector and the beginning of the next for example) was special cased and involved stack allocating a second sector buffer. This change uses the same code path for this case as well as when there are a non-zero number of full sectors to access. The result is easier to read and reduces the maximum stack used. Signed-off-by:
Anton Staaf <robotboy@chromium.org> Cc: Andy Fleming <afleming@freescale.com> Acked-by:
Detlev Zundel <dzu@denx.de>
-
Anton Staaf authored
Fix all checkpatch violations in the low level Ext2 block device reading code. This is done in preparation for cleaning up the partial sector access code. Signed-off-by:
Anton Staaf <robotboy@chromium.org> Cc: Andy Fleming <afleming@freescale.com> Acked-by:
Detlev Zundel <dzu@denx.de>
-
- Jul 26, 2011
-
-
Aneesh V authored
Signed-off-by:
Aneesh V <aneesh@ti.com>
-
- May 10, 2011
-
-
Heiko Schocher authored
cc: Wolfgang Denk <wd@denx.de> cc: Detlev Zundel <dzu@denx.de> cc: Valentin Longchamp <valentin.longchamp@keymile.com> cc: Holger Brunck <holger.brunck@keymile.com> Signed-off-by:
Valentin Longchamp <valentin.longchamp@keymile.com>
-
- Apr 12, 2011
-
-
Loïc Minier authored
Signed-off-by:
Loc Minier <loic.minier@linaro.org>
-
- Apr 02, 2011
-
-
Erik Hansen authored
Fat directory handling didn't check reaching the end of the root directory. It relied on a stop condition based on a directory entry with a name starting with a '\0' character. This check in itself is wrong ('\0' indicates free entry, not end_of_directory) but outside the scope of this fix. For FAT32, the end of the rootdir is reached when the end of the cluster chain is reached. The code didn't check this condition and started to read an incorrect cluster. This caused a subsequent read request of a sector outside the range of the usb stick in use. On its turn, the usb stick protested with a stall handshake. Both FAT32 and non-FAT32 (FAT16/FAT12) end or rootdir checks have been put in. Signed-off-by:
Erik Hansen <erik@makarta.com>
-
- Jan 11, 2011
-
-
Dirk Behme authored
Fix compiler warning In file included from ubifs.h:2137:0, from ubifs.c:26: misc.h: In function 'ubifs_idx_key': misc.h:263:26: warning: dereferencing type-punned pointer will break strict-aliasing rules seen with gcc version 4.5.1 (Sourcery G++ Lite 2010.09-50). No functional change. CC: Stefan Roese <sr@denx.de> Signed-off-by:
Dirk Behme <dirk.behme@googlemail.com> Signed-off-by:
Stefan Roese <sr@denx.de>
-
- Dec 09, 2010
-
-
Mike Frysinger authored
Signed-off-by:
Mike Frysinger <vapier@gentoo.org>
-
- Dec 03, 2010
-
-
Ricardo Ribalda Delgado authored
The link_name variable is declared inside the if block and it is used outside it through the name pointer. Signed-off-by:
Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by:
Stefan Roese <sr@denx.de>
-
Stefan Roese authored
Until now ubifsload pads the destination with 0 up to a multiple of UBIFS_BLOCK_SIZE (4KiB) while reading a file to memory. This patch changes this behaviour to only read to the requested length. This is either the file length or the length/size provided as parameter to the ubifsload command. Signed-off-by:
Stefan Roese <sr@denx.de>
-
Stefan Roese authored
This new ubifsumount command allows the user to unmount a previously mounted UBIFS volume. Signed-off-by:
Stefan Roese <sr@denx.de>
-
- Nov 28, 2010
-
-
Mike Frysinger authored
Signed-off-by:
Mike Frysinger <vapier@gentoo.org>
-
- Nov 17, 2010
-
-
Sebastien Carlier authored
Before this commit, weak symbols were not overridden by non-weak symbols found in archive libraries when linking with recent versions of binutils. As stated in the System V ABI, "the link editor does not extract archive members to resolve undefined weak symbols". This commit changes all Makefiles to use partial linking (ld -r) instead of creating library archives, which forces all symbols to participate in linking, allowing non-weak symbols to override weak symbols as intended. This approach is also used by Linux, from which the gmake function cmd_link_o_target (defined in config.mk and used in all Makefiles) is inspired. The name of each former library archive is preserved except for extensions which change from ".a" to ".o". This commit updates references accordingly where needed, in particular in some linker scripts. This commit reveals board configurations that exclude some features but include source files that depend these disabled features in the build, resulting in undefined symbols. Known such cases include: - disabling CMD_NET but not CMD_NFS; - enabling CONFIG_OF_LIBFDT but not CONFIG_QE. Signed-off-by:
Sebastien Carlier <sebastien.carlier@gmail.com>
-
- Oct 29, 2010
-
-
Wolfgang Denk authored
By now, the majority of architectures have working relocation support, so the few remaining architectures have become exceptions. To make this more obvious, we make working relocation now the default case, and flag the remaining cases with CONFIG_NEEDS_MANUAL_RELOC. Signed-off-by:
Wolfgang Denk <wd@denx.de> Tested-by:
Heiko Schocher <hs@denx.de> Tested-by:
Reinhard Meyer <u-boot@emk-elektronik.de>
-
- Oct 20, 2010
-
-
Stefano Babic authored
Last commit 3831530d was intended "explicitly specify FAT12/16 root directory parsing buffer size, instead of relying on cluster size". Howver, the underlying function requires the size of the buffer in blocks, not in bytes, and instead of passing a double sector size a request for 1024 blocks is sent. This generates a buffer overflow with overwriting of other structure (in the case seen, USB structures were overwritten). Signed-off-by:
Stefano Babic <sbabic@denx.de> CC: Mikhail Zolotaryov <lebon@lebon.org.ua>
-
- Oct 12, 2010
-
-
Mikhail Zolotaryov authored
The U-Boot code has the following bugs related to the processing of Long File Name (LFN) entries scattered across several clusters/sectors : 1) get_vfatname() function is designed to gather scattered LFN entries by cluster chain processing - that doesn't work for FAT12/16 root directory. In other words, the function expects the following input data: 1.1) FAT32 directory (which is cluster chain based); OR 1.2) FAT12/16 non-root directory (which is also cluster chain based); OR 1.3) FAT12/16 root directory (allocated as contiguous sectors area), but all necessary information MUST be within the input buffer of filesystem cluster size (thus cluster-chain jump is never initiated). In order to accomplish the last condition, root directory parsing code in do_fat_read() uses the following trick: read-out cluster-size block, process only first sector (512 bytes), then shift 512 forward, read-out cluster-size block and so on. This works great unless cluster size is equal to 512 bytes (in a case you have a small partition), or long file name entries are scattered across three sectors, see 4) for details. 2) Despite of the fact that get_vfatname() supports FAT32 root directory browsing, do_fat_read() function doesn't send current cluster number correctly, so root directory look-up doesn't work correctly. 3) get_vfatname() doesn't gather scattered entries correctly also is the case when all LFN entries are located at the end of the source cluster, but real directory entry (which must be returned) is at the only beginning of the next one. No error detected, the resulting directory entry returned contains a semi-random information (wrong size, wrong start cluster number and so on) i.e. the entry is not accessible. 4) LFN (VFAT) allows up to 20 entries (slots) each containing 26 bytes (13 UTF-16 code units) to represent a single long file name i.e. up to 520 bytes. U-Boot allocates 256 bytes buffer instead, i.e. 10 or more LFN slots record may cause buffer overflow / memory corruption. Also, it's worth to mention that 20+1 slots occupy 672 bytes space which may take more than one cluster of 512 bytes (medium-size FAT32 or small FAT16 partition) - get_vfatname() function doesn't support such case as well. The patch attached fixes these problems in the following way: - keep using 256 bytes buffer for a long file name, but safely prevent a possible buffer overflow (skip LFN processing, if it contains 10 or more slots). - explicitly specify FAT12/16 root directory parsing buffer size, instead of relying on cluster size. The value used is a double sector size (to store current sector and the next one). This fixes the first problem and increases performance on big FAT12/16 partitions; - send current cluster number (FAT32) to get_vfatname() during root directory processing; - use LFN counter to seek the real directory entry in get_vfatname() - fixes the third problem; - skip deleted entries in the root directory (to prevent bogus buffer overflow detection and LFN counter steps). Note: it's not advised to split up the patch, because a separate part may operate incorrectly. Signed-off-by:
Mikhail Zolotaryov <lebon@lebon.org.ua>
-
- Aug 07, 2010
-
-
Aaron Pace authored
Doubly-indirect block numbers are compared against the first-level indirect block when checking for a cached copy. This is causing the doubly-indirect block to be re-read each time it is accessed. Repairing this reduces load time for a 70M file from 72 seconds to 38 seconds. Signed-off-by:
Aaron Pace <Aaron.Pace@alcatel-lucent.com>
-
- Jul 24, 2010
-
-
Wolfgang Denk authored
- reformat - throw out macros like FAT_DPRINT and FAT_DPRINT - remove dead code Signed-off-by:
Wolfgang Denk <wd@denx.de>
-
Wolfgang Denk authored
On FAT32, instead of fetching the cluster numbers from the FAT, the code assumed (incorrectly) that the clusters for the root directory were allocated contiguously. In the result, only the first cluster could be accessed. At the typical cluster size of 8 sectors this caused all accesses to files after the first 128 entries to fail - "fatls" would terminate after 128 files (usually displaying a bogus file name, occasionally even crashing the system), and "fatload" would fail to find any files that were not in the first directory cluster. Signed-off-by:
Wolfgang Denk <wd@denx.de>
-
Wolfgang Denk authored
"Superfloppy" format (in U-Boot called PBR) did not work for FAT32 as the file system type string is at a different location. Add support for FAT32. Signed-off-by:
Wolfgang Denk <wd@denx.de>
-
- May 28, 2010
-
-
Thomas Chou authored
The nios-32 arch is obsolete and broken. So it is removed. Signed-off-by:
Thomas Chou <thomas@wytron.com.tw>
-
- Apr 28, 2010
-
-
Stefano Babic authored
ubifsmount is not working and causes an access with a pointer set to zero because the ubifs_fs_type is not initialized correctly. Signed-off-by:
Stefano Babic <sbabic@denx.de> Signed-off-by:
Stefan Roese <sr@denx.de>
-
- Mar 31, 2010
-
-
Heiko Schocher authored
$ ./MAKEALL suen3 jffs2_1pass.c: In function 'get_fl_mem': jffs2_1pass.c:399: warning: unused variable 'id' jffs2_1pass.c: In function 'get_node_mem': jffs2_1pass.c:423: warning: unused variable 'id' Signed-off-by:
Heiko Schocher <hs@denx.de> Tested-by:
Tom <Tom.Rix@windriver.com>
-