Skip to content

Commit 47aaee0

Browse files
committed
ARCv2: SMP: intc: support irq affinity
With this nsim standlone / OSCI have working irq affinity - AXS103 still needs some work as IDU is not visible in intc hierarchy yet ! Signed-off-by: Vineet Gupta <[email protected]>
1 parent 5b9a086 commit 47aaee0

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

arch/arc/kernel/mcip.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,27 @@ static void idu_irq_unmask(struct irq_data *data)
215215
raw_spin_unlock_irqrestore(&mcip_lock, flags);
216216
}
217217

218-
int idu_irq_set_affinity(struct irq_data *d, const struct cpumask *cpumask,
219-
bool force)
218+
#ifdef CONFIG_SMP
219+
int idu_irq_set_affinity(struct irq_data *data, const struct cpumask *cpumask,
220+
bool force)
220221
{
222+
unsigned long flags;
223+
cpumask_t online;
224+
225+
/* errout if no online cpu per @cpumask */
226+
if (!cpumask_and(&online, cpumask, cpu_online_mask))
227+
return -EINVAL;
228+
229+
raw_spin_lock_irqsave(&mcip_lock, flags);
230+
231+
idu_set_dest(data->hwirq, cpumask_bits(&online)[0]);
232+
idu_set_mode(data->hwirq, IDU_M_TRIG_LEVEL, IDU_M_DISTRI_RR);
233+
234+
raw_spin_unlock_irqrestore(&mcip_lock, flags);
235+
221236
return IRQ_SET_MASK_OK;
222237
}
238+
#endif
223239

224240
static struct irq_chip idu_irq_chip = {
225241
.name = "MCIP IDU Intc",

0 commit comments

Comments
 (0)