x86: image: drop unneeded grub call
[oweals/openwrt.git] / target / linux / ipq806x / patches-4.9 / 0010-spi-qup-properly-detect-extra-interrupts.patch
1 From 543618f5388d487ba88e3d5304c161fc3ccf61d1 Mon Sep 17 00:00:00 2001
2 From: Matthew McClintock <mmcclint@codeaurora.org>
3 Date: Thu, 10 Mar 2016 16:44:55 -0600
4 Subject: [PATCH 10/37] spi: qup: properly detect extra interrupts
5
6 It's possible for a SPI transaction to complete and get another
7 interrupt and have it processed on the same spi_transfer before the
8 transfer_one can set it to NULL.
9
10 This masks unexpected interrupts, so let's set the spi_transfer to
11 NULL in the interrupt once the transaction is done. So we can
12 properly detect these bad interrupts and print warning messages.
13
14 Signed-off-by: Matthew McClintock <mmcclint@codeaurora.org>
15 ---
16  drivers/spi/spi-qup.c |   15 +++++++++------
17  1 file changed, 9 insertions(+), 6 deletions(-)
18
19 --- a/drivers/spi/spi-qup.c
20 +++ b/drivers/spi/spi-qup.c
21 @@ -507,6 +507,7 @@ static irqreturn_t spi_qup_qup_irq(int i
22         u32 opflags, qup_err, spi_err;
23         unsigned long flags;
24         int error = 0;
25 +       bool done = 0;
26  
27         spin_lock_irqsave(&controller->lock, flags);
28         xfer = controller->xfer;
29 @@ -565,16 +566,19 @@ static irqreturn_t spi_qup_qup_irq(int i
30                         spi_qup_write(controller, xfer);
31         }
32  
33 -       spin_lock_irqsave(&controller->lock, flags);
34 -       controller->error = error;
35 -       controller->xfer = xfer;
36 -       spin_unlock_irqrestore(&controller->lock, flags);
37 -
38         /* re-read opflags as flags may have changed due to actions above */
39         opflags = readl_relaxed(controller->base + QUP_OPERATIONAL);
40  
41         if ((controller->rx_bytes == xfer->len &&
42                 (opflags & QUP_OP_MAX_INPUT_DONE_FLAG)) ||  error)
43 +               done = true;
44 +
45 +       spin_lock_irqsave(&controller->lock, flags);
46 +       controller->error = error;
47 +       controller->xfer = done ? NULL : xfer;
48 +       spin_unlock_irqrestore(&controller->lock, flags);
49 +
50 +       if (done)
51                 complete(&controller->done);
52  
53         return IRQ_HANDLED;
54 @@ -767,7 +771,6 @@ static int spi_qup_transfer_one(struct s
55  exit:
56         spi_qup_set_state(controller, QUP_STATE_RESET);
57         spin_lock_irqsave(&controller->lock, flags);
58 -       controller->xfer = NULL;
59         if (!ret)
60                 ret = controller->error;
61         spin_unlock_irqrestore(&controller->lock, flags);