diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2010-05-14 07:41:20 -0400 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2010-07-22 19:46:30 -0400 |
commit | 99ad198c4978036bb9f7ebd11618b225b77046da (patch) | |
tree | d236698e6980dc8909aeb0cbdfbc8d84b2abbef8 /drivers/xen/events.c | |
parent | 016b6f5fe8398b0291cece60b749d7c930a2e09c (diff) |
xen: Fix find_unbound_irq in presence of ioapic irqs.
Don't break the assumption that the first 16 irqs are ISA irqs;
make sure that the irq is actually free before using it.
Use dynamic_irq_init_keep_chip_data instead of
dynamic_irq_init so that chip_data is not NULL (a NULL chip_data breaks
setup_vector_irq).
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'drivers/xen/events.c')
-rw-r--r-- | drivers/xen/events.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 7c64473c9f3f..b5a254e9aebe 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -340,9 +340,18 @@ static int find_unbound_irq(void) | |||
340 | int irq; | 340 | int irq; |
341 | struct irq_desc *desc; | 341 | struct irq_desc *desc; |
342 | 342 | ||
343 | for (irq = 0; irq < nr_irqs; irq++) | 343 | for (irq = 0; irq < nr_irqs; irq++) { |
344 | desc = irq_to_desc(irq); | ||
345 | /* only 0->15 have init'd desc; handle irq > 16 */ | ||
346 | if (desc == NULL) | ||
347 | break; | ||
348 | if (desc->chip == &no_irq_chip) | ||
349 | break; | ||
350 | if (desc->chip != &xen_dynamic_chip) | ||
351 | continue; | ||
344 | if (irq_info[irq].type == IRQT_UNBOUND) | 352 | if (irq_info[irq].type == IRQT_UNBOUND) |
345 | break; | 353 | break; |
354 | } | ||
346 | 355 | ||
347 | if (irq == nr_irqs) | 356 | if (irq == nr_irqs) |
348 | panic("No available IRQ to bind to: increase nr_irqs!\n"); | 357 | panic("No available IRQ to bind to: increase nr_irqs!\n"); |
@@ -351,7 +360,7 @@ static int find_unbound_irq(void) | |||
351 | if (WARN_ON(desc == NULL)) | 360 | if (WARN_ON(desc == NULL)) |
352 | return -1; | 361 | return -1; |
353 | 362 | ||
354 | dynamic_irq_init(irq); | 363 | dynamic_irq_init_keep_chip_data(irq); |
355 | 364 | ||
356 | return irq; | 365 | return irq; |
357 | } | 366 | } |