spi: spi-mtk-nor: Add recovery mechanism for dma read timeout
authorbayi cheng <bayi.cheng@mediatek.com>
Wed, 7 Dec 2022 05:54:35 +0000 (13:54 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 7 Dec 2022 14:19:22 +0000 (14:19 +0000)
commit8330e9e8269bb76dd502e84efb5f351016512cf8
treeafe370915d896afaf4f566536efc674f898e720b
parentbc9ab1b7a6c687370b5d4edf34064bf04af8d369
spi: spi-mtk-nor: Add recovery mechanism for dma read timeout

The state machine of MTK spi nor controller may be disturbed by some
glitch signals from the relevant BUS during dma read, Although the
possibility of causing the dma read to fail is next to nothing,
However, if error-handling is not implemented, which makes the feature
somewhat risky.

Add an error-handling mechanism here, reset the state machine and
re-read the data when an error occurs.

Signed-off-by: bayi cheng <bayi.cheng@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20221207055435.30557-1-bayi.cheng@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-mtk-nor.c