lkml.org 
[lkml]   [2022]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.18 149/879] spi: stm32-qspi: Fix wait_cmd timeout in APM mode
    Date
    From: Patrice Chotard <patrice.chotard@foss.st.com>

    [ Upstream commit d83d89ea68b4726700fa87b22db075e4217e691c ]

    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>
    ---
    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 ffdc55f87e82..dd38cb8ffbc2 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.35.1


    \
     
     \ /
      Last update: 2022-06-08 00:14    [W:4.857 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site