|
@@ -2310,7 +2310,14 @@ static int its_irq_domain_activate(struct irq_domain *domain,
|
|
cpu_mask = cpumask_of_node(its_dev->its->numa_node);
|
|
cpu_mask = cpumask_of_node(its_dev->its->numa_node);
|
|
|
|
|
|
/* Bind the LPI to the first possible CPU */
|
|
/* Bind the LPI to the first possible CPU */
|
|
- cpu = cpumask_first(cpu_mask);
|
|
|
|
|
|
+ cpu = cpumask_first_and(cpu_mask, cpu_online_mask);
|
|
|
|
+ if (cpu >= nr_cpu_ids) {
|
|
|
|
+ if (its_dev->its->flags & ITS_FLAGS_WORKAROUND_CAVIUM_23144)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
|
|
+ cpu = cpumask_first(cpu_online_mask);
|
|
|
|
+ }
|
|
|
|
+
|
|
its_dev->event_map.col_map[event] = cpu;
|
|
its_dev->event_map.col_map[event] = cpu;
|
|
irq_data_update_effective_affinity(d, cpumask_of(cpu));
|
|
irq_data_update_effective_affinity(d, cpumask_of(cpu));
|
|
|
|
|