diff options
author | Patrice Chotard <patrice.chotard@foss.st.com> | 2022-05-11 10:46:43 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-05-11 19:40:09 +0300 |
commit | 0cf8d32600cf5660ee45d421f1b6e3a129ca58b6 (patch) | |
tree | fa1e6e086dde0d965942a4b6988d09548ecab779 /drivers/spi/spi-stm32-qspi.c | |
parent | d83d89ea68b4726700fa87b22db075e4217e691c (diff) | |
download | linux-0cf8d32600cf5660ee45d421f1b6e3a129ca58b6.tar.xz |
spi: stm32-qspi: Always check SR_TCF flags in stm32_qspi_wait_cmd()
Currently, SR_TCF flag is checked in case there is data, this criteria
is not correct.
SR_TCF flags is set when programmed number of bytes has been transferred
to the memory device ("bytes" comprised command and data send to the
SPI device).
So even if there is no data, we must check SR_TCF flag.
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Link: https://lore.kernel.org/r/20220511074644.558874-3-patrice.chotard@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-stm32-qspi.c')
-rw-r--r-- | drivers/spi/spi-stm32-qspi.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/spi/spi-stm32-qspi.c b/drivers/spi/spi-stm32-qspi.c index dd38cb8ffbc2..f2b67c8842d4 100644 --- a/drivers/spi/spi-stm32-qspi.c +++ b/drivers/spi/spi-stm32-qspi.c @@ -305,9 +305,6 @@ static int stm32_qspi_wait_cmd(struct stm32_qspi *qspi, u32 cr, sr; int err = 0; - if (!op->data.nbytes) - goto wait_nobusy; - if ((readl_relaxed(qspi->io_base + QSPI_SR) & SR_TCF) || qspi->fmode == CCR_FMODE_APM) goto out; @@ -328,7 +325,6 @@ static int stm32_qspi_wait_cmd(struct stm32_qspi *qspi, out: /* clear flags */ writel_relaxed(FCR_CTCF | FCR_CTEF, qspi->io_base + QSPI_FCR); -wait_nobusy: if (!err) err = stm32_qspi_wait_nobusy(qspi); |