spi: spi-fsl-spi: call spi_finalize_current_message() at the end [Linux 5.2]

spi: spi-fsl-spi: call spi_finalize_current_message() at the end [Linux 5.2]

This Linux kernel change "spi: spi-fsl-spi: call spi_finalize_current_message() at the end" is included in the Linux 5.2 release. This change is authored by Christophe Leroy <christophe.leroy [at] c-s.fr> on Wed May 22 11:00:36 2019 +0000. The commit for this change in Linux stable tree is 44a0421 (patch).

spi: spi-fsl-spi: call spi_finalize_current_message() at the end

spi_finalize_current_message() shall be called once all
actions are finished, otherwise the last actions might
step over a newly started transfer.

Fixes: c592becbe704 ("spi: fsl-(e)spi: migrate to generic master queueing")
Signed-off-by: Christophe Leroy <[email protected]>
Signed-off-by: Mark Brown <[email protected]>

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/spi/spi-fsl-spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
index b36ac6a..7fbdaf0 100644
--- a/drivers/spi/spi-fsl-spi.c
+++ b/drivers/spi/spi-fsl-spi.c
@@ -432,7 +432,6 @@ static int fsl_spi_do_one_msg(struct spi_master *master,
    }

    m->status = status;
-   spi_finalize_current_message(master);

    if (status || !cs_change) {
        ndelay(nsecs);
@@ -440,6 +439,7 @@ static int fsl_spi_do_one_msg(struct spi_master *master,
    }

    fsl_spi_setup_transfer(spi, NULL);
+   spi_finalize_current_message(master);
    return 0;
 }

Leave a Reply

Your email address will not be published. Required fields are marked *