Skip to content

Commit e3d765a

Browse files
Thomas Bogendoerferpaulburton
Thomas Bogendoerfer
authored andcommitted
MIPS: SGI-IP27: Fix crash, when CPUs are disabled via nr_cpus parameter
If number of CPUs are limited by the kernel commandline parameter nr_cpus assignment of interrupts accourding to numa rules might not be possibe. As a fallback use one of the online CPUs as interrupt destination. Fixes: 69a07a4 ("MIPS: SGI-IP27: rework HUB interrupts") Signed-off-by: Thomas Bogendoerfer <[email protected]> Signed-off-by: Paul Burton <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: James Hogan <[email protected]> Cc: [email protected] Cc: [email protected]
1 parent 2bee1b5 commit e3d765a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/mips/sgi-ip27/ip27-irq.c

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ static void setup_hub_mask(struct hub_irq_data *hd, const struct cpumask *mask)
7373
int cpu;
7474

7575
cpu = cpumask_first_and(mask, cpu_online_mask);
76+
if (cpu >= nr_cpu_ids)
77+
cpu = cpumask_any(cpu_online_mask);
78+
7679
nasid = cpu_to_node(cpu);
7780
hd->cpu = cpu;
7881
if (!cputoslice(cpu)) {
@@ -139,6 +142,7 @@ static int hub_domain_alloc(struct irq_domain *domain, unsigned int virq,
139142
/* use CPU connected to nearest hub */
140143
hub = hub_data(info->nasid);
141144
setup_hub_mask(hd, &hub->h_cpus);
145+
info->nasid = cpu_to_node(hd->cpu);
142146

143147
/* Make sure it's not already pending when we connect it. */
144148
REMOTE_HUB_CLR_INTR(info->nasid, swlevel);

0 commit comments

Comments
 (0)