Skip to content

Commit de796fc

Browse files
paliKAGA-KOKO
authored andcommitted
irqchip/armada-370-xp: Only call ipi_resume() if IPI is available
IPI is available only on systems where the mpic controller does not have a parent interrupt defined (e.g. on Armada XP). If a parent interrupt is defined, inter-processor interrupts are handled by an interrupt controller higher in the hierarchy (most probably a parent GIC). Only call ipi_resume() on systems where IPI is available in the mpic controller. Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Marek Behún <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> [ refactored a little and changed commit message ]
1 parent 3cef738 commit de796fc

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

drivers/irqchip/irq-armada-370-xp.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <linux/slab.h>
3030
#include <linux/syscore_ops.h>
3131
#include <linux/msi.h>
32+
#include <linux/types.h>
3233
#include <asm/mach/arch.h>
3334
#include <asm/exception.h>
3435
#include <asm/smp_plat.h>
@@ -156,6 +157,17 @@ static DEFINE_MUTEX(msi_used_lock);
156157
static phys_addr_t msi_doorbell_addr;
157158
#endif
158159

160+
static inline bool is_ipi_available(void)
161+
{
162+
/*
163+
* We distinguish IPI availability in the IC by the IC not having a
164+
* parent irq defined. If a parent irq is defined, there is a parent
165+
* interrupt controller (e.g. GIC) that takes care of inter-processor
166+
* interrupts.
167+
*/
168+
return parent_irq <= 0;
169+
}
170+
159171
static inline bool is_percpu_irq(irq_hw_number_t irq)
160172
{
161173
if (irq <= ARMADA_370_XP_MAX_PER_CPU_IRQS)
@@ -521,7 +533,8 @@ static void armada_xp_mpic_reenable_percpu(void)
521533
armada_370_xp_irq_unmask(data);
522534
}
523535

524-
ipi_resume();
536+
if (is_ipi_available())
537+
ipi_resume();
525538

526539
armada_370_xp_msi_reenable_percpu();
527540
}
@@ -744,7 +757,8 @@ static void armada_370_xp_mpic_resume(void)
744757
if (doorbell_mask_reg & PCI_MSI_DOORBELL_MASK)
745758
writel(1, per_cpu_int_base + ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
746759

747-
ipi_resume();
760+
if (is_ipi_available())
761+
ipi_resume();
748762
}
749763

750764
static struct syscore_ops armada_370_xp_mpic_syscore_ops = {

0 commit comments

Comments
 (0)