diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2015-07-01 21:35:49 +0900 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-07-10 09:38:50 -0400 |
commit | f18d11163e4ea523aff489721db5de752fe062bf (patch) | |
tree | 894e48e9133c1cbcd5cca0aca7d2beda9e1403df /include/linux/mtd | |
parent | fa31377ef0fd1096fbeab9c240582a93c4da9f6d (diff) | |
download | u-boot-midas-f18d11163e4ea523aff489721db5de752fe062bf.tar.gz u-boot-midas-f18d11163e4ea523aff489721db5de752fe062bf.tar.bz2 u-boot-midas-f18d11163e4ea523aff489721db5de752fe062bf.zip |
mtd: fix false positive "Offset exceeds device limit" error
Since commit 09c3280754f8 (mtd, nand: Move common functions from
cmd_nand.c to common place), NAND commands would not work at all
on large devices.
=> nand read 80000000 10000 10000
NAND read: Offset exceeds device limit
=> nand erase 100000 100000
NAND erase: Offset exceeds device limit
The type of the "size" of "struct mtd_info" is uint64_t, while
mtd_arg_off_size() and mtd_arg_off() treat chipsize as int type.
The chipsize is wrapped around if the argument is given with 2GB
or larger.
Acked-by: Heiko Schocher <hs@denx.de>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r-- | include/linux/mtd/mtd.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 33669da4ed..552d4d623f 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -484,8 +484,9 @@ int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int); int del_mtd_partitions(struct mtd_info *); int mtd_arg_off(const char *arg, int *idx, loff_t *off, loff_t *size, - loff_t *maxsize, int devtype, int chipsize); + loff_t *maxsize, int devtype, uint64_t chipsize); int mtd_arg_off_size(int argc, char *const argv[], int *idx, loff_t *off, - loff_t *size, loff_t *maxsize, int devtype, int chipsize); + loff_t *size, loff_t *maxsize, int devtype, + uint64_t chipsize); #endif #endif /* __MTD_MTD_H__ */ |