diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-05-07 15:44:16 +0000 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-05-16 14:05:21 +0200 |
commit | b26d851ff1928b56242c4c5e16cb62bac2d9526c (patch) | |
tree | ef1325900428e72bcf4b520f77cba9ab2669fdb3 /arch/tile/kernel | |
parent | 2aa799d891299457e4107d33f07a1ed5ac8849ae (diff) |
tile: Use SPARSE_IRQ
Get rid of the private allocator and switch over to sparse IRQs.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Grant Likely <grant.likely@linaro.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
Link: http://lkml.kernel.org/r/20140507154338.423715783@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/tile/kernel')
-rw-r--r-- | arch/tile/kernel/irq.c | 52 |
1 files changed, 3 insertions, 49 deletions
diff --git a/arch/tile/kernel/irq.c b/arch/tile/kernel/irq.c index 5fd197e0a2d4..637f2ffaa5f5 100644 --- a/arch/tile/kernel/irq.c +++ b/arch/tile/kernel/irq.c @@ -54,13 +54,6 @@ static DEFINE_PER_CPU(unsigned long, irq_disable_mask) */ static DEFINE_PER_CPU(int, irq_depth); -/* State for allocating IRQs on Gx. */ -#if CHIP_HAS_IPI() -static unsigned long available_irqs = ((1UL << NR_IRQS) - 1) & - (~(1UL << IRQ_RESCHEDULE)); -static DEFINE_SPINLOCK(available_irqs_lock); -#endif - #if CHIP_HAS_IPI() /* Use SPRs to manipulate device interrupts. */ #define mask_irqs(irq_mask) __insn_mtspr(SPR_IPI_MASK_SET_K, irq_mask) @@ -278,50 +271,11 @@ int arch_show_interrupts(struct seq_file *p, int prec) return 0; } -/* - * Generic, controller-independent functions: - */ - #if CHIP_HAS_IPI() -int create_irq(void) -{ - unsigned long flags; - int result; - - spin_lock_irqsave(&available_irqs_lock, flags); - if (available_irqs == 0) - result = -ENOMEM; - else { - result = __ffs(available_irqs); - available_irqs &= ~(1UL << result); - dynamic_irq_init(result); - } - spin_unlock_irqrestore(&available_irqs_lock, flags); - - return result; -} -EXPORT_SYMBOL(create_irq); - -void destroy_irq(unsigned int irq) -{ - unsigned long flags; - - spin_lock_irqsave(&available_irqs_lock, flags); - available_irqs |= (1UL << irq); - dynamic_irq_cleanup(irq); - spin_unlock_irqrestore(&available_irqs_lock, flags); -} -EXPORT_SYMBOL(destroy_irq); - -unsigned int irq_alloc_hwirq(int node) -{ - int ret = create_irq(); - return ret < 0 ? 0 : ret; -} - -void irq_free_hwirq(unsigned int irq) +int arch_setup_hwirq(unsigned int irq, int node) { - destroy_irq(irq); + return irq >= NR_IRQS ? -EINVAL : 0; } +void arch_teardown_hwirq(unsigned int irq) { } #endif |