|
32 | 32 | #define MER_ME (1<<0) |
33 | 33 | #define MER_HIE (1<<1) |
34 | 34 |
|
| 35 | +#define SPURIOUS_IRQ (-1U) |
| 36 | + |
35 | 37 | static DEFINE_STATIC_KEY_FALSE(xintc_is_be); |
36 | 38 |
|
37 | 39 | struct xintc_irq_chip { |
@@ -110,20 +112,6 @@ static struct irq_chip intc_dev = { |
110 | 112 | .irq_mask_ack = intc_mask_ack, |
111 | 113 | }; |
112 | 114 |
|
113 | | -unsigned int xintc_get_irq(void) |
114 | | -{ |
115 | | - unsigned int irq = -1; |
116 | | - u32 hwirq; |
117 | | - |
118 | | - hwirq = xintc_read(primary_intc, IVR); |
119 | | - if (hwirq != -1U) |
120 | | - irq = irq_find_mapping(primary_intc->root_domain, hwirq); |
121 | | - |
122 | | - pr_debug("irq-xilinx: hwirq=%d, irq=%d\n", hwirq, irq); |
123 | | - |
124 | | - return irq; |
125 | | -} |
126 | | - |
127 | 115 | static int xintc_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw) |
128 | 116 | { |
129 | 117 | struct xintc_irq_chip *irqc = d->host_data; |
@@ -164,6 +152,19 @@ static void xil_intc_irq_handler(struct irq_desc *desc) |
164 | 152 | chained_irq_exit(chip, desc); |
165 | 153 | } |
166 | 154 |
|
| 155 | +static void xil_intc_handle_irq(struct pt_regs *regs) |
| 156 | +{ |
| 157 | + u32 hwirq; |
| 158 | + |
| 159 | + do { |
| 160 | + hwirq = xintc_read(primary_intc, IVR); |
| 161 | + if (unlikely(hwirq == SPURIOUS_IRQ)) |
| 162 | + break; |
| 163 | + |
| 164 | + generic_handle_domain_irq(primary_intc->root_domain, hwirq); |
| 165 | + } while (true); |
| 166 | +} |
| 167 | + |
167 | 168 | static int __init xilinx_intc_of_init(struct device_node *intc, |
168 | 169 | struct device_node *parent) |
169 | 170 | { |
@@ -233,6 +234,7 @@ static int __init xilinx_intc_of_init(struct device_node *intc, |
233 | 234 | } else { |
234 | 235 | primary_intc = irqc; |
235 | 236 | irq_set_default_host(primary_intc->root_domain); |
| 237 | + set_handle_irq(xil_intc_handle_irq); |
236 | 238 | } |
237 | 239 |
|
238 | 240 | return 0; |
|
0 commit comments