diff options
Diffstat (limited to 'kernel/irq/chip.c')
| -rw-r--r-- | kernel/irq/chip.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 10b5092e9bfe..b343deedae91 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
| @@ -24,9 +24,10 @@ | |||
| 24 | */ | 24 | */ |
| 25 | void dynamic_irq_init(unsigned int irq) | 25 | void dynamic_irq_init(unsigned int irq) |
| 26 | { | 26 | { |
| 27 | struct irq_desc *desc = irq_to_desc(irq); | 27 | struct irq_desc *desc; |
| 28 | unsigned long flags; | 28 | unsigned long flags; |
| 29 | 29 | ||
| 30 | desc = irq_to_desc(irq); | ||
| 30 | if (!desc) { | 31 | if (!desc) { |
| 31 | WARN(1, KERN_ERR "Trying to initialize invalid IRQ%d\n", irq); | 32 | WARN(1, KERN_ERR "Trying to initialize invalid IRQ%d\n", irq); |
| 32 | return; | 33 | return; |
| @@ -45,7 +46,7 @@ void dynamic_irq_init(unsigned int irq) | |||
| 45 | desc->irq_count = 0; | 46 | desc->irq_count = 0; |
| 46 | desc->irqs_unhandled = 0; | 47 | desc->irqs_unhandled = 0; |
| 47 | #ifdef CONFIG_SMP | 48 | #ifdef CONFIG_SMP |
| 48 | cpus_setall(desc->affinity); | 49 | cpumask_setall(&desc->affinity); |
| 49 | #endif | 50 | #endif |
| 50 | spin_unlock_irqrestore(&desc->lock, flags); | 51 | spin_unlock_irqrestore(&desc->lock, flags); |
| 51 | } | 52 | } |
| @@ -352,6 +353,7 @@ handle_level_irq(unsigned int irq, struct irq_desc *desc) | |||
| 352 | 353 | ||
| 353 | spin_lock(&desc->lock); | 354 | spin_lock(&desc->lock); |
| 354 | mask_ack_irq(desc, irq); | 355 | mask_ack_irq(desc, irq); |
| 356 | desc = irq_remap_to_desc(irq, desc); | ||
| 355 | 357 | ||
| 356 | if (unlikely(desc->status & IRQ_INPROGRESS)) | 358 | if (unlikely(desc->status & IRQ_INPROGRESS)) |
| 357 | goto out_unlock; | 359 | goto out_unlock; |
| @@ -429,6 +431,7 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc) | |||
| 429 | desc->status &= ~IRQ_INPROGRESS; | 431 | desc->status &= ~IRQ_INPROGRESS; |
| 430 | out: | 432 | out: |
| 431 | desc->chip->eoi(irq); | 433 | desc->chip->eoi(irq); |
| 434 | desc = irq_remap_to_desc(irq, desc); | ||
| 432 | 435 | ||
| 433 | spin_unlock(&desc->lock); | 436 | spin_unlock(&desc->lock); |
| 434 | } | 437 | } |
| @@ -465,12 +468,14 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc) | |||
| 465 | !desc->action)) { | 468 | !desc->action)) { |
| 466 | desc->status |= (IRQ_PENDING | IRQ_MASKED); | 469 | desc->status |= (IRQ_PENDING | IRQ_MASKED); |
| 467 | mask_ack_irq(desc, irq); | 470 | mask_ack_irq(desc, irq); |
| 471 | desc = irq_remap_to_desc(irq, desc); | ||
| 468 | goto out_unlock; | 472 | goto out_unlock; |
| 469 | } | 473 | } |
| 470 | kstat_incr_irqs_this_cpu(irq, desc); | 474 | kstat_incr_irqs_this_cpu(irq, desc); |
| 471 | 475 | ||
| 472 | /* Start handling the irq */ | 476 | /* Start handling the irq */ |
| 473 | desc->chip->ack(irq); | 477 | desc->chip->ack(irq); |
| 478 | desc = irq_remap_to_desc(irq, desc); | ||
| 474 | 479 | ||
| 475 | /* Mark the IRQ currently in progress.*/ | 480 | /* Mark the IRQ currently in progress.*/ |
| 476 | desc->status |= IRQ_INPROGRESS; | 481 | desc->status |= IRQ_INPROGRESS; |
| @@ -531,8 +536,10 @@ handle_percpu_irq(unsigned int irq, struct irq_desc *desc) | |||
| 531 | if (!noirqdebug) | 536 | if (!noirqdebug) |
| 532 | note_interrupt(irq, desc, action_ret); | 537 | note_interrupt(irq, desc, action_ret); |
| 533 | 538 | ||
| 534 | if (desc->chip->eoi) | 539 | if (desc->chip->eoi) { |
| 535 | desc->chip->eoi(irq); | 540 | desc->chip->eoi(irq); |
| 541 | desc = irq_remap_to_desc(irq, desc); | ||
| 542 | } | ||
| 536 | } | 543 | } |
| 537 | 544 | ||
| 538 | void | 545 | void |
| @@ -567,8 +574,10 @@ __set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained, | |||
| 567 | 574 | ||
| 568 | /* Uninstall? */ | 575 | /* Uninstall? */ |
| 569 | if (handle == handle_bad_irq) { | 576 | if (handle == handle_bad_irq) { |
| 570 | if (desc->chip != &no_irq_chip) | 577 | if (desc->chip != &no_irq_chip) { |
| 571 | mask_ack_irq(desc, irq); | 578 | mask_ack_irq(desc, irq); |
| 579 | desc = irq_remap_to_desc(irq, desc); | ||
| 580 | } | ||
| 572 | desc->status |= IRQ_DISABLED; | 581 | desc->status |= IRQ_DISABLED; |
| 573 | desc->depth = 1; | 582 | desc->depth = 1; |
| 574 | } | 583 | } |
