diff options
author | Miquel Raynal <miquel.raynal@free-electrons.com> | 2017-11-08 19:00:27 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-22 11:17:54 +0300 |
commit | da2ad1d8d47adb3fb0dbc86bdf27d0f84d5b0a59 (patch) | |
tree | ccd28bef6c41bc81bfe18151bdf09c11f5c7ea13 /arch/arm/boot/dts/ste-nomadik-nhk15.dts | |
parent | 5eef9b51114fcc65651d671add52f267f91b9451 (diff) | |
download | linux-da2ad1d8d47adb3fb0dbc86bdf27d0f84d5b0a59.tar.xz |
mtd: nand: fix interpretation of NAND_CMD_NONE in nand_command[_lp]()
[ Upstream commit df467899da0b71465760b4e35127bce837244eee ]
Some drivers (like nand_hynix.c) call ->cmdfunc() with NAND_CMD_NONE
and a column address and expect the controller to only send address
cycles. Right now, the default ->cmdfunc() implementations provided by
the core do not filter out the command cycle in this case and forwards
the request to the controller driver through the ->cmd_ctrl() method.
The thing is, NAND controller drivers can get this wrong and send a
command cycle with a NAND_CMD_NONE opcode and since NAND_CMD_NONE is
-1, and the command field is usually casted to an u8, we end up sending
the 0xFF command which is actually a RESET operation.
Add conditions in nand_command[_lp]() functions to sending the initial
command cycle when command == NAND_CMD_NONE.
Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/arm/boot/dts/ste-nomadik-nhk15.dts')
0 files changed, 0 insertions, 0 deletions