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 have 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>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
This commit is contained in:
parent
0adf10a87b
commit
a6d7eeb66d
|
|
@ -150,7 +150,6 @@ static int _stm32_qspi_wait_cmd(struct stm32_qspi_priv *priv,
|
|||
u32 sr;
|
||||
int ret = 0;
|
||||
|
||||
if (op->data.nbytes) {
|
||||
ret = readl_poll_timeout(&priv->regs->sr, sr,
|
||||
sr & STM32_QSPI_SR_TCF,
|
||||
STM32_QSPI_CMD_TIMEOUT_US);
|
||||
|
|
@ -160,9 +159,9 @@ static int _stm32_qspi_wait_cmd(struct stm32_qspi_priv *priv,
|
|||
log_err("transfer error (stat:%#x)\n", sr);
|
||||
ret = -EIO;
|
||||
}
|
||||
|
||||
/* clear flags */
|
||||
writel(STM32_QSPI_FCR_CTCF | STM32_QSPI_FCR_CTEF, &priv->regs->fcr);
|
||||
}
|
||||
|
||||
if (!ret)
|
||||
ret = _stm32_qspi_wait_for_not_busy(priv);
|
||||
|
|
|
|||
Loading…
Reference in New Issue