mac80211: make sure existing iface belongs to correct (fullmac) phy
[oweals/openwrt.git] / target / linux / oxnas / patches-5.4 / 001-irqchip-versatile-fpga-Handle-chained-IRQs-properly.patch
1 From patchwork Thu Mar 19 02:34:48 2020
2 Content-Type: text/plain; charset="utf-8"
3 MIME-Version: 1.0
4 Content-Transfer-Encoding: 7bit
5 X-Patchwork-Submitter: Sungbo Eo <mans0n@gorani.run>
6 X-Patchwork-Id: 11446405
7 From: Sungbo Eo <mans0n@gorani.run>
8 To: Linus Walleij <linus.walleij@linaro.org>,
9  Thomas Gleixner <tglx@linutronix.de>, Jason Cooper <jason@lakedaemon.net>,
10  Marc Zyngier <maz@kernel.org>, linux-arm-kernel@lists.infradead.org,
11  linux-kernel@vger.kernel.org, linux-oxnas@groups.io
12 Subject: [PATCH v2] irqchip/versatile-fpga: Handle chained IRQs properly
13 Date: Thu, 19 Mar 2020 11:34:48 +0900
14 Message-Id: <20200319023448.1479701-1-mans0n@gorani.run>
15 In-Reply-To: <002b72cab9896fa5ac76a52e0cb503ff@kernel.org>
16 References: <002b72cab9896fa5ac76a52e0cb503ff@kernel.org>
17 MIME-Version: 1.0
18 List-Id: <linux-arm-kernel.lists.infradead.org>
19 Cc: Sungbo Eo <mans0n@gorani.run>, Neil Armstrong <narmstrong@baylibre.com>
20 Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
21
22 Enclose the chained handler with chained_irq_{enter,exit}(), so that the
23 muxed interrupts get properly acked.
24
25 This patch also fixes a reboot bug on OX820 SoC, where the jiffies timer
26 interrupt is never acked. The kernel waits a clock tick forever in
27 calibrate_delay_converge(), which leads to a boot hang.
28
29 Fixes: c41b16f8c9d9 ("ARM: integrator/versatile: consolidate FPGA IRQ handling code")
30 Signed-off-by: Sungbo Eo <mans0n@gorani.run>
31 Cc: Neil Armstrong <narmstrong@baylibre.com>
32 ---
33 v2: moved readl below chained_irq_enter()
34     added Fixes tag
35
36  drivers/irqchip/irq-versatile-fpga.c | 12 ++++++++++--
37  1 file changed, 10 insertions(+), 2 deletions(-)
38
39 --- a/drivers/irqchip/irq-versatile-fpga.c
40 +++ b/drivers/irqchip/irq-versatile-fpga.c
41 @@ -6,6 +6,7 @@
42  #include <linux/irq.h>
43  #include <linux/io.h>
44  #include <linux/irqchip.h>
45 +#include <linux/irqchip/chained_irq.h>
46  #include <linux/irqchip/versatile-fpga.h>
47  #include <linux/irqdomain.h>
48  #include <linux/module.h>
49 @@ -68,12 +69,16 @@ static void fpga_irq_unmask(struct irq_d
50  
51  static void fpga_irq_handle(struct irq_desc *desc)
52  {
53 +       struct irq_chip *chip = irq_desc_get_chip(desc);
54         struct fpga_irq_data *f = irq_desc_get_handler_data(desc);
55 -       u32 status = readl(f->base + IRQ_STATUS);
56 +       u32 status;
57  
58 +       chained_irq_enter(chip, desc);
59 +
60 +       status = readl(f->base + IRQ_STATUS);
61         if (status == 0) {
62                 do_bad_IRQ(desc);
63 -               return;
64 +               goto out;
65         }
66  
67         do {
68 @@ -82,6 +87,9 @@ static void fpga_irq_handle(struct irq_d
69                 status &= ~(1 << irq);
70                 generic_handle_irq(irq_find_mapping(f->domain, irq));
71         } while (status);
72 +
73 +out:
74 +       chained_irq_exit(chip, desc);
75  }
76  
77  /*