ipq806x: switch to linux 4.14
[openwrt/openwrt.git] / target / linux / ipq806x / patches-4.9 / 0004-spi-qup-Fix-transaction-done-signaling.patch
1 From fbdf80d138f8c7fda8e598287109fb90446d557d 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 04/69] spi: qup: Fix transaction done signaling
5
6 Wait to signal done until we get all of the interrupts we are expecting
7 to get for a transaction. If we don't wait for the input done flag, we
8 can be inbetween transactions when the done flag comes in and this can
9 mess up the next transaction.
10
11 CC: Grant Grundler <grundler@chromium.org>
12 CC: Sarthak Kukreti <skukreti@codeaurora.org>
13 Signed-off-by: Andy Gross <andy.gross@linaro.org>
14 ---
15 drivers/spi/spi-qup.c | 3 ++-
16 1 file changed, 2 insertions(+), 1 deletion(-)
17
18 --- a/drivers/spi/spi-qup.c
19 +++ b/drivers/spi/spi-qup.c
20 @@ -445,7 +445,8 @@ static irqreturn_t spi_qup_qup_irq(int i
21 controller->xfer = xfer;
22 spin_unlock_irqrestore(&controller->lock, flags);
23
24 - if (controller->rx_bytes == xfer->len || error)
25 + if ((controller->rx_bytes == xfer->len &&
26 + (opflags & QUP_OP_MAX_INPUT_DONE_FLAG)) || error)
27 complete(&controller->done);
28
29 return IRQ_HANDLED;