711-spi-qup-Fix-transaction-done-signaling.patch 1.1 KB

123456789101112131415161718192021222324252627282930
  1. From 8e830bd17e945e74964a5b61353d74e34c0791cd Mon Sep 17 00:00:00 2001
  2. From: Andy Gross <andy.gross@linaro.org>
  3. Date: Fri, 29 Jan 2016 22:06:50 -0600
  4. Subject: [PATCH] spi: qup: Fix transaction done signaling
  5. Wait to signal done until we get all of the interrupts we are expecting
  6. to get for a transaction. If we don't wait for the input done flag, we
  7. can be inbetween transactions when the done flag comes in and this can
  8. mess up the next transaction.
  9. Change-Id: I08d78376e71590663158d6434a3fb7c0623264c9
  10. CC: Grant Grundler <grundler@chromium.org>
  11. CC: Sarthak Kukreti <skukreti@codeaurora.org>
  12. Signed-off-by: Andy Gross <andy.gross@linaro.org>
  13. ---
  14. drivers/spi/spi-qup.c | 3 ++-
  15. 1 file changed, 2 insertions(+), 1 deletion(-)
  16. --- a/drivers/spi/spi-qup.c
  17. +++ b/drivers/spi/spi-qup.c
  18. @@ -447,7 +447,8 @@ static irqreturn_t spi_qup_qup_irq(int i
  19. controller->xfer = xfer;
  20. spin_unlock_irqrestore(&controller->lock, flags);
  21. - if (controller->rx_bytes == xfer->len || error)
  22. + if ((controller->rx_bytes == xfer->len &&
  23. + (opflags & QUP_OP_MAX_INPUT_DONE_FLAG)) || error)
  24. complete(&controller->done);
  25. return IRQ_HANDLED;