]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
mtd: fix false positive "Offset exceeds device limit" error
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 1 Jul 2015 12:35:49 +0000 (21:35 +0900)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Sep 2015 11:29:21 +0000 (13:29 +0200)
commit28283f69cc64511f6df9850909b59d7f63afb67a
tree126c7c234359d46927529dbff743fd54e13595cb
parent279aa898119ec0874b50333d8bba005bc41b221c
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>
drivers/mtd/mtd_uboot.c
include/linux/mtd/mtd.h