Skip to content

Commit

Permalink
spi: stm32-qspi: Fix wait_cmd timeout in APM mode
Browse files Browse the repository at this point in the history
[ Upstream commit d83d89e ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Patrice Chotard authored and gregkh committed Jun 9, 2022
1 parent 5bb9bc8 commit d1ae34f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/spi/spi-stm32-qspi.c
Expand Up @@ -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);
Expand Down

0 comments on commit d1ae34f

Please sign in to comment.