diff options
Diffstat (limited to 'drivers/parisc/iosapic.c')
-rw-r--r-- | drivers/parisc/iosapic.c | 56 |
1 files changed, 12 insertions, 44 deletions
diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c index c76836727cae..a3120a09c43d 100644 --- a/drivers/parisc/iosapic.c +++ b/drivers/parisc/iosapic.c | |||
@@ -615,17 +615,10 @@ iosapic_set_irt_data( struct vector_info *vi, u32 *dp0, u32 *dp1) | |||
615 | } | 615 | } |
616 | 616 | ||
617 | 617 | ||
618 | static struct vector_info *iosapic_get_vector(unsigned int irq) | 618 | static void iosapic_mask_irq(unsigned int irq) |
619 | { | ||
620 | struct irq_desc *desc = irq_to_desc(irq); | ||
621 | |||
622 | return desc->chip_data; | ||
623 | } | ||
624 | |||
625 | static void iosapic_disable_irq(unsigned int irq) | ||
626 | { | 619 | { |
627 | unsigned long flags; | 620 | unsigned long flags; |
628 | struct vector_info *vi = iosapic_get_vector(irq); | 621 | struct vector_info *vi = get_irq_chip_data(irq); |
629 | u32 d0, d1; | 622 | u32 d0, d1; |
630 | 623 | ||
631 | spin_lock_irqsave(&iosapic_lock, flags); | 624 | spin_lock_irqsave(&iosapic_lock, flags); |
@@ -635,9 +628,9 @@ static void iosapic_disable_irq(unsigned int irq) | |||
635 | spin_unlock_irqrestore(&iosapic_lock, flags); | 628 | spin_unlock_irqrestore(&iosapic_lock, flags); |
636 | } | 629 | } |
637 | 630 | ||
638 | static void iosapic_enable_irq(unsigned int irq) | 631 | static void iosapic_unmask_irq(unsigned int irq) |
639 | { | 632 | { |
640 | struct vector_info *vi = iosapic_get_vector(irq); | 633 | struct vector_info *vi = get_irq_chip_data(irq); |
641 | u32 d0, d1; | 634 | u32 d0, d1; |
642 | 635 | ||
643 | /* data is initialized by fixup_irq */ | 636 | /* data is initialized by fixup_irq */ |
@@ -676,36 +669,14 @@ printk("\n"); | |||
676 | DBG(KERN_DEBUG "enable_irq(%d): eoi(%p, 0x%x)\n", irq, | 669 | DBG(KERN_DEBUG "enable_irq(%d): eoi(%p, 0x%x)\n", irq, |
677 | vi->eoi_addr, vi->eoi_data); | 670 | vi->eoi_addr, vi->eoi_data); |
678 | iosapic_eoi(vi->eoi_addr, vi->eoi_data); | 671 | iosapic_eoi(vi->eoi_addr, vi->eoi_data); |
679 | } | 672 | cpu_eoi_irq(irq); |
680 | |||
681 | /* | ||
682 | * PARISC only supports PCI devices below I/O SAPIC. | ||
683 | * PCI only supports level triggered in order to share IRQ lines. | ||
684 | * ergo I/O SAPIC must always issue EOI on parisc. | ||
685 | * | ||
686 | * i386/ia64 support ISA devices and have to deal with | ||
687 | * edge-triggered interrupts too. | ||
688 | */ | ||
689 | static void iosapic_end_irq(unsigned int irq) | ||
690 | { | ||
691 | struct vector_info *vi = iosapic_get_vector(irq); | ||
692 | DBG(KERN_DEBUG "end_irq(%d): eoi(%p, 0x%x)\n", irq, | ||
693 | vi->eoi_addr, vi->eoi_data); | ||
694 | iosapic_eoi(vi->eoi_addr, vi->eoi_data); | ||
695 | cpu_end_irq(irq); | ||
696 | } | ||
697 | |||
698 | static unsigned int iosapic_startup_irq(unsigned int irq) | ||
699 | { | ||
700 | iosapic_enable_irq(irq); | ||
701 | return 0; | ||
702 | } | 673 | } |
703 | 674 | ||
704 | #ifdef CONFIG_SMP | 675 | #ifdef CONFIG_SMP |
705 | static int iosapic_set_affinity_irq(unsigned int irq, | 676 | static int iosapic_set_affinity_irq(unsigned int irq, |
706 | const struct cpumask *dest) | 677 | const struct cpumask *dest) |
707 | { | 678 | { |
708 | struct vector_info *vi = iosapic_get_vector(irq); | 679 | struct vector_info *vi = get_irq_chip_data(irq); |
709 | u32 d0, d1, dummy_d0; | 680 | u32 d0, d1, dummy_d0; |
710 | unsigned long flags; | 681 | unsigned long flags; |
711 | int dest_cpu; | 682 | int dest_cpu; |
@@ -730,13 +701,10 @@ static int iosapic_set_affinity_irq(unsigned int irq, | |||
730 | #endif | 701 | #endif |
731 | 702 | ||
732 | static struct irq_chip iosapic_interrupt_type = { | 703 | static struct irq_chip iosapic_interrupt_type = { |
733 | .name = "IO-SAPIC-level", | 704 | .name = "IO-SAPIC-level", |
734 | .startup = iosapic_startup_irq, | 705 | .unmask = iosapic_unmask_irq, |
735 | .shutdown = iosapic_disable_irq, | 706 | .mask = iosapic_mask_irq, |
736 | .enable = iosapic_enable_irq, | 707 | .ack = cpu_ack_irq, |
737 | .disable = iosapic_disable_irq, | ||
738 | .ack = cpu_ack_irq, | ||
739 | .end = iosapic_end_irq, | ||
740 | #ifdef CONFIG_SMP | 708 | #ifdef CONFIG_SMP |
741 | .set_affinity = iosapic_set_affinity_irq, | 709 | .set_affinity = iosapic_set_affinity_irq, |
742 | #endif | 710 | #endif |
@@ -891,8 +859,8 @@ void *iosapic_register(unsigned long hpa) | |||
891 | isi->isi_version = iosapic_rd_version(isi); | 859 | isi->isi_version = iosapic_rd_version(isi); |
892 | isi->isi_num_vectors = IOSAPIC_IRDT_MAX_ENTRY(isi->isi_version) + 1; | 860 | isi->isi_num_vectors = IOSAPIC_IRDT_MAX_ENTRY(isi->isi_version) + 1; |
893 | 861 | ||
894 | vip = isi->isi_vector = (struct vector_info *) | 862 | vip = isi->isi_vector = kcalloc(isi->isi_num_vectors, |
895 | kzalloc(sizeof(struct vector_info) * isi->isi_num_vectors, GFP_KERNEL); | 863 | sizeof(struct vector_info), GFP_KERNEL); |
896 | if (vip == NULL) { | 864 | if (vip == NULL) { |
897 | kfree(isi); | 865 | kfree(isi); |
898 | return NULL; | 866 | return NULL; |