spi: spi-zynq-qspi: use wait_for_completion_timeout to make zynq_qspi_exec_mem_op...
authorQuanyang Wang <quanyang.wang@windriver.com>
Thu, 26 Aug 2021 00:59:30 +0000 (08:59 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 07:50:30 +0000 (09:50 +0200)
commita20e6868cbfc7c8c06af777132e3da66fc61921e
tree44aa04d858816610cc48b120baadc67853e8a085
parente2cb04c61bcf1856193378ecafcef95ead1c1b93
spi: spi-zynq-qspi: use wait_for_completion_timeout to make zynq_qspi_exec_mem_op not interruptible

[ Upstream commit 26cfc0dbe43aae60dc03af27077775244f26c167 ]

The function wait_for_completion_interruptible_timeout will return
-ERESTARTSYS immediately when receiving SIGKILL signal which is sent
by "jffs2_gcd_mtd" during umounting jffs2. This will break the SPI memory
operation because the data transmitting may begin before the command or
address transmitting completes. Use wait_for_completion_timeout to prevent
the process from being interruptible.

Fixes: 67dca5e580f1 ("spi: spi-mem: Add support for Zynq QSPI controller")
Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
Link: https://lore.kernel.org/r/20210826005930.20572-1-quanyang.wang@windriver.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-zynq-qspi.c