Commit 05d95397 authored by Hauke Mehrtens's avatar Hauke Mehrtens Committed by Zheng Zengkai
Browse files

mtd: rawnand: mtk: Fix WAITRDY break condition and timeout



stable inclusion
from stable-5.10.32
commit b80ea54e1e715223b336d4e794775b7c42218f9a
bugzilla: 51796

--------------------------------

[ Upstream commit 2fb164f0 ]

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: 5197360f ("mtd: rawnand: mtk: Convert the driver to exec_op()")
Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210309000107.1368404-1-hauke@hauke-m.de


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatarWeilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 3aaa3648
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment