diff options
author | Qais Yousef <qais.yousef@imgtec.com> | 2015-12-08 08:20:25 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-02-25 04:56:58 -0500 |
commit | 2a07870511829977d02609dac6450017b0419ea9 (patch) | |
tree | 337a42ca582cbf070b9d39560416848bb2d5fab0 | |
parent | c98c1822ee13e4501bf48a9e3184fb9a84c149c0 (diff) |
irqchip/mips-gic: Use gic_vpes instead of NR_CPUS
NR_CPUS is set by Kconfig and could be much higher than what actually is in the
system.
gic_vpes should be a true representitives of the number of cpus in the system,
so use it instead.
Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: <jason@lakedaemon.net>
Cc: <marc.zyngier@arm.com>
Cc: <jiang.liu@linux.intel.com>
Cc: <linux-mips@linux-mips.org>
Cc: <lisa.parratt@imgtec.com>
Cc: Qais Yousef <qsyousef@gmail.com>
Link: http://lkml.kernel.org/r/1449580830-23652-15-git-send-email-qais.yousef@imgtec.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | drivers/irqchip/irq-mips-gic.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c index 794fc5949c9f..1fe73a191120 100644 --- a/drivers/irqchip/irq-mips-gic.c +++ b/drivers/irqchip/irq-mips-gic.c | |||
@@ -465,7 +465,7 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *cpumask, | |||
465 | gic_map_to_vpe(irq, mips_cm_vp_id(cpumask_first(&tmp))); | 465 | gic_map_to_vpe(irq, mips_cm_vp_id(cpumask_first(&tmp))); |
466 | 466 | ||
467 | /* Update the pcpu_masks */ | 467 | /* Update the pcpu_masks */ |
468 | for (i = 0; i < NR_CPUS; i++) | 468 | for (i = 0; i < gic_vpes; i++) |
469 | clear_bit(irq, pcpu_masks[i].pcpu_mask); | 469 | clear_bit(irq, pcpu_masks[i].pcpu_mask); |
470 | set_bit(irq, pcpu_masks[cpumask_first(&tmp)].pcpu_mask); | 470 | set_bit(irq, pcpu_masks[cpumask_first(&tmp)].pcpu_mask); |
471 | 471 | ||
@@ -1098,8 +1098,8 @@ static void __init __gic_init(unsigned long gic_base_addr, | |||
1098 | 1098 | ||
1099 | gic_ipi_domain->bus_token = DOMAIN_BUS_IPI; | 1099 | gic_ipi_domain->bus_token = DOMAIN_BUS_IPI; |
1100 | 1100 | ||
1101 | /* Make the last 2 * NR_CPUS available for IPIs */ | 1101 | /* Make the last 2 * gic_vpes available for IPIs */ |
1102 | bitmap_set(ipi_resrv, gic_shared_intrs - 2 * NR_CPUS, 2 * NR_CPUS); | 1102 | bitmap_set(ipi_resrv, gic_shared_intrs - 2 * gic_vpes, 2 * gic_vpes); |
1103 | 1103 | ||
1104 | gic_basic_init(); | 1104 | gic_basic_init(); |
1105 | 1105 | ||