Skip to content

Commit

Permalink
irqchip/loongson-eiointc: Fix irq affinity setting
Browse files Browse the repository at this point in the history
In multi-node case, csr_any_send() should set EIOINTC_REG_ENABLE of
the first core of target node, not the first core of the whole.

Signed-off-by: Huacai Chen <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
chenhuacai authored and Marc Zyngier committed Aug 4, 2022
1 parent b0a4ab7 commit e260cfe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/irqchip/irq-loongson-eiointc.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,15 @@ static int eiointc_set_irq_affinity(struct irq_data *d, const struct cpumask *af
regaddr = EIOINTC_REG_ENABLE + ((vector >> 5) << 2);

/* Mask target vector */
csr_any_send(regaddr, EIOINTC_ALL_ENABLE & (~BIT(vector & 0x1F)), 0x0, 0);
csr_any_send(regaddr, EIOINTC_ALL_ENABLE & (~BIT(vector & 0x1F)),
0x0, priv->node * CORES_PER_EIO_NODE);

/* Set route for target vector */
eiointc_set_irq_route(vector, cpu, priv->node, &priv->node_map);

/* Unmask target vector */
csr_any_send(regaddr, EIOINTC_ALL_ENABLE, 0x0, 0);
csr_any_send(regaddr, EIOINTC_ALL_ENABLE,
0x0, priv->node * CORES_PER_EIO_NODE);

irq_data_update_effective_affinity(d, cpumask_of(cpu));

Expand Down

0 comments on commit e260cfe

Please sign in to comment.