All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] irqchip/irq-imx-gpcv2: Disable cpuidle on imx8mq
@ 2021-11-05  9:55 Alexander Stein
  2021-12-01 11:21 ` Martin Kepplinger
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Stein @ 2021-11-05  9:55 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer
  Cc: Alexander Stein, Pengutronix Kernel Team, linux-arm-kernel,
	Martin Kepplinger, Abel Vesa

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(+)

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);
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] irqchip/irq-imx-gpcv2: Disable cpuidle on imx8mq
  2021-11-05  9:55 [PATCH 1/1] irqchip/irq-imx-gpcv2: Disable cpuidle on imx8mq Alexander Stein
@ 2021-12-01 11:21 ` Martin Kepplinger
  2021-12-13 12:58   ` (EXT) " Alexander Stein
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Kepplinger @ 2021-12-01 11:21 UTC (permalink / raw)
  To: Alexander Stein, Shawn Guo, Sascha Hauer
  Cc: Pengutronix Kernel Team, linux-arm-kernel, Abel Vesa

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);



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: (EXT) Re: [PATCH 1/1] irqchip/irq-imx-gpcv2: Disable cpuidle on imx8mq
  2021-12-01 11:21 ` Martin Kepplinger
@ 2021-12-13 12:58   ` Alexander Stein
  0 siblings, 0 replies; 3+ messages in thread
From: Alexander Stein @ 2021-12-13 12:58 UTC (permalink / raw)
  To: Martin Kepplinger, Shawn Guo, Sascha Hauer
  Cc: Pengutronix Kernel Team, linux-arm-kernel, Abel Vesa

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);
> 
> 
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-13 13:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-05  9:55 [PATCH 1/1] irqchip/irq-imx-gpcv2: Disable cpuidle on imx8mq Alexander Stein
2021-12-01 11:21 ` Martin Kepplinger
2021-12-13 12:58   ` (EXT) " Alexander Stein

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.