spi/s3c64xx: Flush FIFOs prior to cleaning up transfer
authorMark Brown <broonie@linaro.org>
Fri, 27 Sep 2013 19:10:26 +0000 (20:10 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 30 Sep 2013 11:53:35 +0000 (12:53 +0100)
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 <broonie@linaro.org>
drivers/spi/spi-s3c64xx.c

index 229c6b994be351870a71443b7ee830c3d042efa5..2e267ce9dc19a2b99e97c9165b6be470ff8847c3 100644 (file)
@@ -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: