diff mbox series

[1/2] MIPS: SGI-IP27: Fix crash, when CPUs are disabled via nr_cpus parameter

Message ID 20191119110857.28540-1-tbogendoerfer@suse.de (mailing list archive)
State Mainlined
Commit e3d765a941f6130fd94e47b2064cfee71f4cbadd
Delegated to: Paul Burton
Headers show
Series [1/2] MIPS: SGI-IP27: Fix crash, when CPUs are disabled via nr_cpus parameter | expand

Commit Message

Thomas Bogendoerfer Nov. 19, 2019, 11:08 a.m. UTC
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: 69a07a41d908 ("MIPS: SGI-IP27: rework HUB interrupts")
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 arch/mips/sgi-ip27/ip27-irq.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Paul Burton Nov. 22, 2019, 9:54 p.m. UTC | #1
Hello,

Thomas Bogendoerfer wrote:
> 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.

Series applied to mips-next.

> MIPS: SGI-IP27: Fix crash, when CPUs are disabled via nr_cpus parameter
>   commit e3d765a941f6
>   https://git.kernel.org/mips/c/e3d765a941f6
>   
>   Fixes: 69a07a41d908 ("MIPS: SGI-IP27: rework HUB interrupts")
>   Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
>   Signed-off-by: Paul Burton <paulburton@kernel.org>
> 
> MIPS: PCI: remember nasid changed by set interrupt affinity
>   commit 37640adbefd6
>   https://git.kernel.org/mips/c/37640adbefd6
>   
>   Fixes: e6308b6d35ea ("MIPS: SGI-IP27: abstract chipset irq from bridge")
>   Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
>   Signed-off-by: Paul Burton <paulburton@kernel.org>

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paulburton@kernel.org to report it. ]
diff mbox series

Patch

diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c
index 5aef06e28a5b..c72ae330ea93 100644
--- a/arch/mips/sgi-ip27/ip27-irq.c
+++ b/arch/mips/sgi-ip27/ip27-irq.c
@@ -73,6 +73,9 @@  static void setup_hub_mask(struct hub_irq_data *hd, const struct cpumask *mask)
 	int cpu;
 
 	cpu = cpumask_first_and(mask, cpu_online_mask);
+	if (cpu >= nr_cpu_ids)
+		cpu = cpumask_any(cpu_online_mask);
+
 	nasid = cpu_to_node(cpu);
 	hd->cpu = cpu;
 	if (!cputoslice(cpu)) {
@@ -139,6 +142,7 @@  static int hub_domain_alloc(struct irq_domain *domain, unsigned int virq,
 	/* use CPU connected to nearest hub */
 	hub = hub_data(info->nasid);
 	setup_hub_mask(hd, &hub->h_cpus);
+	info->nasid = cpu_to_node(hd->cpu);
 
 	/* Make sure it's not already pending when we connect it. */
 	REMOTE_HUB_CLR_INTR(info->nasid, swlevel);