[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220511074644.558874-2-patrice.chotard@foss.st.com>
Date: Wed, 11 May 2022 09:46:42 +0200
From: <patrice.chotard@...s.st.com>
To: Mark Brown <broonie@...nel.org>,
Alexandre Torgue <alexandre.torgue@...s.st.com>
CC: <linux-spi@...r.kernel.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <christophe.kerello@...s.st.com>,
<patrice.chotard@...s.st.com>, <eberhard.stoll@...tron.de>
Subject: [PATCH 1/3] spi: stm32-qspi: Fix wait_cmd timeout in APM mode
From: Patrice Chotard <patrice.chotard@...s.st.com>
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@...s.st.com>
Reported-by: eberhard.stoll@...tron.de
---
drivers/spi/spi-stm32-qspi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi-stm32-qspi.c b/drivers/spi/spi-stm32-qspi.c
index bf47a1452001..12d8bec35bf6 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);
--
2.25.1
Powered by blists - more mailing lists