]> git.baikalelectronics.ru Git - kernel.git/commit
irqchip: mips-gic: Use num_possible_cpus() to reserve IPIs
authorPaul Burton <paul.burton@mips.com>
Tue, 31 Oct 2017 16:41:48 +0000 (09:41 -0700)
committerMarc Zyngier <marc.zyngier@arm.com>
Thu, 2 Nov 2017 15:55:47 +0000 (15:55 +0000)
commit8cc8df56a5432b6325605dbafe73d2edc78b901b
treeaddd6badf7f98b1fa49395ddb92e9c14f66f4f96
parente561ce1bdb3a1f05579229437dcf5caeda0dcf7c
irqchip: mips-gic: Use num_possible_cpus() to reserve IPIs

Reserving a number of IPIs based upon the number of VPs reported by the
GIC makes little sense for a few reasons:

 - The kernel may have been configured with NR_CPUS less than the number
   of VPs in the cluster, in which case using gic_vpes causes us to
   reserve more interrupts for IPIs than we will possibly use.

 - If a kernel is configured without support for multi-threading & runs
   on a system with multi-threading & multiple VPs per core then we'll
   similarly reserve more interrupts for IPIs than we will possibly use.

 - In systems with multiple clusters the GIC can only provide us with
   the number of VPs in its cluster, not across all clusters. In this
   case we'll reserve fewer interrupts for IPIs than we need.

Fix these issues by using num_possible_cpus() instead, which in all
cases is actually indicative of how many IPIs we may need.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mips@linux-mips.org
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
drivers/irqchip/irq-mips-gic.c