aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>2015-03-03 05:43:14 -0500
committerJason Cooper <jason@lakedaemon.net>2015-03-08 00:21:33 -0500
commit933a24b06b42617ef9fffece1857c5c4b23329aa (patch)
tree5461b7903616c587e0bdaf4b8af941b0dec6a915
parent5724be8464dceac047c1eaddaa3651cea0ec16ca (diff)
irqchip: armada-370-xp: Initialize per cpu registers when CONFIG_SMP=N
The irqchip driver called armada_xp_mpic_smp_cpu_init() when CONFIG_SMP=Y to initialize some per cpu registers. The function is called on each CPU by calling it explicitly on the boot CPU and then using a CPU notifier for the non boot CPUs. This commit removes the CONFIG_SMP constrain, so the per cpu registers are also initialized when CONFIG_SMP=N, which is the right thing to do. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Link: https://lkml.kernel.org/r/1425379400-4346-2-git-send-email-maxime.ripard@free-electrons.com Signed-off-by: Jason Cooper <jason@lakedaemon.net>
-rw-r--r--drivers/irqchip/irq-armada-370-xp.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index 4387dae14e45..b455c876974e 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -308,28 +308,6 @@ static int armada_370_xp_mpic_irq_map(struct irq_domain *h,
308 return 0; 308 return 0;
309} 309}
310 310
311#ifdef CONFIG_SMP
312static void armada_mpic_send_doorbell(const struct cpumask *mask,
313 unsigned int irq)
314{
315 int cpu;
316 unsigned long map = 0;
317
318 /* Convert our logical CPU mask into a physical one. */
319 for_each_cpu(cpu, mask)
320 map |= 1 << cpu_logical_map(cpu);
321
322 /*
323 * Ensure that stores to Normal memory are visible to the
324 * other CPUs before issuing the IPI.
325 */
326 dsb();
327
328 /* submit softirq */
329 writel((map << 8) | irq, main_int_base +
330 ARMADA_370_XP_SW_TRIG_INT_OFFS);
331}
332
333static void armada_xp_mpic_smp_cpu_init(void) 311static void armada_xp_mpic_smp_cpu_init(void)
334{ 312{
335 u32 control; 313 u32 control;
@@ -352,6 +330,28 @@ static void armada_xp_mpic_smp_cpu_init(void)
352 writel(0, per_cpu_int_base + ARMADA_370_XP_INT_CLEAR_MASK_OFFS); 330 writel(0, per_cpu_int_base + ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
353} 331}
354 332
333#ifdef CONFIG_SMP
334static void armada_mpic_send_doorbell(const struct cpumask *mask,
335 unsigned int irq)
336{
337 int cpu;
338 unsigned long map = 0;
339
340 /* Convert our logical CPU mask into a physical one. */
341 for_each_cpu(cpu, mask)
342 map |= 1 << cpu_logical_map(cpu);
343
344 /*
345 * Ensure that stores to Normal memory are visible to the
346 * other CPUs before issuing the IPI.
347 */
348 dsb();
349
350 /* submit softirq */
351 writel((map << 8) | irq, main_int_base +
352 ARMADA_370_XP_SW_TRIG_INT_OFFS);
353}
354
355static int armada_xp_mpic_secondary_init(struct notifier_block *nfb, 355static int armada_xp_mpic_secondary_init(struct notifier_block *nfb,
356 unsigned long action, void *hcpu) 356 unsigned long action, void *hcpu)
357{ 357{
@@ -588,9 +588,8 @@ static int __init armada_370_xp_mpic_of_init(struct device_node *node,
588 588
589 BUG_ON(!armada_370_xp_mpic_domain); 589 BUG_ON(!armada_370_xp_mpic_domain);
590 590
591#ifdef CONFIG_SMP 591 /* Setup for the boot CPU */
592 armada_xp_mpic_smp_cpu_init(); 592 armada_xp_mpic_smp_cpu_init();
593#endif
594 593
595 armada_370_xp_msi_init(node, main_int_res.start); 594 armada_370_xp_msi_init(node, main_int_res.start);
596 595