aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/events.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-12-30 19:20:19 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-12-30 19:20:19 -0500
commit179475a3b46f86e2d06f83e2312218ac3f0cf3a7 (patch)
treed4755f722ae606e21ac87baa262041e2580b2568 /drivers/xen/events.c
parentbb758e9637e5ddcff84a97177415499ae1fed498 (diff)
parent860cf8894b326e4b89720f520540604834337b72 (diff)
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: x86, sparseirq: clean up Kconfig entry x86: turn CONFIG_SPARSE_IRQ off by default sparseirq: fix numa_migrate_irq_desc dependency and comments sparseirq: add kernel-doc notation for new member in irq_desc, -v2 locking, irq: enclose irq_desc_lock_class in CONFIG_LOCKDEP sparseirq, xen: make sure irq_desc is allocated for interrupts sparseirq: fix !SMP building, #2 x86, sparseirq: move irq_desc according to smp_affinity, v7 proc: enclose desc variable of show_stat() in CONFIG_SPARSE_IRQ sparse irqs: add irqnr.h to the user headers list sparse irqs: handle !GENIRQ platforms sparseirq: fix !SMP && !PCI_MSI && !HT_IRQ build sparseirq: fix Alpha build failure sparseirq: fix typo in !CONFIG_IO_APIC case x86, MSI: pass irq_cfg and irq_desc x86: MSI start irq numbering from nr_irqs_gsi x86: use NR_IRQS_LEGACY sparse irq_desc[] array: core kernel and x86 changes genirq: record IRQ_LEVEL in irq_desc[] irq.h: remove padding from irq_desc on 64bits
Diffstat (limited to 'drivers/xen/events.c')
-rw-r--r--drivers/xen/events.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 1e3b934a4cf7..46625cd38743 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -141,8 +141,12 @@ static void init_evtchn_cpu_bindings(void)
141 int i; 141 int i;
142 142
143 /* By default all event channels notify CPU#0. */ 143 /* By default all event channels notify CPU#0. */
144 for_each_irq_desc(i, desc) 144 for_each_irq_desc(i, desc) {
145 if (!desc)
146 continue;
147
145 desc->affinity = cpumask_of_cpu(0); 148 desc->affinity = cpumask_of_cpu(0);
149 }
146#endif 150#endif
147 151
148 memset(cpu_evtchn, 0, sizeof(cpu_evtchn)); 152 memset(cpu_evtchn, 0, sizeof(cpu_evtchn));
@@ -229,15 +233,20 @@ static void unmask_evtchn(int port)
229static int find_unbound_irq(void) 233static int find_unbound_irq(void)
230{ 234{
231 int irq; 235 int irq;
236 struct irq_desc *desc;
232 237
233 /* Only allocate from dynirq range */ 238 /* Only allocate from dynirq range */
234 for_each_irq_nr(irq) 239 for (irq = 0; irq < nr_irqs; irq++)
235 if (irq_bindcount[irq] == 0) 240 if (irq_bindcount[irq] == 0)
236 break; 241 break;
237 242
238 if (irq == nr_irqs) 243 if (irq == nr_irqs)
239 panic("No available IRQ to bind to: increase nr_irqs!\n"); 244 panic("No available IRQ to bind to: increase nr_irqs!\n");
240 245
246 desc = irq_to_desc_alloc_cpu(irq, 0);
247 if (WARN_ON(desc == NULL))
248 return -1;
249
241 return irq; 250 return irq;
242} 251}
243 252
@@ -792,7 +801,7 @@ void xen_irq_resume(void)
792 mask_evtchn(evtchn); 801 mask_evtchn(evtchn);
793 802
794 /* No IRQ <-> event-channel mappings. */ 803 /* No IRQ <-> event-channel mappings. */
795 for_each_irq_nr(irq) 804 for (irq = 0; irq < nr_irqs; irq++)
796 irq_info[irq].evtchn = 0; /* zap event-channel binding */ 805 irq_info[irq].evtchn = 0; /* zap event-channel binding */
797 806
798 for (evtchn = 0; evtchn < NR_EVENT_CHANNELS; evtchn++) 807 for (evtchn = 0; evtchn < NR_EVENT_CHANNELS; evtchn++)
@@ -824,7 +833,7 @@ void __init xen_init_IRQ(void)
824 mask_evtchn(i); 833 mask_evtchn(i);
825 834
826 /* Dynamic IRQ space is currently unbound. Zero the refcnts. */ 835 /* Dynamic IRQ space is currently unbound. Zero the refcnts. */
827 for_each_irq_nr(i) 836 for (i = 0; i < nr_irqs; i++)
828 irq_bindcount[i] = 0; 837 irq_bindcount[i] = 0;
829 838
830 irq_ctx_init(smp_processor_id()); 839 irq_ctx_init(smp_processor_id());