]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
spi: qup: Fix transaction done signaling
authorAndy Gross <andy.gross@linaro.org>
Sat, 30 Jan 2016 04:06:50 +0000 (22:06 -0600)
committerNicolas Dechesne <nicolas.dechesne@linaro.org>
Mon, 23 May 2016 21:55:58 +0000 (23:55 +0200)
Wait to signal done until we get all of the interrupts we are expecting
to get for a transaction.  If we don't wait for the input done flag, we
can be inbetween transactions when the done flag comes in and this can
mess up the next transaction.

CC: Grant Grundler <grundler@chromium.org>
CC: Sarthak Kukreti <skukreti@codeaurora.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
drivers/spi/spi-qup.c

index 810a7fae347988a7d9dc1101586234b8ef8efc77..761a380b872c032f000437bc3b35413661c6e905 100644 (file)
@@ -437,7 +437,8 @@ static irqreturn_t spi_qup_qup_irq(int irq, void *dev_id)
        controller->xfer = xfer;
        spin_unlock_irqrestore(&controller->lock, flags);
 
-       if (controller->rx_bytes == xfer->len || error)
+       if ((controller->rx_bytes == xfer->len &&
+               (opflags & QUP_OP_MAX_INPUT_DONE_FLAG)) ||  error)
                complete(&controller->done);
 
        return IRQ_HANDLED;