summaryrefslogtreecommitdiffstats
path: root/drivers/irqchip/irq-gic-v2m.c
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2016-09-12 12:13:59 -0400
committerWill Deacon <will.deacon@arm.com>2016-09-16 04:34:22 -0400
commit44bb7e243bd4b4e5c79de2452cd9762582f58925 (patch)
treebf0d949ec860769d523d512dc26b20c9ce26e945 /drivers/irqchip/irq-gic-v2m.c
parent455eb7d34ad11b09490f70c33973f9f3e31c4df6 (diff)
iommu/dma: Add support for mapping MSIs
When an MSI doorbell is located downstream of an IOMMU, attaching devices to a DMA ops domain and switching on translation leads to a rude shock when their attempt to write to the physical address returned by the irqchip driver faults (or worse, writes into some already-mapped buffer) and no interrupt is forthcoming. Address this by adding a hook for relevant irqchip drivers to call from their compose_msi_msg() callback, to swizzle the physical address with an appropriatly-mapped IOVA for any device attached to one of our DMA ops domains. Acked-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/irqchip/irq-gic-v2m.c')
-rw-r--r--drivers/irqchip/irq-gic-v2m.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/irqchip/irq-gic-v2m.c b/drivers/irqchip/irq-gic-v2m.c
index 35eb7ac5d21f..863e073c6f7f 100644
--- a/drivers/irqchip/irq-gic-v2m.c
+++ b/drivers/irqchip/irq-gic-v2m.c
@@ -16,6 +16,7 @@
16#define pr_fmt(fmt) "GICv2m: " fmt 16#define pr_fmt(fmt) "GICv2m: " fmt
17 17
18#include <linux/acpi.h> 18#include <linux/acpi.h>
19#include <linux/dma-iommu.h>
19#include <linux/irq.h> 20#include <linux/irq.h>
20#include <linux/irqdomain.h> 21#include <linux/irqdomain.h>
21#include <linux/kernel.h> 22#include <linux/kernel.h>
@@ -108,6 +109,8 @@ static void gicv2m_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
108 109
109 if (v2m->flags & GICV2M_NEEDS_SPI_OFFSET) 110 if (v2m->flags & GICV2M_NEEDS_SPI_OFFSET)
110 msg->data -= v2m->spi_offset; 111 msg->data -= v2m->spi_offset;
112
113 iommu_dma_map_msi_msg(data->irq, msg);
111} 114}
112 115
113static struct irq_chip gicv2m_irq_chip = { 116static struct irq_chip gicv2m_irq_chip = {