Skip to content

Commit 9d80f6b

Browse files
paliKAGA-KOKO
authored andcommitted
irqchip/armada-370-xp: Do not touch IPI registers on platforms without IPI
On platforms where IPI is not available in the MPIC, the IPI registers instead represent an additional set of MSI interrupt registers (currently unused by the driver). Do not touch these registers on platforms where IPI is not available in the MPIC. [ Marek: refactored, changed commit message ] 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]>
1 parent de796fc commit 9d80f6b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,9 @@ static void armada_xp_mpic_smp_cpu_init(void)
502502
for (i = 0; i < nr_irqs; i++)
503503
writel(i, per_cpu_int_base + ARMADA_370_XP_INT_SET_MASK_OFFS);
504504

505+
if (!is_ipi_available())
506+
return;
507+
505508
/* Disable all IPIs */
506509
writel(0, per_cpu_int_base + ARMADA_370_XP_IN_DRBEL_MSK_OFFS);
507510

@@ -752,7 +755,7 @@ static void armada_370_xp_mpic_resume(void)
752755
/* Reconfigure doorbells for IPIs and MSIs */
753756
writel(doorbell_mask_reg,
754757
per_cpu_int_base + ARMADA_370_XP_IN_DRBEL_MSK_OFFS);
755-
if (doorbell_mask_reg & IPI_DOORBELL_MASK)
758+
if (is_ipi_available() && (doorbell_mask_reg & IPI_DOORBELL_MASK))
756759
writel(0, per_cpu_int_base + ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
757760
if (doorbell_mask_reg & PCI_MSI_DOORBELL_MASK)
758761
writel(1, per_cpu_int_base + ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
@@ -803,13 +806,18 @@ static int __init armada_370_xp_mpic_of_init(struct device_node *node,
803806
BUG_ON(!armada_370_xp_mpic_domain);
804807
irq_domain_update_bus_token(armada_370_xp_mpic_domain, DOMAIN_BUS_WIRED);
805808

809+
/*
810+
* Initialize parent_irq before calling any other functions, since it is
811+
* used to distinguish between IPI and non-IPI platforms.
812+
*/
813+
parent_irq = irq_of_parse_and_map(node, 0);
814+
806815
/* Setup for the boot CPU */
807816
armada_xp_mpic_perf_init();
808817
armada_xp_mpic_smp_cpu_init();
809818

810819
armada_370_xp_msi_init(node, main_int_res.start);
811820

812-
parent_irq = irq_of_parse_and_map(node, 0);
813821
if (parent_irq <= 0) {
814822
irq_set_default_host(armada_370_xp_mpic_domain);
815823
set_handle_irq(armada_370_xp_handle_irq);

0 commit comments

Comments
 (0)