]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: rawnand: mtk: Fix WAITRDY break condition and timeout
authorHauke Mehrtens <hauke@hauke-m.de>
Tue, 9 Mar 2021 00:01:07 +0000 (01:01 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 11 Mar 2021 11:23:11 +0000 (12:23 +0100)
commite4b2006c797be4065fa3e3e361efbe807d9062dc
tree64abef6747c40039d81389aa913fd0148a0c5d4b
parent219c9076286fd92026e818ab1375558e5b20649f
mtd: rawnand: mtk: Fix WAITRDY break condition and timeout

This fixes NAND_OP_WAITRDY_INSTR operation in the driver. Without this
change the driver waits till the system is busy, but we should wait till
the busy flag is cleared. The readl_poll_timeout() function gets a break
condition, not a wait condition.

In addition fix the timeout. The timeout_ms is given in ms, but the
readl_poll_timeout() function takes the timeout in us. Multiple the
given timeout by 1000 to convert it.

Without this change, the driver does not work at all, it doesn't even
identify the NAND chip.

Fixes: a4804ae36fde ("mtd: rawnand: mtk: Convert the driver to exec_op()")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210309000107.1368404-1-hauke@hauke-m.de
drivers/mtd/nand/raw/mtk_nand.c