Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PARISC] Convert to new irq_chip functions

Convert all the parisc driver interrupt handlers (dino, eisa, gsc,
iosapic and superio) as well as the cpu interrupts. Prepare
show_interrupts for GENERIC_HARDIRQS_NO_DEPRECATED and finally selects
that Kconfig option

[jejb: compile and testing fixes]
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>

authored by

Thomas Gleixner and committed by
James Bottomley
4c4231ea 9804c9ea

+98 -88
+1
arch/parisc/Kconfig
··· 15 15 select HAVE_GENERIC_HARDIRQS 16 16 select GENERIC_IRQ_PROBE 17 17 select IRQ_PER_CPU 18 + select GENERIC_HARDIRQS_NO_DEPRECATED 18 19 19 20 help 20 21 The PA-RISC microprocessor is designed by Hewlett-Packard and used
+4 -9
arch/parisc/include/asm/irq.h
··· 32 32 } 33 33 34 34 struct irq_chip; 35 + struct irq_data; 35 36 36 - /* 37 - * Some useful "we don't have to do anything here" handlers. Should 38 - * probably be provided by the generic code. 39 - */ 40 - void no_ack_irq(unsigned int irq); 41 - void no_end_irq(unsigned int irq); 42 - void cpu_ack_irq(unsigned int irq); 43 - void cpu_eoi_irq(unsigned int irq); 37 + void cpu_ack_irq(struct irq_data *d); 38 + void cpu_eoi_irq(struct irq_data *d); 44 39 45 40 extern int txn_alloc_irq(unsigned int nbits); 46 41 extern int txn_claim_irq(int); ··· 44 49 extern unsigned long txn_affinity_addr(unsigned int irq, int cpu); 45 50 46 51 extern int cpu_claim_irq(unsigned int irq, struct irq_chip *, void *); 47 - extern int cpu_check_affinity(unsigned int irq, const struct cpumask *dest); 52 + extern int cpu_check_affinity(struct irq_data *d, const struct cpumask *dest); 48 53 49 54 /* soft power switch support (power.c) */ 50 55 extern struct tasklet_struct power_tasklet;
+37 -27
arch/parisc/kernel/irq.c
··· 52 52 */ 53 53 static DEFINE_PER_CPU(unsigned long, local_ack_eiem) = ~0UL; 54 54 55 - static void cpu_mask_irq(unsigned int irq) 55 + static void cpu_mask_irq(struct irq_data *d) 56 56 { 57 - unsigned long eirr_bit = EIEM_MASK(irq); 57 + unsigned long eirr_bit = EIEM_MASK(d->irq); 58 58 59 59 cpu_eiem &= ~eirr_bit; 60 60 /* Do nothing on the other CPUs. If they get this interrupt, ··· 63 63 * then gets disabled */ 64 64 } 65 65 66 - static void cpu_unmask_irq(unsigned int irq) 66 + static void __cpu_unmask_irq(unsigned int irq) 67 67 { 68 68 unsigned long eirr_bit = EIEM_MASK(irq); 69 69 ··· 75 75 smp_send_all_nop(); 76 76 } 77 77 78 - void cpu_ack_irq(unsigned int irq) 78 + static void cpu_unmask_irq(struct irq_data *d) 79 79 { 80 - unsigned long mask = EIEM_MASK(irq); 80 + __cpu_unmask_irq(d->irq); 81 + } 82 + 83 + void cpu_ack_irq(struct irq_data *d) 84 + { 85 + unsigned long mask = EIEM_MASK(d->irq); 81 86 int cpu = smp_processor_id(); 82 87 83 88 /* Clear in EIEM so we can no longer process */ ··· 95 90 mtctl(mask, 23); 96 91 } 97 92 98 - void cpu_eoi_irq(unsigned int irq) 93 + void cpu_eoi_irq(struct irq_data *d) 99 94 { 100 - unsigned long mask = EIEM_MASK(irq); 95 + unsigned long mask = EIEM_MASK(d->irq); 101 96 int cpu = smp_processor_id(); 102 97 103 98 /* set it in the eiems---it's no longer in process */ ··· 108 103 } 109 104 110 105 #ifdef CONFIG_SMP 111 - int cpu_check_affinity(unsigned int irq, const struct cpumask *dest) 106 + int cpu_check_affinity(struct irq_data *d, const struct cpumask *dest) 112 107 { 113 108 int cpu_dest; 114 109 115 110 /* timer and ipi have to always be received on all CPUs */ 116 - if (CHECK_IRQ_PER_CPU(irq_to_desc(irq)->status)) { 111 + if (CHECK_IRQ_PER_CPU(irq_to_desc(d->irq)->status)) { 117 112 /* Bad linux design decision. The mask has already 118 - * been set; we must reset it */ 119 - cpumask_setall(irq_desc[irq].affinity); 113 + * been set; we must reset it. Will fix - tglx 114 + */ 115 + cpumask_setall(d->affinity); 120 116 return -EINVAL; 121 117 } 122 118 ··· 127 121 return cpu_dest; 128 122 } 129 123 130 - static int cpu_set_affinity_irq(unsigned int irq, const struct cpumask *dest) 124 + static int cpu_set_affinity_irq(struct irq_data *d, const struct cpumask *dest, 125 + bool force) 131 126 { 132 127 int cpu_dest; 133 128 134 - cpu_dest = cpu_check_affinity(irq, dest); 129 + cpu_dest = cpu_check_affinity(d, dest); 135 130 if (cpu_dest < 0) 136 131 return -1; 137 132 138 - cpumask_copy(irq_desc[irq].affinity, dest); 133 + cpumask_copy(d->affinity, dest); 139 134 140 135 return 0; 141 136 } 142 137 #endif 143 138 144 139 static struct irq_chip cpu_interrupt_type = { 145 - .name = "CPU", 146 - .mask = cpu_mask_irq, 147 - .unmask = cpu_unmask_irq, 148 - .ack = cpu_ack_irq, 149 - .eoi = cpu_eoi_irq, 140 + .name = "CPU", 141 + .irq_mask = cpu_mask_irq, 142 + .irq_unmask = cpu_unmask_irq, 143 + .irq_ack = cpu_ack_irq, 144 + .irq_eoi = cpu_eoi_irq, 150 145 #ifdef CONFIG_SMP 151 - .set_affinity = cpu_set_affinity_irq, 146 + .irq_set_affinity = cpu_set_affinity_irq, 152 147 #endif 153 148 /* XXX: Needs to be written. We managed without it so far, but 154 149 * we really ought to write it. 155 150 */ 156 - .retrigger = NULL, 151 + .irq_retrigger = NULL, 157 152 }; 158 153 159 154 int show_interrupts(struct seq_file *p, void *v) ··· 188 181 seq_printf(p, "%10u ", kstat_irqs(i)); 189 182 #endif 190 183 191 - seq_printf(p, " %14s", irq_desc[i].chip->name); 184 + seq_printf(p, " %14s", irq_desc[i].irq_data.chip->name); 192 185 #ifndef PARISC_IRQ_CR16_COUNTS 193 186 seq_printf(p, " %s", action->name); 194 187 ··· 240 233 { 241 234 if (irq_desc[irq].action) 242 235 return -EBUSY; 243 - if (irq_desc[irq].chip != &cpu_interrupt_type) 236 + if (get_irq_chip(irq) != &cpu_interrupt_type) 244 237 return -EBUSY; 245 238 246 239 /* for iosapic interrupts */ 247 240 if (type) { 248 241 set_irq_chip_and_handler(irq, type, handle_percpu_irq); 249 242 set_irq_chip_data(irq, data); 250 - cpu_unmask_irq(irq); 243 + __cpu_unmask_irq(irq); 251 244 } 252 245 return 0; 253 246 } ··· 296 289 unsigned long txn_affinity_addr(unsigned int irq, int cpu) 297 290 { 298 291 #ifdef CONFIG_SMP 299 - cpumask_copy(irq_desc[irq].affinity, cpumask_of(cpu)); 292 + struct irq_data *d = irq_get_irq_data(irq); 293 + cpumask_copy(d->affinity, cpumask_of(cpu)); 300 294 #endif 301 295 302 296 return per_cpu(cpu_data, cpu).txn_addr; ··· 341 333 unsigned long eirr_val; 342 334 int irq, cpu = smp_processor_id(); 343 335 #ifdef CONFIG_SMP 336 + struct irq_desc *desc; 344 337 cpumask_t dest; 345 338 #endif 346 339 ··· 355 346 irq = eirr_to_irq(eirr_val); 356 347 357 348 #ifdef CONFIG_SMP 358 - cpumask_copy(&dest, irq_desc[irq].affinity); 359 - if (CHECK_IRQ_PER_CPU(irq_desc[irq].status) && 349 + desc = irq_to_desc(irq); 350 + cpumask_copy(&dest, desc->irq_data.affinity); 351 + if (CHECK_IRQ_PER_CPU(desc->status) && 360 352 !cpu_isset(smp_processor_id(), dest)) { 361 353 int cpu = first_cpu(dest); 362 354
+11 -11
drivers/parisc/dino.c
··· 296 296 .outl = dino_out32 297 297 }; 298 298 299 - static void dino_mask_irq(unsigned int irq) 299 + static void dino_mask_irq(struct irq_data *d) 300 300 { 301 - struct dino_device *dino_dev = get_irq_chip_data(irq); 302 - int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS); 301 + struct dino_device *dino_dev = irq_data_get_irq_chip_data(d); 302 + int local_irq = gsc_find_local_irq(d->irq, dino_dev->global_irq, DINO_LOCAL_IRQS); 303 303 304 - DBG(KERN_WARNING "%s(0x%p, %d)\n", __func__, dino_dev, irq); 304 + DBG(KERN_WARNING "%s(0x%p, %d)\n", __func__, dino_dev, d->irq); 305 305 306 306 /* Clear the matching bit in the IMR register */ 307 307 dino_dev->imr &= ~(DINO_MASK_IRQ(local_irq)); 308 308 __raw_writel(dino_dev->imr, dino_dev->hba.base_addr+DINO_IMR); 309 309 } 310 310 311 - static void dino_unmask_irq(unsigned int irq) 311 + static void dino_unmask_irq(struct irq_data *d) 312 312 { 313 - struct dino_device *dino_dev = get_irq_chip_data(irq); 314 - int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS); 313 + struct dino_device *dino_dev = irq_data_get_irq_chip_data(d); 314 + int local_irq = gsc_find_local_irq(d->irq, dino_dev->global_irq, DINO_LOCAL_IRQS); 315 315 u32 tmp; 316 316 317 - DBG(KERN_WARNING "%s(0x%p, %d)\n", __func__, dino_dev, irq); 317 + DBG(KERN_WARNING "%s(0x%p, %d)\n", __func__, dino_dev, d->irq); 318 318 319 319 /* 320 320 ** clear pending IRQ bits ··· 346 346 } 347 347 348 348 static struct irq_chip dino_interrupt_type = { 349 - .name = "GSC-PCI", 350 - .unmask = dino_unmask_irq, 351 - .mask = dino_mask_irq, 349 + .name = "GSC-PCI", 350 + .irq_unmask = dino_unmask_irq, 351 + .irq_mask = dino_mask_irq, 352 352 }; 353 353 354 354
+7 -5
drivers/parisc/eisa.c
··· 144 144 145 145 146 146 /* called by free irq */ 147 - static void eisa_mask_irq(unsigned int irq) 147 + static void eisa_mask_irq(struct irq_data *d) 148 148 { 149 + unsigned int irq = d->irq; 149 150 unsigned long flags; 150 151 151 152 EISA_DBG("disable irq %d\n", irq); ··· 165 164 } 166 165 167 166 /* called by request irq */ 168 - static void eisa_unmask_irq(unsigned int irq) 167 + static void eisa_unmask_irq(struct irq_data *d) 169 168 { 169 + unsigned int irq = d->irq; 170 170 unsigned long flags; 171 171 EISA_DBG("enable irq %d\n", irq); 172 172 ··· 185 183 } 186 184 187 185 static struct irq_chip eisa_interrupt_type = { 188 - .name = "EISA", 189 - .unmask = eisa_unmask_irq, 190 - .mask = eisa_mask_irq, 186 + .name = "EISA", 187 + .irq_unmask = eisa_unmask_irq, 188 + .irq_mask = eisa_mask_irq, 191 189 }; 192 190 193 191 static irqreturn_t eisa_irq(int wax_irq, void *intr_dev)
+11 -11
drivers/parisc/gsc.c
··· 105 105 return NO_IRQ; 106 106 } 107 107 108 - static void gsc_asic_mask_irq(unsigned int irq) 108 + static void gsc_asic_mask_irq(struct irq_data *d) 109 109 { 110 - struct gsc_asic *irq_dev = get_irq_chip_data(irq); 111 - int local_irq = gsc_find_local_irq(irq, irq_dev->global_irq, 32); 110 + struct gsc_asic *irq_dev = irq_data_get_irq_chip_data(d); 111 + int local_irq = gsc_find_local_irq(d->irq, irq_dev->global_irq, 32); 112 112 u32 imr; 113 113 114 - DEBPRINTK(KERN_DEBUG "%s(%d) %s: IMR 0x%x\n", __func__, irq, 114 + DEBPRINTK(KERN_DEBUG "%s(%d) %s: IMR 0x%x\n", __func__, d->irq, 115 115 irq_dev->name, imr); 116 116 117 117 /* Disable the IRQ line by clearing the bit in the IMR */ ··· 120 120 gsc_writel(imr, irq_dev->hpa + OFFSET_IMR); 121 121 } 122 122 123 - static void gsc_asic_unmask_irq(unsigned int irq) 123 + static void gsc_asic_unmask_irq(struct irq_data *d) 124 124 { 125 - struct gsc_asic *irq_dev = get_irq_chip_data(irq); 126 - int local_irq = gsc_find_local_irq(irq, irq_dev->global_irq, 32); 125 + struct gsc_asic *irq_dev = irq_data_get_irq_chip_data(d); 126 + int local_irq = gsc_find_local_irq(d->irq, irq_dev->global_irq, 32); 127 127 u32 imr; 128 128 129 - DEBPRINTK(KERN_DEBUG "%s(%d) %s: IMR 0x%x\n", __func__, irq, 129 + DEBPRINTK(KERN_DEBUG "%s(%d) %s: IMR 0x%x\n", __func__, d->irq, 130 130 irq_dev->name, imr); 131 131 132 132 /* Enable the IRQ line by setting the bit in the IMR */ ··· 140 140 } 141 141 142 142 static struct irq_chip gsc_asic_interrupt_type = { 143 - .name = "GSC-ASIC", 144 - .unmask = gsc_asic_unmask_irq, 145 - .mask = gsc_asic_mask_irq, 143 + .name = "GSC-ASIC", 144 + .irq_unmask = gsc_asic_unmask_irq, 145 + .irq_mask = gsc_asic_mask_irq, 146 146 }; 147 147 148 148 int gsc_assign_irq(struct irq_chip *type, void *data)
+20 -20
drivers/parisc/iosapic.c
··· 615 615 } 616 616 617 617 618 - static void iosapic_mask_irq(unsigned int irq) 618 + static void iosapic_mask_irq(struct irq_data *d) 619 619 { 620 620 unsigned long flags; 621 - struct vector_info *vi = get_irq_chip_data(irq); 621 + struct vector_info *vi = irq_data_get_irq_chip_data(d); 622 622 u32 d0, d1; 623 623 624 624 spin_lock_irqsave(&iosapic_lock, flags); ··· 628 628 spin_unlock_irqrestore(&iosapic_lock, flags); 629 629 } 630 630 631 - static void iosapic_unmask_irq(unsigned int irq) 631 + static void iosapic_unmask_irq(struct irq_data *d) 632 632 { 633 - struct vector_info *vi = get_irq_chip_data(irq); 633 + struct vector_info *vi = irq_data_get_irq_chip_data(d); 634 634 u32 d0, d1; 635 635 636 636 /* data is initialized by fixup_irq */ ··· 666 666 * enables their IRQ. It can lead to "interesting" race conditions 667 667 * in the driver initialization sequence. 668 668 */ 669 - DBG(KERN_DEBUG "enable_irq(%d): eoi(%p, 0x%x)\n", irq, 669 + DBG(KERN_DEBUG "enable_irq(%d): eoi(%p, 0x%x)\n", d->irq, 670 670 vi->eoi_addr, vi->eoi_data); 671 671 iosapic_eoi(vi->eoi_addr, vi->eoi_data); 672 672 } 673 673 674 - static void iosapic_eoi_irq(unsigned int irq) 674 + static void iosapic_eoi_irq(struct irq_data *d) 675 675 { 676 - struct vector_info *vi = get_irq_chip_data(irq); 676 + struct vector_info *vi = irq_data_get_irq_chip_data(d); 677 677 678 678 iosapic_eoi(vi->eoi_addr, vi->eoi_data); 679 - cpu_eoi_irq(irq); 679 + cpu_eoi_irq(d); 680 680 } 681 681 682 682 #ifdef CONFIG_SMP 683 - static int iosapic_set_affinity_irq(unsigned int irq, 684 - const struct cpumask *dest) 683 + static int iosapic_set_affinity_irq(struct irq_data *d, 684 + const struct cpumask *dest, bool force) 685 685 { 686 - struct vector_info *vi = get_irq_chip_data(irq); 686 + struct vector_info *vi = irq_data_get_irq_chip_data(d); 687 687 u32 d0, d1, dummy_d0; 688 688 unsigned long flags; 689 689 int dest_cpu; 690 690 691 - dest_cpu = cpu_check_affinity(irq, dest); 691 + dest_cpu = cpu_check_affinity(d, dest); 692 692 if (dest_cpu < 0) 693 693 return -1; 694 694 695 - cpumask_copy(irq_desc[irq].affinity, cpumask_of(dest_cpu)); 696 - vi->txn_addr = txn_affinity_addr(irq, dest_cpu); 695 + cpumask_copy(d->affinity, cpumask_of(dest_cpu)); 696 + vi->txn_addr = txn_affinity_addr(d->irq, dest_cpu); 697 697 698 698 spin_lock_irqsave(&iosapic_lock, flags); 699 699 /* d1 contains the destination CPU, so only want to set that ··· 708 708 #endif 709 709 710 710 static struct irq_chip iosapic_interrupt_type = { 711 - .name = "IO-SAPIC-level", 712 - .unmask = iosapic_unmask_irq, 713 - .mask = iosapic_mask_irq, 714 - .ack = cpu_ack_irq, 715 - .eoi = iosapic_eoi_irq, 711 + .name = "IO-SAPIC-level", 712 + .irq_unmask = iosapic_unmask_irq, 713 + .irq_mask = iosapic_mask_irq, 714 + .irq_ack = cpu_ack_irq, 715 + .irq_eoi = iosapic_eoi_irq, 716 716 #ifdef CONFIG_SMP 717 - .set_affinity = iosapic_set_affinity_irq, 717 + .irq_set_affinity = iosapic_set_affinity_irq, 718 718 #endif 719 719 }; 720 720
+7 -5
drivers/parisc/superio.c
··· 286 286 } 287 287 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87560_LIO, superio_init); 288 288 289 - static void superio_mask_irq(unsigned int irq) 289 + static void superio_mask_irq(struct irq_data *d) 290 290 { 291 + unsigned int irq = d->irq; 291 292 u8 r8; 292 293 293 294 if ((irq < 1) || (irq == 2) || (irq > 7)) { ··· 304 303 outb (r8,IC_PIC1+1); 305 304 } 306 305 307 - static void superio_unmask_irq(unsigned int irq) 306 + static void superio_unmask_irq(struct irq_data *d) 308 307 { 308 + unsigned int irq = d->irq; 309 309 u8 r8; 310 310 311 311 if ((irq < 1) || (irq == 2) || (irq > 7)) { ··· 322 320 } 323 321 324 322 static struct irq_chip superio_interrupt_type = { 325 - .name = SUPERIO, 326 - .unmask = superio_unmask_irq, 327 - .mask = superio_mask_irq, 323 + .name = SUPERIO, 324 + .irq_unmask = superio_unmask_irq, 325 + .irq_mask = superio_mask_irq, 328 326 }; 329 327 330 328 #ifdef DEBUG_SUPERIO_INIT