diff options
author | Patrice Chotard <patrice.chotard@foss.st.com> | 2022-05-11 09:46:42 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-05-11 17:40:08 +0100 |
commit | d83d89ea68b4726700fa87b22db075e4217e691c (patch) | |
tree | 709b3a0fd805633559fc22714ab3462a246203cd | |
parent | f724c296f2f2cc3f9342b0fc26239635cbed856e (diff) | |
download | linux-d83d89ea68b4726700fa87b22db075e4217e691c.tar.bz2 |
spi: stm32-qspi: Fix wait_cmd timeout in APM mode
In APM mode, TCF and TEF flags are not set. To avoid timeout in
stm32_qspi_wait_cmd(), don't check if TCF/TEF are set.
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reported-by: eberhard.stoll@kontron.de
Link: https://lore.kernel.org/r/20220511074644.558874-2-patrice.chotard@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/spi/spi-stm32-qspi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/spi/spi-stm32-qspi.c b/drivers/spi/spi-stm32-qspi.c index ffdc55f87e82..dd38cb8ffbc2 100644 --- a/drivers/spi/spi-stm32-qspi.c +++ b/drivers/spi/spi-stm32-qspi.c @@ -308,7 +308,8 @@ static int stm32_qspi_wait_cmd(struct stm32_qspi *qspi, if (!op->data.nbytes) goto wait_nobusy; - if (readl_relaxed(qspi->io_base + QSPI_SR) & SR_TCF) + if ((readl_relaxed(qspi->io_base + QSPI_SR) & SR_TCF) || + qspi->fmode == CCR_FMODE_APM) goto out; reinit_completion(&qspi->data_completion); |