Skip to content

Commit 2dc0a20

Browse files
sbodomerleLorenzo Pieralisi
authored andcommitted
PCI: iproc: Support multi-MSI only on uniprocessor kernel
The interrupt affinity scheme used by this driver is incompatible with multi-MSI as it implies moving the doorbell address to that of another MSI group. This isn't possible for multi-MSI, as all the MSIs must have the same doorbell address. As such it is restricted to systems with a single CPU. Link: https://lore.kernel.org/r/20210622152630.40842-2-sbodomerle@gmail.com Fixes: fc54bae ("PCI: iproc: Allow allocation of multiple MSIs") Reported-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Sandor Bodo-Merle <sbodomerle@gmail.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Acked-by: Marc Zyngier <maz@kernel.org> Acked-by: Pali Rohár <pali@kernel.org> Acked-by: Ray Jui <ray.jui@broadcom.com>
1 parent e673d69 commit 2dc0a20

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/pci/controller/pcie-iproc-msi.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ static struct irq_chip iproc_msi_irq_chip = {
171171

172172
static struct msi_domain_info iproc_msi_domain_info = {
173173
.flags = MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
174-
MSI_FLAG_MULTI_PCI_MSI | MSI_FLAG_PCI_MSIX,
174+
MSI_FLAG_PCI_MSIX,
175175
.chip = &iproc_msi_irq_chip,
176176
};
177177

@@ -250,6 +250,9 @@ static int iproc_msi_irq_domain_alloc(struct irq_domain *domain,
250250
struct iproc_msi *msi = domain->host_data;
251251
int hwirq, i;
252252

253+
if (msi->nr_cpus > 1 && nr_irqs > 1)
254+
return -EINVAL;
255+
253256
mutex_lock(&msi->bitmap_lock);
254257

255258
/*
@@ -540,6 +543,9 @@ int iproc_msi_init(struct iproc_pcie *pcie, struct device_node *node)
540543
mutex_init(&msi->bitmap_lock);
541544
msi->nr_cpus = num_possible_cpus();
542545

546+
if (msi->nr_cpus == 1)
547+
iproc_msi_domain_info.flags |= MSI_FLAG_MULTI_PCI_MSI;
548+
543549
msi->nr_irqs = of_irq_count(node);
544550
if (!msi->nr_irqs) {
545551
dev_err(pcie->dev, "found no MSI GIC interrupt\n");

0 commit comments

Comments
 (0)