Skip to content

Commit

Permalink
PCI: iproc: Set affinity mask on MSI interrupts
Browse files Browse the repository at this point in the history
[ Upstream commit eb7eaca ]

The core interrupt code expects the irq_set_affinity call to update the
effective affinity for the interrupt. This was not being done, so update
iproc_msi_irq_set_affinity() to do so.

Link: https://lore.kernel.org/r/20200803035241.7737-1-mark.tomlinson@alliedtelesis.co.nz
Fixes: 3bc2b23 ("PCI: iproc: Add iProc PCIe MSI support")
Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Mark Tomlinson authored and gregkh committed Oct 29, 2020
1 parent bcb9394 commit 833f3c3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions drivers/pci/controller/pcie-iproc-msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,20 @@ static int iproc_msi_irq_set_affinity(struct irq_data *data,
struct iproc_msi *msi = irq_data_get_irq_chip_data(data);
int target_cpu = cpumask_first(mask);
int curr_cpu;
int ret;

curr_cpu = hwirq_to_cpu(msi, data->hwirq);
if (curr_cpu == target_cpu)
return IRQ_SET_MASK_OK_DONE;
ret = IRQ_SET_MASK_OK_DONE;
else {
/* steer MSI to the target CPU */
data->hwirq = hwirq_to_canonical_hwirq(msi, data->hwirq) + target_cpu;
ret = IRQ_SET_MASK_OK;
}

/* steer MSI to the target CPU */
data->hwirq = hwirq_to_canonical_hwirq(msi, data->hwirq) + target_cpu;
irq_data_update_effective_affinity(data, cpumask_of(target_cpu));

return IRQ_SET_MASK_OK;
return ret;
}

static void iproc_msi_irq_compose_msi_msg(struct irq_data *data,
Expand Down

0 comments on commit 833f3c3

Please sign in to comment.