blob: c95697912feadf2245973207a8b62fde8be8850c [file] [log] [blame]
David Gibson007e8f52005-10-28 15:35:50 +10001/*
2 * arch/powerpc/platforms/pseries/xics.c
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
4 * Copyright 2000 IBM Corporation.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100011
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100012
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <linux/types.h>
14#include <linux/threads.h>
15#include <linux/kernel.h>
16#include <linux/irq.h>
17#include <linux/smp.h>
18#include <linux/interrupt.h>
19#include <linux/signal.h>
20#include <linux/init.h>
21#include <linux/gfp.h>
22#include <linux/radix-tree.h>
23#include <linux/cpu.h>
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100024
Michael Ellerman57cfb812006-03-21 20:45:59 +110025#include <asm/firmware.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070026#include <asm/prom.h>
27#include <asm/io.h>
28#include <asm/pgtable.h>
29#include <asm/smp.h>
30#include <asm/rtas.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070031#include <asm/hvcall.h>
32#include <asm/machdep.h>
Paul Mackerras22277182005-10-28 11:47:17 +100033#include <asm/i8259.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
David Gibson007e8f52005-10-28 15:35:50 +100035#include "xics.h"
Anton Blanchardb9377ff2006-07-19 08:01:28 +100036#include "plpar_wrappers.h"
David Gibson007e8f52005-10-28 15:35:50 +100037
Linus Torvalds1da177e2005-04-16 15:20:36 -070038#define XICS_IPI 2
39#define XICS_IRQ_SPURIOUS 0
40
41/* Want a priority other than 0. Various HW issues require this. */
42#define DEFAULT_PRIORITY 5
43
David Gibson007e8f52005-10-28 15:35:50 +100044/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070045 * Mark IPIs as higher priority so we can take them inside interrupts that
Thomas Gleixner67144652006-07-01 19:29:22 -070046 * arent marked IRQF_DISABLED
Linus Torvalds1da177e2005-04-16 15:20:36 -070047 */
48#define IPI_PRIORITY 4
49
50struct xics_ipl {
51 union {
52 u32 word;
53 u8 bytes[4];
54 } xirr_poll;
55 union {
56 u32 word;
57 u8 bytes[4];
58 } xirr;
59 u32 dummy;
60 union {
61 u32 word;
62 u8 bytes[4];
63 } qirr;
64};
65
66static struct xics_ipl __iomem *xics_per_cpu[NR_CPUS];
67
Linus Torvalds1da177e2005-04-16 15:20:36 -070068static unsigned int default_server = 0xFF;
Anton Blanchard26370322005-09-12 13:12:11 +100069static unsigned int default_distrib_server = 0;
70static unsigned int interrupt_server_size = 8;
Linus Torvalds1da177e2005-04-16 15:20:36 -070071
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +100072static struct irq_host *xics_host;
73
Linus Torvalds1da177e2005-04-16 15:20:36 -070074/*
75 * XICS only has a single IPI, so encode the messages per CPU
76 */
77struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned;
78
79/* RTAS service tokens */
Anton Blanchard26370322005-09-12 13:12:11 +100080static int ibm_get_xive;
81static int ibm_set_xive;
82static int ibm_int_on;
83static int ibm_int_off;
Linus Torvalds1da177e2005-04-16 15:20:36 -070084
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +100085
86/* Direct HW low level accessors */
Linus Torvalds1da177e2005-04-16 15:20:36 -070087
88
Milton Millerd7cf0ed2007-12-14 15:52:09 +110089static inline unsigned int direct_xirr_info_get(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070090{
Milton Millerd7cf0ed2007-12-14 15:52:09 +110091 int cpu = smp_processor_id();
92
93 return in_be32(&xics_per_cpu[cpu]->xirr.word);
Linus Torvalds1da177e2005-04-16 15:20:36 -070094}
95
Milton Millerd7cf0ed2007-12-14 15:52:09 +110096static inline void direct_xirr_info_set(int value)
Linus Torvalds1da177e2005-04-16 15:20:36 -070097{
Milton Millerd7cf0ed2007-12-14 15:52:09 +110098 int cpu = smp_processor_id();
99
100 out_be32(&xics_per_cpu[cpu]->xirr.word, value);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101}
102
Milton Millerd7cf0ed2007-12-14 15:52:09 +1100103static inline void direct_cppr_info(u8 value)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104{
Milton Millerd7cf0ed2007-12-14 15:52:09 +1100105 int cpu = smp_processor_id();
106
107 out_8(&xics_per_cpu[cpu]->xirr.bytes[0], value);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108}
109
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000110static inline void direct_qirr_info(int n_cpu, u8 value)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111{
112 out_8(&xics_per_cpu[n_cpu]->qirr.bytes[0], value);
113}
114
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000116/* LPAR low level accessors */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117
118
Milton Millerd7cf0ed2007-12-14 15:52:09 +1100119static inline unsigned int lpar_xirr_info_get(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120{
121 unsigned long lpar_rc;
David Gibson007e8f52005-10-28 15:35:50 +1000122 unsigned long return_value;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123
124 lpar_rc = plpar_xirr(&return_value);
Segher Boessenkool706c8c92006-03-30 14:49:40 +0200125 if (lpar_rc != H_SUCCESS)
David Gibson007e8f52005-10-28 15:35:50 +1000126 panic(" bad return code xirr - rc = %lx \n", lpar_rc);
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000127 return (unsigned int)return_value;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700128}
129
Milton Millerd7cf0ed2007-12-14 15:52:09 +1100130static inline void lpar_xirr_info_set(int value)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700131{
132 unsigned long lpar_rc;
133 unsigned long val64 = value & 0xffffffff;
134
135 lpar_rc = plpar_eoi(val64);
Segher Boessenkool706c8c92006-03-30 14:49:40 +0200136 if (lpar_rc != H_SUCCESS)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700137 panic("bad return code EOI - rc = %ld, value=%lx\n", lpar_rc,
David Gibson007e8f52005-10-28 15:35:50 +1000138 val64);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139}
140
Milton Millerd7cf0ed2007-12-14 15:52:09 +1100141static inline void lpar_cppr_info(u8 value)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142{
143 unsigned long lpar_rc;
144
145 lpar_rc = plpar_cppr(value);
Segher Boessenkool706c8c92006-03-30 14:49:40 +0200146 if (lpar_rc != H_SUCCESS)
David Gibson007e8f52005-10-28 15:35:50 +1000147 panic("bad return code cppr - rc = %lx\n", lpar_rc);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148}
149
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000150static inline void lpar_qirr_info(int n_cpu , u8 value)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700151{
152 unsigned long lpar_rc;
153
154 lpar_rc = plpar_ipi(get_hard_smp_processor_id(n_cpu), value);
Segher Boessenkool706c8c92006-03-30 14:49:40 +0200155 if (lpar_rc != H_SUCCESS)
David Gibson007e8f52005-10-28 15:35:50 +1000156 panic("bad return code qirr - rc = %lx\n", lpar_rc);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157}
158
Linus Torvalds1da177e2005-04-16 15:20:36 -0700159
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000160/* High level handlers and init code */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161
Nathan Fontenotde0723d2008-02-07 07:37:40 +1100162static void xics_update_irq_servers(void)
163{
164 int i, j;
165 struct device_node *np;
166 u32 ilen;
167 const u32 *ireg, *isize;
168 u32 hcpuid;
169
170 /* Find the server numbers for the boot cpu. */
171 np = of_get_cpu_node(boot_cpuid, NULL);
172 BUG_ON(!np);
173
174 ireg = of_get_property(np, "ibm,ppc-interrupt-gserver#s", &ilen);
175 if (!ireg) {
176 of_node_put(np);
177 return;
178 }
179
180 i = ilen / sizeof(int);
181 hcpuid = get_hard_smp_processor_id(boot_cpuid);
182
183 /* Global interrupt distribution server is specified in the last
184 * entry of "ibm,ppc-interrupt-gserver#s" property. Get the last
185 * entry fom this property for current boot cpu id and use it as
186 * default distribution server
187 */
188 for (j = 0; j < i; j += 2) {
189 if (ireg[j] == hcpuid) {
190 default_server = hcpuid;
191 default_distrib_server = ireg[j+1];
192
193 isize = of_get_property(np,
194 "ibm,interrupt-server#-size", NULL);
195 if (isize)
196 interrupt_server_size = *isize;
197 }
198 }
199
200 of_node_put(np);
201}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700202
203#ifdef CONFIG_SMP
Mohan Kumar M7ccb4a62007-06-13 00:51:57 +1000204static int get_irq_server(unsigned int virq, unsigned int strict_check)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205{
Mohan Kumar M7ccb4a62007-06-13 00:51:57 +1000206 int server;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700207 /* For the moment only implement delivery to all cpus or one cpu */
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000208 cpumask_t cpumask = irq_desc[virq].affinity;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209 cpumask_t tmp = CPU_MASK_NONE;
210
211 if (!distribute_irqs)
212 return default_server;
213
Mohan Kumar M7ccb4a62007-06-13 00:51:57 +1000214 if (!cpus_equal(cpumask, CPU_MASK_ALL)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215 cpus_and(tmp, cpu_online_map, cpumask);
216
Mohan Kumar M7ccb4a62007-06-13 00:51:57 +1000217 server = first_cpu(tmp);
218
219 if (server < NR_CPUS)
220 return get_hard_smp_processor_id(server);
221
222 if (strict_check)
223 return -1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224 }
225
Mohan Kumar M7ccb4a62007-06-13 00:51:57 +1000226 if (cpus_equal(cpu_online_map, cpu_present_map))
227 return default_distrib_server;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700228
Mohan Kumar M7ccb4a62007-06-13 00:51:57 +1000229 return default_server;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700230}
231#else
Mohan Kumar M7ccb4a62007-06-13 00:51:57 +1000232static int get_irq_server(unsigned int virq, unsigned int strict_check)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700233{
234 return default_server;
235}
236#endif
237
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000238
239static void xics_unmask_irq(unsigned int virq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700240{
241 unsigned int irq;
242 int call_status;
Mohan Kumar M7ccb4a62007-06-13 00:51:57 +1000243 int server;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700244
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000245 pr_debug("xics: unmask virq %d\n", virq);
246
247 irq = (unsigned int)irq_map[virq].hwirq;
248 pr_debug(" -> map to hwirq 0x%x\n", irq);
249 if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700250 return;
251
Mohan Kumar M7ccb4a62007-06-13 00:51:57 +1000252 server = get_irq_server(virq, 0);
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000253
Linus Torvalds1da177e2005-04-16 15:20:36 -0700254 call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server,
255 DEFAULT_PRIORITY);
256 if (call_status != 0) {
Anton Blanchard26370322005-09-12 13:12:11 +1000257 printk(KERN_ERR "xics_enable_irq: irq=%u: ibm_set_xive "
258 "returned %d\n", irq, call_status);
259 printk("set_xive %x, server %x\n", ibm_set_xive, server);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700260 return;
261 }
262
263 /* Now unmask the interrupt (often a no-op) */
264 call_status = rtas_call(ibm_int_on, 1, 1, NULL, irq);
265 if (call_status != 0) {
Anton Blanchard26370322005-09-12 13:12:11 +1000266 printk(KERN_ERR "xics_enable_irq: irq=%u: ibm_int_on "
267 "returned %d\n", irq, call_status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700268 return;
269 }
270}
271
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000272static void xics_mask_real_irq(unsigned int irq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700273{
274 int call_status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700275
276 if (irq == XICS_IPI)
277 return;
278
279 call_status = rtas_call(ibm_int_off, 1, 1, NULL, irq);
280 if (call_status != 0) {
Anton Blanchard26370322005-09-12 13:12:11 +1000281 printk(KERN_ERR "xics_disable_real_irq: irq=%u: "
282 "ibm_int_off returned %d\n", irq, call_status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700283 return;
284 }
285
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286 /* Have to set XIVE to 0xff to be able to remove a slot */
Michal Ostrowski673aeb72006-12-20 07:29:40 -0600287 call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq,
288 default_server, 0xff);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700289 if (call_status != 0) {
Anton Blanchard26370322005-09-12 13:12:11 +1000290 printk(KERN_ERR "xics_disable_irq: irq=%u: ibm_set_xive(0xff)"
291 " returned %d\n", irq, call_status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700292 return;
293 }
294}
295
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000296static void xics_mask_irq(unsigned int virq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700297{
298 unsigned int irq;
299
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000300 pr_debug("xics: mask virq %d\n", virq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700301
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000302 irq = (unsigned int)irq_map[virq].hwirq;
303 if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
304 return;
305 xics_mask_real_irq(irq);
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000306}
307
308static unsigned int xics_startup(unsigned int virq)
309{
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000310 /* unmask it */
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000311 xics_unmask_irq(virq);
312 return 0;
313}
314
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000315static void xics_eoi_direct(unsigned int virq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700316{
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000317 unsigned int irq = (unsigned int)irq_map[virq].hwirq;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700318
319 iosync();
Milton Millerd7cf0ed2007-12-14 15:52:09 +1100320 direct_xirr_info_set((0xff << 24) | irq);
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000321}
322
323
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000324static void xics_eoi_lpar(unsigned int virq)
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000325{
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000326 unsigned int irq = (unsigned int)irq_map[virq].hwirq;
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000327
328 iosync();
Milton Millerd7cf0ed2007-12-14 15:52:09 +1100329 lpar_xirr_info_set((0xff << 24) | irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700330}
331
Milton Miller8767e9b2008-10-10 01:56:23 +0000332static inline unsigned int xics_xirr_vector(unsigned int xirr)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700333{
Milton Miller8767e9b2008-10-10 01:56:23 +0000334 /*
335 * The top byte is the old cppr, to be restored on EOI.
336 * The remaining 24 bits are the vector.
337 */
338 return xirr & 0x00ffffff;
339}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700340
Milton Miller8767e9b2008-10-10 01:56:23 +0000341static void xics_mask_unknown_vec(unsigned int vec)
342{
343 printk(KERN_ERR "Interrupt %u (real) is invalid, disabling it.\n", vec);
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000344 xics_mask_real_irq(vec);
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000345}
346
Olaf Hering35a84c22006-10-07 22:08:26 +1000347static unsigned int xics_get_irq_direct(void)
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000348{
Milton Miller8767e9b2008-10-10 01:56:23 +0000349 unsigned int xirr = direct_xirr_info_get();
350 unsigned int vec = xics_xirr_vector(xirr);
351 unsigned int irq;
352
353 if (vec == XICS_IRQ_SPURIOUS)
354 return NO_IRQ;
355
356 irq = irq_radix_revmap_lookup(xics_host, vec);
357 if (likely(irq != NO_IRQ))
358 return irq;
359
360 /* We don't have a linux mapping, so have rtas mask it. */
361 xics_mask_unknown_vec(vec);
362
363 /* We might learn about it later, so EOI it */
364 direct_xirr_info_set(xirr);
365 return NO_IRQ;
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000366}
367
Olaf Hering35a84c22006-10-07 22:08:26 +1000368static unsigned int xics_get_irq_lpar(void)
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000369{
Milton Miller8767e9b2008-10-10 01:56:23 +0000370 unsigned int xirr = lpar_xirr_info_get();
371 unsigned int vec = xics_xirr_vector(xirr);
372 unsigned int irq;
373
374 if (vec == XICS_IRQ_SPURIOUS)
375 return NO_IRQ;
376
377 irq = irq_radix_revmap_lookup(xics_host, vec);
378 if (likely(irq != NO_IRQ))
379 return irq;
380
381 /* We don't have a linux mapping, so have RTAS mask it. */
382 xics_mask_unknown_vec(vec);
383
384 /* We might learn about it later, so EOI it */
385 lpar_xirr_info_set(xirr);
386 return NO_IRQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700387}
388
389#ifdef CONFIG_SMP
390
David Howells7d12e782006-10-05 14:55:46 +0100391static irqreturn_t xics_ipi_dispatch(int cpu)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700392{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700393 WARN_ON(cpu_is_offline(cpu));
394
395 while (xics_ipi_message[cpu].value) {
396 if (test_and_clear_bit(PPC_MSG_CALL_FUNCTION,
397 &xics_ipi_message[cpu].value)) {
398 mb();
David Howells7d12e782006-10-05 14:55:46 +0100399 smp_message_recv(PPC_MSG_CALL_FUNCTION);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700400 }
401 if (test_and_clear_bit(PPC_MSG_RESCHEDULE,
402 &xics_ipi_message[cpu].value)) {
403 mb();
David Howells7d12e782006-10-05 14:55:46 +0100404 smp_message_recv(PPC_MSG_RESCHEDULE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700405 }
Jens Axboeb7d7a242008-06-26 11:22:13 +0200406 if (test_and_clear_bit(PPC_MSG_CALL_FUNC_SINGLE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700407 &xics_ipi_message[cpu].value)) {
408 mb();
Jens Axboeb7d7a242008-06-26 11:22:13 +0200409 smp_message_recv(PPC_MSG_CALL_FUNC_SINGLE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700410 }
Michael Ellermancc532912005-12-04 18:39:43 +1100411#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700412 if (test_and_clear_bit(PPC_MSG_DEBUGGER_BREAK,
413 &xics_ipi_message[cpu].value)) {
414 mb();
David Howells7d12e782006-10-05 14:55:46 +0100415 smp_message_recv(PPC_MSG_DEBUGGER_BREAK);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700416 }
417#endif
418 }
419 return IRQ_HANDLED;
420}
421
David Howells7d12e782006-10-05 14:55:46 +0100422static irqreturn_t xics_ipi_action_direct(int irq, void *dev_id)
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000423{
424 int cpu = smp_processor_id();
425
426 direct_qirr_info(cpu, 0xff);
427
David Howells7d12e782006-10-05 14:55:46 +0100428 return xics_ipi_dispatch(cpu);
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000429}
430
David Howells7d12e782006-10-05 14:55:46 +0100431static irqreturn_t xics_ipi_action_lpar(int irq, void *dev_id)
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000432{
433 int cpu = smp_processor_id();
434
435 lpar_qirr_info(cpu, 0xff);
436
David Howells7d12e782006-10-05 14:55:46 +0100437 return xics_ipi_dispatch(cpu);
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000438}
439
Linus Torvalds1da177e2005-04-16 15:20:36 -0700440void xics_cause_IPI(int cpu)
441{
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000442 if (firmware_has_feature(FW_FEATURE_LPAR))
443 lpar_qirr_info(cpu, IPI_PRIORITY);
444 else
445 direct_qirr_info(cpu, IPI_PRIORITY);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700446}
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000447
Paul Mackerras6c80a212005-05-06 16:28:56 +1000448#endif /* CONFIG_SMP */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700449
Milton Millerd7cf0ed2007-12-14 15:52:09 +1100450static void xics_set_cpu_priority(unsigned char cppr)
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000451{
452 if (firmware_has_feature(FW_FEATURE_LPAR))
Milton Millerd7cf0ed2007-12-14 15:52:09 +1100453 lpar_cppr_info(cppr);
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000454 else
Milton Millerd7cf0ed2007-12-14 15:52:09 +1100455 direct_cppr_info(cppr);
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000456 iosync();
457}
458
459static void xics_set_affinity(unsigned int virq, cpumask_t cpumask)
460{
461 unsigned int irq;
462 int status;
463 int xics_status[2];
Mohan Kumar M7ccb4a62007-06-13 00:51:57 +1000464 int irq_server;
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000465
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000466 irq = (unsigned int)irq_map[virq].hwirq;
467 if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000468 return;
469
470 status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq);
471
472 if (status) {
473 printk(KERN_ERR "xics_set_affinity: irq=%u ibm,get-xive "
474 "returns %d\n", irq, status);
475 return;
476 }
477
Mohan Kumar M7ccb4a62007-06-13 00:51:57 +1000478 /*
479 * For the moment only implement delivery to all cpus or one cpu.
480 * Get current irq_server for the given irq
481 */
Anton Blancharde48395f2007-10-01 07:45:55 +1000482 irq_server = get_irq_server(virq, 1);
Mohan Kumar M7ccb4a62007-06-13 00:51:57 +1000483 if (irq_server == -1) {
484 char cpulist[128];
485 cpumask_scnprintf(cpulist, sizeof(cpulist), cpumask);
486 printk(KERN_WARNING "xics_set_affinity: No online cpus in "
487 "the mask %s for irq %d\n", cpulist, virq);
488 return;
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000489 }
490
491 status = rtas_call(ibm_set_xive, 3, 1, NULL,
Mohan Kumar M7ccb4a62007-06-13 00:51:57 +1000492 irq, irq_server, xics_status[1]);
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000493
494 if (status) {
495 printk(KERN_ERR "xics_set_affinity: irq=%u ibm,set-xive "
496 "returns %d\n", irq, status);
497 return;
498 }
499}
500
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000501void xics_setup_cpu(void)
502{
Milton Millerd7cf0ed2007-12-14 15:52:09 +1100503 xics_set_cpu_priority(0xff);
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000504
505 /*
506 * Put the calling processor into the GIQ. This is really only
507 * necessary from a secondary thread as the OF start-cpu interface
508 * performs this function for us on primary threads.
509 *
510 * XXX: undo of teardown on kexec needs this too, as may hotplug
511 */
Haren Myneni81b73dd2006-07-27 14:29:00 -0700512 rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE,
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000513 (1UL << interrupt_server_size) - 1 - default_distrib_server, 1);
514}
515
516
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000517static struct irq_chip xics_pic_direct = {
518 .typename = " XICS ",
519 .startup = xics_startup,
520 .mask = xics_mask_irq,
521 .unmask = xics_unmask_irq,
522 .eoi = xics_eoi_direct,
523 .set_affinity = xics_set_affinity
524};
525
526
527static struct irq_chip xics_pic_lpar = {
528 .typename = " XICS ",
529 .startup = xics_startup,
530 .mask = xics_mask_irq,
531 .unmask = xics_unmask_irq,
532 .eoi = xics_eoi_lpar,
533 .set_affinity = xics_set_affinity
534};
535
Michael Ellerman1af9fa82008-04-01 17:42:27 +1100536/* Points to the irq_chip we're actually using */
537static struct irq_chip *xics_irq_chip;
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000538
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000539static int xics_host_match(struct irq_host *h, struct device_node *node)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700540{
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000541 /* IBM machines have interrupt parents of various funky types for things
542 * like vdevices, events, etc... The trick we use here is to match
543 * everything here except the legacy 8259 which is compatible "chrp,iic"
Paul Mackerras6c80a212005-05-06 16:28:56 +1000544 */
Stephen Rothwell55b61fe2007-05-03 17:26:52 +1000545 return !of_device_is_compatible(node, "chrp,iic");
Paul Mackerras6c80a212005-05-06 16:28:56 +1000546}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700547
Michael Ellerman1af9fa82008-04-01 17:42:27 +1100548static int xics_host_map(struct irq_host *h, unsigned int virq,
549 irq_hw_number_t hw)
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000550{
Michael Ellerman1af9fa82008-04-01 17:42:27 +1100551 pr_debug("xics: map virq %d, hwirq 0x%lx\n", virq, hw);
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000552
Sebastien Dugue967e0122008-09-04 22:37:07 +1000553 /* Insert the interrupt mapping into the radix tree for fast lookup */
554 irq_radix_revmap_insert(xics_host, virq, hw);
555
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000556 get_irq_desc(virq)->status |= IRQ_LEVEL;
Michael Ellerman1af9fa82008-04-01 17:42:27 +1100557 set_irq_chip_and_handler(virq, xics_irq_chip, handle_fasteoi_irq);
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000558 return 0;
559}
560
561static int xics_host_xlate(struct irq_host *h, struct device_node *ct,
562 u32 *intspec, unsigned int intsize,
563 irq_hw_number_t *out_hwirq, unsigned int *out_flags)
564
565{
566 /* Current xics implementation translates everything
567 * to level. It is not technically right for MSIs but this
568 * is irrelevant at this point. We might get smarter in the future
569 */
570 *out_hwirq = intspec[0];
571 *out_flags = IRQ_TYPE_LEVEL_LOW;
572
573 return 0;
574}
575
Michael Ellerman1af9fa82008-04-01 17:42:27 +1100576static struct irq_host_ops xics_host_ops = {
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000577 .match = xics_host_match,
Michael Ellerman1af9fa82008-04-01 17:42:27 +1100578 .map = xics_host_map,
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000579 .xlate = xics_host_xlate,
580};
581
582static void __init xics_init_host(void)
583{
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000584 if (firmware_has_feature(FW_FEATURE_LPAR))
Michael Ellerman1af9fa82008-04-01 17:42:27 +1100585 xics_irq_chip = &xics_pic_lpar;
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000586 else
Michael Ellerman1af9fa82008-04-01 17:42:27 +1100587 xics_irq_chip = &xics_pic_direct;
588
589 xics_host = irq_alloc_host(NULL, IRQ_HOST_MAP_TREE, 0, &xics_host_ops,
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000590 XICS_IRQ_SPURIOUS);
591 BUG_ON(xics_host == NULL);
592 irq_set_default_host(xics_host);
593}
594
595static void __init xics_map_one_cpu(int hw_id, unsigned long addr,
596 unsigned long size)
597{
598#ifdef CONFIG_SMP
599 int i;
600
601 /* This may look gross but it's good enough for now, we don't quite
602 * have a hard -> linux processor id matching.
603 */
604 for_each_possible_cpu(i) {
605 if (!cpu_present(i))
606 continue;
607 if (hw_id == get_hard_smp_processor_id(i)) {
608 xics_per_cpu[i] = ioremap(addr, size);
609 return;
610 }
611 }
612#else
613 if (hw_id != 0)
614 return;
615 xics_per_cpu[0] = ioremap(addr, size);
616#endif /* CONFIG_SMP */
617}
618
619static void __init xics_init_one_node(struct device_node *np,
620 unsigned int *indx)
621{
622 unsigned int ilen;
Jeremy Kerr954a46e2006-07-12 15:39:43 +1000623 const u32 *ireg;
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000624
625 /* This code does the theorically broken assumption that the interrupt
626 * server numbers are the same as the hard CPU numbers.
627 * This happens to be the case so far but we are playing with fire...
628 * should be fixed one of these days. -BenH.
629 */
Stephen Rothwelle2eb6392007-04-03 22:26:41 +1000630 ireg = of_get_property(np, "ibm,interrupt-server-ranges", NULL);
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000631
632 /* Do that ever happen ? we'll know soon enough... but even good'old
633 * f80 does have that property ..
634 */
635 WARN_ON(ireg == NULL);
636 if (ireg) {
637 /*
638 * set node starting index for this node
639 */
640 *indx = *ireg;
641 }
Stephen Rothwelle2eb6392007-04-03 22:26:41 +1000642 ireg = of_get_property(np, "reg", &ilen);
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000643 if (!ireg)
644 panic("xics_init_IRQ: can't find interrupt reg property");
645
646 while (ilen >= (4 * sizeof(u32))) {
647 unsigned long addr, size;
648
649 /* XXX Use proper OF parsing code here !!! */
650 addr = (unsigned long)*ireg++ << 32;
651 ilen -= sizeof(u32);
652 addr |= *ireg++;
653 ilen -= sizeof(u32);
654 size = (unsigned long)*ireg++ << 32;
655 ilen -= sizeof(u32);
656 size |= *ireg++;
657 ilen -= sizeof(u32);
658 xics_map_one_cpu(*indx, addr, size);
659 (*indx)++;
660 }
661}
662
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000663void __init xics_init_IRQ(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700664{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700665 struct device_node *np;
Nathan Fontenotde0723d2008-02-07 07:37:40 +1100666 u32 indx = 0;
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000667 int found = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700668
669 ppc64_boot_msg(0x20, "XICS Init");
670
671 ibm_get_xive = rtas_token("ibm,get-xive");
672 ibm_set_xive = rtas_token("ibm,set-xive");
673 ibm_int_on = rtas_token("ibm,int-on");
674 ibm_int_off = rtas_token("ibm,int-off");
675
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000676 for_each_node_by_type(np, "PowerPC-External-Interrupt-Presentation") {
677 found = 1;
678 if (firmware_has_feature(FW_FEATURE_LPAR))
679 break;
680 xics_init_one_node(np, &indx);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700681 }
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000682 if (found == 0)
683 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700684
Nathan Fontenotde0723d2008-02-07 07:37:40 +1100685 xics_update_irq_servers();
Milton Miller302905a2008-10-10 01:56:28 +0000686 xics_init_host();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700687
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000688 if (firmware_has_feature(FW_FEATURE_LPAR))
689 ppc_md.get_irq = xics_get_irq_lpar;
690 else
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000691 ppc_md.get_irq = xics_get_irq_direct;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700692
Paul Mackerras6c80a212005-05-06 16:28:56 +1000693 xics_setup_cpu();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700694
695 ppc64_boot_msg(0x21, "XICS Done");
696}
697
Linus Torvalds1da177e2005-04-16 15:20:36 -0700698
699#ifdef CONFIG_SMP
700void xics_request_IPIs(void)
701{
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000702 unsigned int ipi;
Michael Neuling66b30922007-05-29 17:01:52 +1000703 int rc;
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000704
Benjamin Herrenschmidt6e99e452006-07-10 04:44:42 -0700705 ipi = irq_create_mapping(xics_host, XICS_IPI);
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000706 BUG_ON(ipi == NO_IRQ);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700707
Thomas Gleixner67144652006-07-01 19:29:22 -0700708 /*
709 * IPIs are marked IRQF_DISABLED as they must run with irqs
710 * disabled
711 */
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000712 set_irq_handler(ipi, handle_percpu_irq);
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000713 if (firmware_has_feature(FW_FEATURE_LPAR))
Michael Neuling66b30922007-05-29 17:01:52 +1000714 rc = request_irq(ipi, xics_ipi_action_lpar, IRQF_DISABLED,
715 "IPI", NULL);
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000716 else
Michael Neuling66b30922007-05-29 17:01:52 +1000717 rc = request_irq(ipi, xics_ipi_action_direct, IRQF_DISABLED,
718 "IPI", NULL);
719 BUG_ON(rc);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700720}
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000721#endif /* CONFIG_SMP */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700722
Al Virof10095c2008-03-29 03:10:38 +0000723void xics_teardown_cpu(void)
R Sharadafce0d572005-06-25 14:58:10 -0700724{
725 int cpu = smp_processor_id();
R Sharadafce0d572005-06-25 14:58:10 -0700726
Milton Millerd7cf0ed2007-12-14 15:52:09 +1100727 xics_set_cpu_priority(0);
Haren Myneni81bbbe92006-04-05 21:10:18 -0600728
729 /*
Benjamin Herrenschmidt6e99e452006-07-10 04:44:42 -0700730 * Clear IPI
731 */
732 if (firmware_has_feature(FW_FEATURE_LPAR))
733 lpar_qirr_info(cpu, 0xff);
734 else
735 direct_qirr_info(cpu, 0xff);
Nathan Fontenotc3e85062008-02-07 07:37:31 +1100736}
737
738void xics_kexec_teardown_cpu(int secondary)
739{
740 unsigned int ipi;
741 struct irq_desc *desc;
742
743 xics_teardown_cpu();
Benjamin Herrenschmidt6e99e452006-07-10 04:44:42 -0700744
745 /*
Nathan Fontenotc3e85062008-02-07 07:37:31 +1100746 * we need to EOI the IPI
Haren Myneni81bbbe92006-04-05 21:10:18 -0600747 *
748 * probably need to check all the other interrupts too
749 * should we be flagging idle loop instead?
750 * or creating some task to be scheduled?
751 */
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000752
753 ipi = irq_find_mapping(xics_host, XICS_IPI);
754 if (ipi == XICS_IRQ_SPURIOUS)
755 return;
756 desc = get_irq_desc(ipi);
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000757 if (desc->chip && desc->chip->eoi)
Benjamin Herrenschmidt6e99e452006-07-10 04:44:42 -0700758 desc->chip->eoi(ipi);
Haren Myneni81bbbe92006-04-05 21:10:18 -0600759
R Sharadafce0d572005-06-25 14:58:10 -0700760 /*
Paul Mackerras6d22d852005-08-04 12:53:37 -0700761 * Some machines need to have at least one cpu in the GIQ,
762 * so leave the master cpu in the group.
R Sharadafce0d572005-06-25 14:58:10 -0700763 */
Haren Myneni81bbbe92006-04-05 21:10:18 -0600764 if (secondary)
Haren Myneni81b73dd2006-07-27 14:29:00 -0700765 rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE,
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000766 (1UL << interrupt_server_size) - 1 -
767 default_distrib_server, 0);
R Sharadafce0d572005-06-25 14:58:10 -0700768}
769
Linus Torvalds1da177e2005-04-16 15:20:36 -0700770#ifdef CONFIG_HOTPLUG_CPU
771
772/* Interrupts are disabled. */
773void xics_migrate_irqs_away(void)
774{
775 int status;
Milton Millerd7cf0ed2007-12-14 15:52:09 +1100776 int cpu = smp_processor_id(), hw_cpu = hard_smp_processor_id();
777 unsigned int irq, virq;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700778
Milton Miller302905a2008-10-10 01:56:28 +0000779 /* If we used to be the default server, move to the new "boot_cpuid" */
780 if (hw_cpu == default_server)
781 xics_update_irq_servers();
782
Linus Torvalds1da177e2005-04-16 15:20:36 -0700783 /* Reject any interrupt that was queued to us... */
Milton Millerd7cf0ed2007-12-14 15:52:09 +1100784 xics_set_cpu_priority(0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700785
786 /* remove ourselves from the global interrupt queue */
Haren Myneni81b73dd2006-07-27 14:29:00 -0700787 status = rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700788 (1UL << interrupt_server_size) - 1 - default_distrib_server, 0);
789 WARN_ON(status < 0);
790
791 /* Allow IPIs again... */
Milton Millerd7cf0ed2007-12-14 15:52:09 +1100792 xics_set_cpu_priority(DEFAULT_PRIORITY);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700793
794 for_each_irq(virq) {
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000795 struct irq_desc *desc;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700796 int xics_status[2];
797 unsigned long flags;
798
799 /* We cant set affinity on ISA interrupts */
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000800 if (virq < NUM_ISA_INTERRUPTS)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700801 continue;
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000802 if (irq_map[virq].host != xics_host)
803 continue;
804 irq = (unsigned int)irq_map[virq].hwirq;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700805 /* We need to get IPIs still. */
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000806 if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700807 continue;
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000808 desc = get_irq_desc(virq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700809
810 /* We only need to migrate enabled IRQS */
Ingo Molnard1bef4e2006-06-29 02:24:36 -0700811 if (desc == NULL || desc->chip == NULL
Linus Torvalds1da177e2005-04-16 15:20:36 -0700812 || desc->action == NULL
Ingo Molnard1bef4e2006-06-29 02:24:36 -0700813 || desc->chip->set_affinity == NULL)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700814 continue;
815
816 spin_lock_irqsave(&desc->lock, flags);
817
818 status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq);
819 if (status) {
Anton Blanchard26370322005-09-12 13:12:11 +1000820 printk(KERN_ERR "migrate_irqs_away: irq=%u "
Linus Torvalds1da177e2005-04-16 15:20:36 -0700821 "ibm,get-xive returns %d\n",
822 virq, status);
823 goto unlock;
824 }
825
826 /*
827 * We only support delivery to all cpus or to one cpu.
828 * The irq has to be migrated only in the single cpu
829 * case.
830 */
Milton Millerd7cf0ed2007-12-14 15:52:09 +1100831 if (xics_status[0] != hw_cpu)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700832 goto unlock;
833
Anton Blanchard26370322005-09-12 13:12:11 +1000834 printk(KERN_WARNING "IRQ %u affinity broken off cpu %u\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700835 virq, cpu);
836
837 /* Reset affinity to all cpus */
Nathan Fontenota52572d2008-02-07 07:37:26 +1100838 irq_desc[virq].affinity = CPU_MASK_ALL;
Ingo Molnard1bef4e2006-06-29 02:24:36 -0700839 desc->chip->set_affinity(virq, CPU_MASK_ALL);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700840unlock:
841 spin_unlock_irqrestore(&desc->lock, flags);
842 }
843}
844#endif