aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Grall <julien.grall@arm.com>2019-05-01 09:58:22 -0400
committerMarc Zyngier <marc.zyngier@arm.com>2019-05-03 10:20:20 -0400
commit2cb3b16545495ee31dc9438f88232c2cfe44a41f (patch)
tree1641d13f22231ed16318af8e0fc5eb4b71696598
parent35ae7df21be098848722f96f0f33bf33467436a8 (diff)
irqchip/ls-scfg-msi: Don't map the MSI page in ls_scfg_msi_compose_msg()
ls_scfg_msi_compose_msg() may be called from non-preemptible context. However, on RT, iommu_dma_map_msi_msg() requires to be called from a preemptible context. A recent patch split iommu_dma_map_msi_msg() in two new functions: one that should be called in preemptible context, the other does not have any requirement. The FreeScale SCFG MSI driver is reworked to avoid executing preemptible code in non-preemptible context. This can be achieved by preparing the MSI maping when allocating the MSI interrupt. Signed-off-by: Julien Grall <julien.grall@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r--drivers/irqchip/irq-ls-scfg-msi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/irqchip/irq-ls-scfg-msi.c b/drivers/irqchip/irq-ls-scfg-msi.c
index c671b3212010..669d29105772 100644
--- a/drivers/irqchip/irq-ls-scfg-msi.c
+++ b/drivers/irqchip/irq-ls-scfg-msi.c
@@ -100,7 +100,7 @@ static void ls_scfg_msi_compose_msg(struct irq_data *data, struct msi_msg *msg)
100 msg->data |= cpumask_first(mask); 100 msg->data |= cpumask_first(mask);
101 } 101 }
102 102
103 iommu_dma_map_msi_msg(data->irq, msg); 103 iommu_dma_compose_msi_msg(irq_data_get_msi_desc(data), msg);
104} 104}
105 105
106static int ls_scfg_msi_set_affinity(struct irq_data *irq_data, 106static int ls_scfg_msi_set_affinity(struct irq_data *irq_data,
@@ -141,6 +141,7 @@ static int ls_scfg_msi_domain_irq_alloc(struct irq_domain *domain,
141 unsigned int nr_irqs, 141 unsigned int nr_irqs,
142 void *args) 142 void *args)
143{ 143{
144 msi_alloc_info_t *info = args;
144 struct ls_scfg_msi *msi_data = domain->host_data; 145 struct ls_scfg_msi *msi_data = domain->host_data;
145 int pos, err = 0; 146 int pos, err = 0;
146 147
@@ -157,6 +158,10 @@ static int ls_scfg_msi_domain_irq_alloc(struct irq_domain *domain,
157 if (err) 158 if (err)
158 return err; 159 return err;
159 160
161 err = iommu_dma_prepare_msi(info->desc, msi_data->msiir_addr);
162 if (err)
163 return err;
164
160 irq_domain_set_info(domain, virq, pos, 165 irq_domain_set_info(domain, virq, pos,
161 &ls_scfg_msi_parent_chip, msi_data, 166 &ls_scfg_msi_parent_chip, msi_data,
162 handle_simple_irq, NULL, NULL); 167 handle_simple_irq, NULL, NULL);