LF-2438 arm64: kernel: smp: Add workaround for i.MX8MQ ERR11171
authorAbel Vesa <abel.vesa@nxp.com>
Thu, 8 Oct 2020 10:51:31 +0000 (13:51 +0300)
committerDong Aisheng <aisheng.dong@nxp.com>
Mon, 14 Dec 2020 02:34:24 +0000 (10:34 +0800)
Since commit 5cebfd2d47c214 "arm64: Kill __smp_cross_call and co",
the workaround for ERR11171 for i.MX8MQ needs a different approach.
In order to do go to EL3 to power up/down the cores, right after
the ipi was raised, we call imx_gpcv2_raise_softirq which is
only built if the CONFIG_IMX_GPCV2 is enabled. Then, in
imx_gpcv2_raise_softirq depending on the existance of the ERR11171
on any platform, we call into EL3 or skip everything and get out.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
arch/arm64/kernel/smp.c

index 18e9727..21f0eb2 100644 (file)
@@ -949,10 +949,19 @@ static irqreturn_t ipi_handler(int irq, void *data)
        return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_IMX_GPCV2
+extern void imx_gpcv2_raise_softirq(const struct cpumask *mask,
+                                                        unsigned int irq);
+#endif
+
 static void smp_cross_call(const struct cpumask *target, unsigned int ipinr)
 {
        trace_ipi_raise(target, ipi_types[ipinr]);
        __ipi_send_mask(ipi_desc[ipinr], target);
+
+#ifdef CONFIG_IMX_GPCV2
+       imx_gpcv2_raise_softirq(target, ipinr);
+#endif
 }
 
 static void ipi_setup(int cpu)