diff options
author | Tony Luck <tony.luck@intel.com> | 2005-09-08 17:27:13 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-09-08 17:27:13 -0400 |
commit | 344a076110f4ecb16ea6d286b63be696604982ed (patch) | |
tree | def6e229efdb6ee91b631b6695bf7f9ace8e2719 /arch/ia64/kernel/iosapic.c | |
parent | 9b17e7e74e767d8a494a74c3c459aeecd1e08c5f (diff) | |
parent | 1b11d78cf87a7014f96e5b7fa2e1233cc8081a00 (diff) |
[IA64] Manual merge fix for 3 files
arch/ia64/Kconfig
arch/ia64/kernel/acpi.c
include/asm-ia64/irq.h
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel/iosapic.c')
-rw-r--r-- | arch/ia64/kernel/iosapic.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c index c0c3f55b0231..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 |