From: Mark Brown Date: Fri, 27 Sep 2013 19:10:26 +0000 (+0100) Subject: spi/s3c64xx: Flush FIFOs prior to cleaning up transfer X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=67651b29ef15e5ef9897ed8cb9072222c4cf3432;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git spi/s3c64xx: Flush FIFOs prior to cleaning up transfer Ensure that the FIFOs are fully drained before we deassert /CS or do any delays that have been requested in order to ensure that the behaviour visible on the bus matches that which was requested by the caller. Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 229c6b994be3..2e267ce9dc19 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -960,6 +960,8 @@ static int s3c64xx_spi_transfer_one_message(struct spi_master *master, goto out; } + flush_fifo(sdd); + if (xfer->delay_usecs) udelay(xfer->delay_usecs); @@ -972,8 +974,6 @@ static int s3c64xx_spi_transfer_one_message(struct spi_master *master, } msg->actual_length += xfer->len; - - flush_fifo(sdd); } out: