diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2012-03-30 14:47:04 -0400 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2012-05-07 08:34:59 -0400 |
commit | 9d619f65722236e0e0c35467d1528caed206e439 (patch) | |
tree | 6d0a77b7835fc056810a05be5a217e96d9153ff7 /drivers/iommu | |
parent | 4c1bad6a0af1e297c8d05365e65af89d8c7bf9d1 (diff) |
iommu/vt-d: Convert free_irte into a remap_ops callback
The operation for releasing a remapping entry is iommu
specific too.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/intel_intr_remapping.c | 3 | ||||
-rw-r--r-- | drivers/iommu/intr_remapping.c | 8 | ||||
-rw-r--r-- | drivers/iommu/intr_remapping.h | 3 |
3 files changed, 13 insertions, 1 deletions
diff --git a/drivers/iommu/intel_intr_remapping.c b/drivers/iommu/intel_intr_remapping.c index 25372c1f3c8c..44a6e04a070b 100644 --- a/drivers/iommu/intel_intr_remapping.c +++ b/drivers/iommu/intel_intr_remapping.c | |||
@@ -253,7 +253,7 @@ static int clear_entries(struct irq_2_iommu *irq_iommu) | |||
253 | return qi_flush_iec(iommu, index, irq_iommu->irte_mask); | 253 | return qi_flush_iec(iommu, index, irq_iommu->irte_mask); |
254 | } | 254 | } |
255 | 255 | ||
256 | int free_irte(int irq) | 256 | static int free_irte(int irq) |
257 | { | 257 | { |
258 | struct irq_2_iommu *irq_iommu = irq_2_iommu(irq); | 258 | struct irq_2_iommu *irq_iommu = irq_2_iommu(irq); |
259 | unsigned long flags; | 259 | unsigned long flags; |
@@ -964,4 +964,5 @@ struct irq_remap_ops intel_irq_remap_ops = { | |||
964 | .enable_faulting = enable_drhd_fault_handling, | 964 | .enable_faulting = enable_drhd_fault_handling, |
965 | .setup_ioapic_entry = intel_setup_ioapic_entry, | 965 | .setup_ioapic_entry = intel_setup_ioapic_entry, |
966 | .set_affinity = intel_ioapic_set_affinity, | 966 | .set_affinity = intel_ioapic_set_affinity, |
967 | .free_irq = free_irte, | ||
967 | }; | 968 | }; |
diff --git a/drivers/iommu/intr_remapping.c b/drivers/iommu/intr_remapping.c index 2f4f27ffb861..a68d304f9729 100644 --- a/drivers/iommu/intr_remapping.c +++ b/drivers/iommu/intr_remapping.c | |||
@@ -119,3 +119,11 @@ int intr_set_affinity(struct irq_data *data, const struct cpumask *mask, | |||
119 | 119 | ||
120 | return remap_ops->set_affinity(data, mask, force); | 120 | return remap_ops->set_affinity(data, mask, force); |
121 | } | 121 | } |
122 | |||
123 | void intr_free_irq(int irq) | ||
124 | { | ||
125 | if (!remap_ops || !remap_ops->free_irq) | ||
126 | return; | ||
127 | |||
128 | remap_ops->free_irq(irq); | ||
129 | } | ||
diff --git a/drivers/iommu/intr_remapping.h b/drivers/iommu/intr_remapping.h index e0bc6e0ba1fb..57485539383d 100644 --- a/drivers/iommu/intr_remapping.h +++ b/drivers/iommu/intr_remapping.h | |||
@@ -60,6 +60,9 @@ struct irq_remap_ops { | |||
60 | /* Set the CPU affinity of a remapped interrupt */ | 60 | /* Set the CPU affinity of a remapped interrupt */ |
61 | int (*set_affinity)(struct irq_data *data, const struct cpumask *mask, | 61 | int (*set_affinity)(struct irq_data *data, const struct cpumask *mask, |
62 | bool force); | 62 | bool force); |
63 | |||
64 | /* Free an IRQ */ | ||
65 | int (*free_irq)(int); | ||
63 | }; | 66 | }; |
64 | 67 | ||
65 | extern struct irq_remap_ops intel_irq_remap_ops; | 68 | extern struct irq_remap_ops intel_irq_remap_ops; |