lkml.org 
[lkml]   [2018]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/7] irqchip/ls-scfg-msi: Fix MSI affinity handling
On 22/06/2018 10:52:49+0100, Marc Zyngier wrote:
> The ls-scfs-msi driver is not dealing with the effective affinity
> as it should. Let's fix that, and make it clear that the effective
> affinity is restricted to a single CPU. Also prevent the driver from
> messing with the internals of the affinity setting infrastructure.
>
> Reported-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

Tested-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

> ---
> drivers/irqchip/irq-ls-scfg-msi.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/irqchip/irq-ls-scfg-msi.c b/drivers/irqchip/irq-ls-scfg-msi.c
> index 1ec3bfe56693..c671b3212010 100644
> --- a/drivers/irqchip/irq-ls-scfg-msi.c
> +++ b/drivers/irqchip/irq-ls-scfg-msi.c
> @@ -93,8 +93,12 @@ static void ls_scfg_msi_compose_msg(struct irq_data *data, struct msi_msg *msg)
> msg->address_lo = lower_32_bits(msi_data->msiir_addr);
> msg->data = data->hwirq;
>
> - if (msi_affinity_flag)
> - msg->data |= cpumask_first(data->common->affinity);
> + if (msi_affinity_flag) {
> + const struct cpumask *mask;
> +
> + mask = irq_data_get_effective_affinity_mask(data);
> + msg->data |= cpumask_first(mask);
> + }
>
> iommu_dma_map_msi_msg(data->irq, msg);
> }
> @@ -121,7 +125,7 @@ static int ls_scfg_msi_set_affinity(struct irq_data *irq_data,
> return -EINVAL;
> }
>
> - cpumask_copy(irq_data->common->affinity, mask);
> + irq_data_update_effective_affinity(irq_data, cpumask_of(cpu));
>
> return IRQ_SET_MASK_OK;
> }
> --
> 2.17.1
>

--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

\
 
 \ /
  Last update: 2018-06-22 13:02    [W:0.282 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site