|
29 | 29 | #include <linux/slab.h>
|
30 | 30 | #include <linux/syscore_ops.h>
|
31 | 31 | #include <linux/msi.h>
|
| 32 | +#include <linux/types.h> |
32 | 33 | #include <asm/mach/arch.h>
|
33 | 34 | #include <asm/exception.h>
|
34 | 35 | #include <asm/smp_plat.h>
|
@@ -156,6 +157,17 @@ static DEFINE_MUTEX(msi_used_lock);
|
156 | 157 | static phys_addr_t msi_doorbell_addr;
|
157 | 158 | #endif
|
158 | 159 |
|
| 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 | + |
159 | 171 | static inline bool is_percpu_irq(irq_hw_number_t irq)
|
160 | 172 | {
|
161 | 173 | if (irq <= ARMADA_370_XP_MAX_PER_CPU_IRQS)
|
@@ -521,7 +533,8 @@ static void armada_xp_mpic_reenable_percpu(void)
|
521 | 533 | armada_370_xp_irq_unmask(data);
|
522 | 534 | }
|
523 | 535 |
|
524 |
| - ipi_resume(); |
| 536 | + if (is_ipi_available()) |
| 537 | + ipi_resume(); |
525 | 538 |
|
526 | 539 | armada_370_xp_msi_reenable_percpu();
|
527 | 540 | }
|
@@ -744,7 +757,8 @@ static void armada_370_xp_mpic_resume(void)
|
744 | 757 | if (doorbell_mask_reg & PCI_MSI_DOORBELL_MASK)
|
745 | 758 | writel(1, per_cpu_int_base + ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
|
746 | 759 |
|
747 |
| - ipi_resume(); |
| 760 | + if (is_ipi_available()) |
| 761 | + ipi_resume(); |
748 | 762 | }
|
749 | 763 |
|
750 | 764 | static struct syscore_ops armada_370_xp_mpic_syscore_ops = {
|
|
0 commit comments