Commit a553b142 authored by Thomas Gleixner's avatar Thomas Gleixner

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: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarGrant 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: default avatarJoerg 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.deSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent aa5125a4
#ifndef __IA64_INTR_REMAPPING_H #ifndef __IA64_INTR_REMAPPING_H
#define __IA64_INTR_REMAPPING_H #define __IA64_INTR_REMAPPING_H
#define irq_remapping_enabled 0 #define irq_remapping_enabled 0
#define dmar_alloc_hwirq create_irq
#define dmar_free_hwirq destroy_irq
#endif #endif
...@@ -103,4 +103,7 @@ static inline bool setup_remapped_irq(int irq, ...@@ -103,4 +103,7 @@ static inline bool setup_remapped_irq(int irq,
} }
#endif /* CONFIG_IRQ_REMAP */ #endif /* CONFIG_IRQ_REMAP */
#define dmar_alloc_hwirq() irq_alloc_hwirq(-1)
#define dmar_free_hwirq irq_free_hwirq
#endif /* __X86_IRQ_REMAPPING_H */ #endif /* __X86_IRQ_REMAPPING_H */
...@@ -994,7 +994,7 @@ static void free_iommu(struct intel_iommu *iommu) ...@@ -994,7 +994,7 @@ static void free_iommu(struct intel_iommu *iommu)
if (iommu->irq) { if (iommu->irq) {
free_irq(iommu->irq, iommu); free_irq(iommu->irq, iommu);
irq_set_handler_data(iommu->irq, NULL); irq_set_handler_data(iommu->irq, NULL);
destroy_irq(iommu->irq); dmar_free_hwirq(iommu->irq);
} }
if (iommu->qi) { if (iommu->qi) {
...@@ -1550,7 +1550,7 @@ int dmar_set_interrupt(struct intel_iommu *iommu) ...@@ -1550,7 +1550,7 @@ int dmar_set_interrupt(struct intel_iommu *iommu)
if (iommu->irq) if (iommu->irq)
return 0; return 0;
irq = create_irq(); irq = dmar_alloc_hwirq();
if (irq <= 0) { if (irq <= 0) {
pr_err("IOMMU: no free vectors\n"); pr_err("IOMMU: no free vectors\n");
return -EINVAL; return -EINVAL;
...@@ -1563,7 +1563,7 @@ int dmar_set_interrupt(struct intel_iommu *iommu) ...@@ -1563,7 +1563,7 @@ int dmar_set_interrupt(struct intel_iommu *iommu)
if (ret) { if (ret) {
irq_set_handler_data(irq, NULL); irq_set_handler_data(irq, NULL);
iommu->irq = 0; iommu->irq = 0;
destroy_irq(irq); dmar_free_hwirq(irq);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment