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

iommu: dmar: Provide arch specific irq allocation

ia64 and x86 share this driver. x86 is moving to a different irq
allocation and ia64 keeps its private irq_create/destroy stuff.

Use macros to redirect to one or the other. Yes, macros to avoid
include hell.

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>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Acked-by: Joerg Roedel <joro@8bytes.org>
Cc: x86@kernel.org
Cc: linux-ia64@vger.kernel.org
Cc: iommu@lists.linux-foundation.org
Link: http://lkml.kernel.org/r/20140507154336.372289825@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

+8 -3
+2
arch/ia64/include/asm/irq_remapping.h
··· 1 1 #ifndef __IA64_INTR_REMAPPING_H 2 2 #define __IA64_INTR_REMAPPING_H 3 3 #define irq_remapping_enabled 0 4 + #define dmar_alloc_hwirq create_irq 5 + #define dmar_free_hwirq destroy_irq 4 6 #endif
+3
arch/x86/include/asm/irq_remapping.h
··· 103 103 } 104 104 #endif /* CONFIG_IRQ_REMAP */ 105 105 106 + #define dmar_alloc_hwirq() irq_alloc_hwirq(-1) 107 + #define dmar_free_hwirq irq_free_hwirq 108 + 106 109 #endif /* __X86_IRQ_REMAPPING_H */
+3 -3
drivers/iommu/dmar.c
··· 994 994 if (iommu->irq) { 995 995 free_irq(iommu->irq, iommu); 996 996 irq_set_handler_data(iommu->irq, NULL); 997 - destroy_irq(iommu->irq); 997 + dmar_free_hwirq(iommu->irq); 998 998 } 999 999 1000 1000 if (iommu->qi) { ··· 1550 1550 if (iommu->irq) 1551 1551 return 0; 1552 1552 1553 - irq = create_irq(); 1553 + irq = dmar_alloc_hwirq(); 1554 1554 if (irq <= 0) { 1555 1555 pr_err("IOMMU: no free vectors\n"); 1556 1556 return -EINVAL; ··· 1563 1563 if (ret) { 1564 1564 irq_set_handler_data(irq, NULL); 1565 1565 iommu->irq = 0; 1566 - destroy_irq(irq); 1566 + dmar_free_hwirq(irq); 1567 1567 return ret; 1568 1568 } 1569 1569