]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Apr 2021 11:13:17 +0000 (13:13 +0200)
commitd3eaed9a417da18504bf6542f851b4df4da794ea
tree338fb4d130b5aea0e02eadaba5277d64608e8c7d
parent6a3432139cc792b4d9fa96f7cc420e9a20eb8365
mtd: rawnand: mtk: Fix WAITRDY break condition and timeout

[ Upstream commit 2fb164f0ce95e504e2688b4f984893c29ebd19ab ]

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: 5197360f9e09 ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mtd/nand/raw/mtk_nand.c