Skip to content

Commit d83d89e

Browse files
Patrice Chotardbroonie
authored andcommitted
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 <[email protected]> Reported-by: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent f724c29 commit d83d89e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/spi/spi-stm32-qspi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ static int stm32_qspi_wait_cmd(struct stm32_qspi *qspi,
308308
if (!op->data.nbytes)
309309
goto wait_nobusy;
310310

311-
if (readl_relaxed(qspi->io_base + QSPI_SR) & SR_TCF)
311+
if ((readl_relaxed(qspi->io_base + QSPI_SR) & SR_TCF) ||
312+
qspi->fmode == CCR_FMODE_APM)
312313
goto out;
313314

314315
reinit_completion(&qspi->data_completion);

0 commit comments

Comments
 (0)