Skip to content

Commit 2cb3b16

Browse files
Julien GrallMarc Zyngier
authored andcommitted
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 <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent 35ae7df commit 2cb3b16

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/irqchip/irq-ls-scfg-msi.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static void ls_scfg_msi_compose_msg(struct irq_data *data, struct msi_msg *msg)
100100
msg->data |= cpumask_first(mask);
101101
}
102102

103-
iommu_dma_map_msi_msg(data->irq, msg);
103+
iommu_dma_compose_msi_msg(irq_data_get_msi_desc(data), msg);
104104
}
105105

106106
static 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,
141141
unsigned int nr_irqs,
142142
void *args)
143143
{
144+
msi_alloc_info_t *info = args;
144145
struct ls_scfg_msi *msi_data = domain->host_data;
145146
int pos, err = 0;
146147

@@ -154,6 +155,10 @@ static int ls_scfg_msi_domain_irq_alloc(struct irq_domain *domain,
154155
err = -ENOSPC;
155156
spin_unlock(&msi_data->lock);
156157

158+
if (err)
159+
return err;
160+
161+
err = iommu_dma_prepare_msi(info->desc, msi_data->msiir_addr);
157162
if (err)
158163
return err;
159164

0 commit comments

Comments
 (0)