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

powerpc: Convert irq_domain_add_legacy_isa use to irq_domain_add_legacy

irq_domain_add_legacy_isa is a pain. It only exists for the benefit of
two PPC-specific drivers, and creates an ugly dependency between asm/irq.h
and linux/irqdomain.h

Instead, let's convert these two drivers to irq_domain_add_legacy(),
stop using NUM_ISA_INTERRUPTS by directly setting NR_IRQS_LEGACY.

The dependency cannot be broken yet as there is a lot of PPC-related
code that depends on it, but that's the first step towards it.

A followup patch will remove irq_domain_add_legacy_isa.

Signed-off-by: Marc Zyngier <maz@kernel.org>

+10 -8
+2 -2
arch/powerpc/include/asm/irq.h
··· 23 23 /* Total number of virq in the platform */ 24 24 #define NR_IRQS CONFIG_NR_IRQS 25 25 26 - /* Same thing, used by the generic IRQ code */ 27 - #define NR_IRQS_LEGACY NUM_ISA_INTERRUPTS 26 + /* Number of irqs reserved for a legacy isa controller */ 27 + #define NR_IRQS_LEGACY 16 28 28 29 29 extern irq_hw_number_t virq_to_hw(unsigned int virq); 30 30
+2 -2
arch/powerpc/platforms/ps3/interrupt.c
··· 46 46 * implementation equates HV plug value to Linux virq value, constrains each 47 47 * interrupt to have a system wide unique plug number, and limits the range 48 48 * of the plug values to map into the first dword of the bitmaps. This 49 - * gives a usable range of plug values of {NUM_ISA_INTERRUPTS..63}. Note 49 + * gives a usable range of plug values of {NR_IRQS_LEGACY..63}. Note 50 50 * that there is no constraint on how many in this set an individual thread 51 51 * can acquire. 52 52 * ··· 722 722 } 723 723 724 724 #if defined(DEBUG) 725 - if (unlikely(plug < NUM_ISA_INTERRUPTS || plug > PS3_PLUG_MAX)) { 725 + if (unlikely(plug < NR_IRQS_LEGACY || plug > PS3_PLUG_MAX)) { 726 726 dump_bmp(&per_cpu(ps3_private, 0)); 727 727 dump_bmp(&per_cpu(ps3_private, 1)); 728 728 BUG();
+2 -1
arch/powerpc/sysdev/i8259.c
··· 260 260 raw_spin_unlock_irqrestore(&i8259_lock, flags); 261 261 262 262 /* create a legacy host */ 263 - i8259_host = irq_domain_add_legacy_isa(node, &i8259_host_ops, NULL); 263 + i8259_host = irq_domain_add_legacy(node, NR_IRQS_LEGACY, 0, 0, 264 + &i8259_host_ops, NULL); 264 265 if (i8259_host == NULL) { 265 266 printk(KERN_ERR "i8259: failed to allocate irq host !\n"); 266 267 return;
+1 -1
arch/powerpc/sysdev/mpic.c
··· 602 602 /* Find an mpic associated with a given linux interrupt */ 603 603 static struct mpic *mpic_find(unsigned int irq) 604 604 { 605 - if (irq < NUM_ISA_INTERRUPTS) 605 + if (irq < NR_IRQS_LEGACY) 606 606 return NULL; 607 607 608 608 return irq_get_chip_data(irq);
+2 -1
arch/powerpc/sysdev/tsi108_pci.c
··· 404 404 { 405 405 DBG("Tsi108_pci_int_init: initializing PCI interrupts\n"); 406 406 407 - pci_irq_host = irq_domain_add_legacy_isa(node, &pci_irq_domain_ops, NULL); 407 + pci_irq_host = irq_domain_add_legacy(node, NR_IRQS_LEGACY, 0, 0, 408 + &pci_irq_domain_ops, NULL); 408 409 if (pci_irq_host == NULL) { 409 410 printk(KERN_ERR "pci_irq_host: failed to allocate irq domain!\n"); 410 411 return;
+1 -1
arch/powerpc/sysdev/xics/xics-common.c
··· 201 201 struct ics *ics; 202 202 203 203 /* We can't set affinity on ISA interrupts */ 204 - if (virq < NUM_ISA_INTERRUPTS) 204 + if (virq < NR_IRQS_LEGACY) 205 205 continue; 206 206 /* We only need to migrate enabled IRQS */ 207 207 if (!desc->action)