diff options
Diffstat (limited to 'arch/ia64/kernel/iosapic.c')
| -rw-r--r-- | arch/ia64/kernel/iosapic.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c index 7936b62f7a2e..574084f343fa 100644 --- a/arch/ia64/kernel/iosapic.c +++ b/arch/ia64/kernel/iosapic.c | |||
| @@ -561,7 +561,7 @@ static inline int vector_is_shared (int vector) | |||
| 561 | return (iosapic_intr_info[vector].count > 1); | 561 | return (iosapic_intr_info[vector].count > 1); |
| 562 | } | 562 | } |
| 563 | 563 | ||
| 564 | static void | 564 | static int |
| 565 | register_intr (unsigned int gsi, int vector, unsigned char delivery, | 565 | register_intr (unsigned int gsi, int vector, unsigned char delivery, |
| 566 | unsigned long polarity, unsigned long trigger) | 566 | unsigned long polarity, unsigned long trigger) |
| 567 | { | 567 | { |
| @@ -576,7 +576,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery, | |||
| 576 | index = find_iosapic(gsi); | 576 | index = find_iosapic(gsi); |
| 577 | if (index < 0) { | 577 | if (index < 0) { |
| 578 | printk(KERN_WARNING "%s: No IOSAPIC for GSI %u\n", __FUNCTION__, gsi); | 578 | printk(KERN_WARNING "%s: No IOSAPIC for GSI %u\n", __FUNCTION__, gsi); |
| 579 | return; | 579 | return -ENODEV; |
| 580 | } | 580 | } |
| 581 | 581 | ||
| 582 | iosapic_address = iosapic_lists[index].addr; | 582 | iosapic_address = iosapic_lists[index].addr; |
| @@ -587,7 +587,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery, | |||
| 587 | rte = iosapic_alloc_rte(); | 587 | rte = iosapic_alloc_rte(); |
| 588 | if (!rte) { | 588 | if (!rte) { |
| 589 | printk(KERN_WARNING "%s: cannot allocate memory\n", __FUNCTION__); | 589 | printk(KERN_WARNING "%s: cannot allocate memory\n", __FUNCTION__); |
| 590 | return; | 590 | return -ENOMEM; |
| 591 | } | 591 | } |
| 592 | 592 | ||
| 593 | rte_index = gsi - gsi_base; | 593 | rte_index = gsi - gsi_base; |
| @@ -603,7 +603,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery, | |||
| 603 | struct iosapic_intr_info *info = &iosapic_intr_info[vector]; | 603 | struct iosapic_intr_info *info = &iosapic_intr_info[vector]; |
| 604 | if (info->trigger != trigger || info->polarity != polarity) { | 604 | if (info->trigger != trigger || info->polarity != polarity) { |
| 605 | printk (KERN_WARNING "%s: cannot override the interrupt\n", __FUNCTION__); | 605 | printk (KERN_WARNING "%s: cannot override the interrupt\n", __FUNCTION__); |
| 606 | return; | 606 | return -EINVAL; |
| 607 | } | 607 | } |
| 608 | } | 608 | } |
| 609 | 609 | ||
| @@ -623,6 +623,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery, | |||
| 623 | __FUNCTION__, vector, idesc->handler->typename, irq_type->typename); | 623 | __FUNCTION__, vector, idesc->handler->typename, irq_type->typename); |
| 624 | idesc->handler = irq_type; | 624 | idesc->handler = irq_type; |
| 625 | } | 625 | } |
| 626 | return 0; | ||
| 626 | } | 627 | } |
| 627 | 628 | ||
| 628 | static unsigned int | 629 | static unsigned int |
| @@ -710,7 +711,7 @@ int | |||
| 710 | iosapic_register_intr (unsigned int gsi, | 711 | iosapic_register_intr (unsigned int gsi, |
| 711 | unsigned long polarity, unsigned long trigger) | 712 | unsigned long polarity, unsigned long trigger) |
| 712 | { | 713 | { |
| 713 | int vector, mask = 1; | 714 | int vector, mask = 1, err; |
| 714 | unsigned int dest; | 715 | unsigned int dest; |
| 715 | unsigned long flags; | 716 | unsigned long flags; |
| 716 | struct iosapic_rte_info *rte; | 717 | struct iosapic_rte_info *rte; |
| @@ -737,8 +738,8 @@ again: | |||
| 737 | vector = assign_irq_vector(AUTO_ASSIGN); | 738 | vector = assign_irq_vector(AUTO_ASSIGN); |
| 738 | if (vector < 0) { | 739 | if (vector < 0) { |
| 739 | vector = iosapic_find_sharable_vector(trigger, polarity); | 740 | vector = iosapic_find_sharable_vector(trigger, polarity); |
| 740 | if (vector < 0) | 741 | if (vector < 0) |
| 741 | panic("%s: out of interrupt vectors!\n", __FUNCTION__); | 742 | return -ENOSPC; |
| 742 | } | 743 | } |
| 743 | 744 | ||
| 744 | spin_lock_irqsave(&irq_descp(vector)->lock, flags); | 745 | spin_lock_irqsave(&irq_descp(vector)->lock, flags); |
| @@ -753,8 +754,13 @@ again: | |||
| 753 | } | 754 | } |
| 754 | 755 | ||
| 755 | dest = get_target_cpu(gsi, vector); | 756 | dest = get_target_cpu(gsi, vector); |
| 756 | register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY, | 757 | err = register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY, |
| 757 | polarity, trigger); | 758 | polarity, trigger); |
| 759 | if (err < 0) { | ||
| 760 | spin_unlock(&iosapic_lock); | ||
| 761 | spin_unlock_irqrestore(&irq_descp(vector)->lock, flags); | ||
| 762 | return err; | ||
| 763 | } | ||
| 758 | 764 | ||
| 759 | /* | 765 | /* |
| 760 | * If the vector is shared and already unmasked for | 766 | * If the vector is shared and already unmasked for |
| @@ -776,7 +782,6 @@ again: | |||
| 776 | return vector; | 782 | return vector; |
| 777 | } | 783 | } |
| 778 | 784 | ||
| 779 | #ifdef CONFIG_ACPI_DEALLOCATE_IRQ | ||
| 780 | void | 785 | void |
| 781 | iosapic_unregister_intr (unsigned int gsi) | 786 | iosapic_unregister_intr (unsigned int gsi) |
| 782 | { | 787 | { |
| @@ -859,7 +864,6 @@ iosapic_unregister_intr (unsigned int gsi) | |||
| 859 | spin_unlock(&iosapic_lock); | 864 | spin_unlock(&iosapic_lock); |
| 860 | spin_unlock_irqrestore(&idesc->lock, flags); | 865 | spin_unlock_irqrestore(&idesc->lock, flags); |
| 861 | } | 866 | } |
| 862 | #endif /* CONFIG_ACPI_DEALLOCATE_IRQ */ | ||
| 863 | 867 | ||
| 864 | /* | 868 | /* |
| 865 | * ACPI calls this when it finds an entry for a platform interrupt. | 869 | * ACPI calls this when it finds an entry for a platform interrupt. |
