Message ID | 20211105095535.3920998-1-alexander.stein@ew.tq-group.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/1] irqchip/irq-imx-gpcv2: Disable cpuidle on imx8mq | expand |
Am Freitag, dem 05.11.2021 um 10:55 +0100 schrieb Alexander Stein: > Due to errata e11171 sleeping CPUs cannot be woken up by IPIs. > > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> > --- > With reference to [1] cpuidle is broken on imx8mq with no workaround > available in mainline, probably never will. > In order to avoid to avoid booting and deadlocking imx8mq systems, > disable cpuidle unconditionally. > I was wondering which driver would be the best to add this code (it > would work pretty much everywhere), but I opted for irq-imx-gpcv2 as > this is used imx8mq (and imx7d) only. > I also added '#ifdef CONFIG_CPU_IDLE' to avoid this warning when > cpuidle > support is not compiled in, although cpuidle support without the psci > driver will this issue this warning. But using > CONFIG_ARM_PSCI_CPUIDLE > here looks odd to me. > > [1] > http://lists.infradead.org/pipermail/linux-arm-kernel/2021-November/694075.html hi Alexander, Did you see the deadlocking problems you mention? What I see in imx8mq is simply having the WFI cpuidle state, and no other one (the "real" one where wakeup is broken dua to the mentioned erratum). So I don't see the need for this patch, thank you, martin > > drivers/irqchip/irq-imx-gpcv2.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/irqchip/irq-imx-gpcv2.c b/drivers/irqchip/irq- > imx-gpcv2.c > index 5b5a365dbd5e..6a2fc3c7df67 100644 > --- a/drivers/irqchip/irq-imx-gpcv2.c > +++ b/drivers/irqchip/irq-imx-gpcv2.c > @@ -3,6 +3,7 @@ > * Copyright (C) 2015 Freescale Semiconductor, Inc. > */ > > +#include <linux/cpuidle.h> > #include <linux/of_address.h> > #include <linux/of_irq.h> > #include <linux/slab.h> > @@ -221,6 +222,13 @@ static int __init imx_gpcv2_irqchip_init(struct > device_node *node, > > core_num = (unsigned long)id->data; > > +#ifdef CONFIG_CPU_IDLE > + if (of_machine_is_compatible("fsl,imx8mq")) { > + pr_warn("Disabling cpuidle on i.MX8M due to errata > e11171\n"); > + disable_cpuidle(); > + } > +#endif > + > parent_domain = irq_find_host(parent); > if (!parent_domain) { > pr_err("%pOF: unable to get parent domain\n", node);
Am Mittwoch, dem 01.12.2021 um 12:21 +0100 schrieb Martin Kepplinger: > Am Freitag, dem 05.11.2021 um 10:55 +0100 schrieb Alexander Stein: > > Due to errata e11171 sleeping CPUs cannot be woken up by IPIs. > > > > Signed-off-by: Alexander Stein < > > alexander.stein@ew.tq-group.com > > > > > --- > > With reference to [1] cpuidle is broken on imx8mq with no > > workaround > > available in mainline, probably never will. > > In order to avoid to avoid booting and deadlocking imx8mq systems, > > disable cpuidle unconditionally. > > I was wondering which driver would be the best to add this code (it > > would work pretty much everywhere), but I opted for irq-imx-gpcv2 > > as > > this is used imx8mq (and imx7d) only. > > I also added '#ifdef CONFIG_CPU_IDLE' to avoid this warning when > > cpuidle > > support is not compiled in, although cpuidle support without the > > psci > > driver will this issue this warning. But using > > CONFIG_ARM_PSCI_CPUIDLE > > here looks odd to me. > > > > [1] > > http://lists.infradead.org/pipermail/linux-arm-kernel/2021-November/694075.html > > > > hi Alexander, > > Did you see the deadlocking problems you mention? What I see in > imx8mq > is simply having the WFI cpuidle state, and no other one (the "real" > one where wakeup is broken dua to the mentioned erratum). Hi Martin, well it was not a deadlock in the sense that everything stucked. Instead my NFS boot failed. The backlog showed me that one idling core was holding some lock while tried to get that lock. But the idling core was not woken up due to this errata. Unfortunately I don't see them with on next-20211208. This might be due to a huge CPU usage & interrupt load on various kworker threads. Preventing from going to WFI, I assume. I'll check again once this is fixed. thanks, Alexander > > drivers/irqchip/irq-imx-gpcv2.c | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > > > diff --git a/drivers/irqchip/irq-imx-gpcv2.c b/drivers/irqchip/irq- > > imx-gpcv2.c > > index 5b5a365dbd5e..6a2fc3c7df67 100644 > > --- a/drivers/irqchip/irq-imx-gpcv2.c > > +++ b/drivers/irqchip/irq-imx-gpcv2.c > > @@ -3,6 +3,7 @@ > > * Copyright (C) 2015 Freescale Semiconductor, Inc. > > */ > > > > +#include <linux/cpuidle.h> > > #include <linux/of_address.h> > > #include <linux/of_irq.h> > > #include <linux/slab.h> > > @@ -221,6 +222,13 @@ static int __init > > imx_gpcv2_irqchip_init(struct > > device_node *node, > > > > core_num = (unsigned long)id->data; > > > > +#ifdef CONFIG_CPU_IDLE > > + if (of_machine_is_compatible("fsl,imx8mq")) { > > + pr_warn("Disabling cpuidle on i.MX8M due to errata > > e11171\n"); > > + disable_cpuidle(); > > + } > > +#endif > > + > > parent_domain = irq_find_host(parent); > > if (!parent_domain) { > > pr_err("%pOF: unable to get parent domain\n", > > node); > > >
diff --git a/drivers/irqchip/irq-imx-gpcv2.c b/drivers/irqchip/irq-imx-gpcv2.c index 5b5a365dbd5e..6a2fc3c7df67 100644 --- a/drivers/irqchip/irq-imx-gpcv2.c +++ b/drivers/irqchip/irq-imx-gpcv2.c @@ -3,6 +3,7 @@ * Copyright (C) 2015 Freescale Semiconductor, Inc. */ +#include <linux/cpuidle.h> #include <linux/of_address.h> #include <linux/of_irq.h> #include <linux/slab.h> @@ -221,6 +222,13 @@ static int __init imx_gpcv2_irqchip_init(struct device_node *node, core_num = (unsigned long)id->data; +#ifdef CONFIG_CPU_IDLE + if (of_machine_is_compatible("fsl,imx8mq")) { + pr_warn("Disabling cpuidle on i.MX8M due to errata e11171\n"); + disable_cpuidle(); + } +#endif + parent_domain = irq_find_host(parent); if (!parent_domain) { pr_err("%pOF: unable to get parent domain\n", node);
Due to errata e11171 sleeping CPUs cannot be woken up by IPIs. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> --- With reference to [1] cpuidle is broken on imx8mq with no workaround available in mainline, probably never will. In order to avoid to avoid booting and deadlocking imx8mq systems, disable cpuidle unconditionally. I was wondering which driver would be the best to add this code (it would work pretty much everywhere), but I opted for irq-imx-gpcv2 as this is used imx8mq (and imx7d) only. I also added '#ifdef CONFIG_CPU_IDLE' to avoid this warning when cpuidle support is not compiled in, although cpuidle support without the psci driver will this issue this warning. But using CONFIG_ARM_PSCI_CPUIDLE here looks odd to me. [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2021-November/694075.html drivers/irqchip/irq-imx-gpcv2.c | 8 ++++++++ 1 file changed, 8 insertions(+)