spi: stm32-qspi: Always wait BUSY bit to be cleared in stm32_qspi_wait_cmd()
authorPatrice Chotard <patrice.chotard@foss.st.com>
Thu, 3 Jun 2021 07:34:21 +0000 (09:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Jun 2021 12:42:48 +0000 (14:42 +0200)
commit2f8f0e97cebb6c2b7cffd5b7c08331535680ae40
treeca0fb337639530146cdd67b9cba7341f8831101d
parente03c8b35161b2e8b30aeb50fa659fc3cfeee419c
spi: stm32-qspi: Always wait BUSY bit to be cleared in stm32_qspi_wait_cmd()

[ Upstream commit d38fa9a155b2829b7e2cfcf8a4171b6dd3672808 ]

In U-boot side, an issue has been encountered when QSPI source clock is
running at low frequency (24 MHz for example), waiting for TCF bit to be
set didn't ensure that all data has been send out the FIFO, we should also
wait that BUSY bit is cleared.

To prevent similar issue in kernel driver, we implement similar behavior
by always waiting BUSY bit to be cleared.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Link: https://lore.kernel.org/r/20210603073421.8441-1-patrice.chotard@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-stm32-qspi.c